aboutsummaryrefslogtreecommitdiffstats
path: root/tools/vsperf-img-modify.sh
diff options
context:
space:
mode:
authorJing Zhang <jing.c.zhang@nokia.com>2017-05-25 18:41:00 -0400
committerRoss Brattain <ross.b.brattain@intel.com>2017-08-15 00:59:22 +0000
commit39494c01b49cafd893982d74e030b9b96b5fa821 (patch)
treeb0358147876cd263385eb348d62021d2ccfc015b /tools/vsperf-img-modify.sh
parent4f842b4a7cedcc5ba89542955bf2b64c3451361d (diff)
Integrate vsperf in Tgen mode
Problem: Running Vsperf in Tgen mode is supported but the integration is not complete at the code level i.e. not ready-to-use, and dpdk loopback is not supported inside the VM. Solution: (1) Completely automates VM image generation and supports 1G huge pages. (2) Adds a new test scenario VsperfDPDK for testpmd based loopback inside the VM. Update 1-2: Fixed "line too long" issues not reported by local run_tests.sh (why?) Update 3: Per comment change to use SSH.from_node() and add unit test cases Update 4: Add more unit test cases for coverage and ready the code for merge JIRA: YARDSTICK-661 Change-Id: Iea3014d4c83e1b0c079019a4ed27771d40a7eed8 Signed-off-by: Jing Zhang <jing.c.zhang@nokia.com>
Diffstat (limited to 'tools/vsperf-img-modify.sh')
-rwxr-xr-xtools/vsperf-img-modify.sh74
1 files changed, 74 insertions, 0 deletions
diff --git a/tools/vsperf-img-modify.sh b/tools/vsperf-img-modify.sh
new file mode 100755
index 000000000..3ba697c00
--- /dev/null
+++ b/tools/vsperf-img-modify.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2017 Nokia
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# installs required packages
+# must be run from inside the image (either chrooted or running)
+
+set -ex
+
+if [ $# -eq 1 ]; then
+ nameserver_ip=$1
+
+ # /etc/resolv.conf is a symbolic link to /run, restore at end
+ rm /etc/resolv.conf
+ echo "nameserver $nameserver_ip" > /etc/resolv.conf
+ echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+ echo "nameserver 8.8.4.4" >> /etc/resolv.conf
+fi
+
+# Force apt to use ipv4 due to build problems on LF POD.
+echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
+
+echo 'GRUB_CMDLINE_LINUX="resume=/dev/sda1 default_hugepagesz=1G hugepagesz=1G hugepages=32 iommu=on iommu=pt intel_iommu=on"' >> /etc/default/grub
+
+# Add hostname to /etc/hosts.
+# Allow console access via pwd
+cat <<EOF >/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg
+manage_etc_hosts: True
+password: ubuntu
+chpasswd: { expire: False }
+ssh_pwauth: True
+EOF
+
+linuxheadersversion=`echo ls boot/vmlinuz* | cut -d- -f2-`
+
+apt-get update
+apt-get install -y \
+ linux-headers-$linuxheadersversion \
+ screen \
+ locate \
+ sshpass \
+ git
+
+cd /root
+git clone -b stable/danube https://gerrit.opnfv.org/gerrit/vswitchperf
+
+# do not compile ovs and qemu
+sed -i.bak -e 's/^\(SUBBUILDS\ =\ src_vanilla\)/#\1/' \
+ -e 's/^\(SUBDIRS\ += ovs.*\)/#\1/' \
+ -e 's/^\(SUBDIRS\ += qemu.*\)/#\1/' \
+ vswitchperf/src/Makefile
+# If these paths do not exist, vsperf wont start
+mkdir -p /root/vswitchperf/src/ovs/ovs/ovsdb/
+touch /root/vswitchperf/src/ovs/ovs/ovsdb/ovsdb-tool
+touch /root/vswitchperf/src/ovs/ovs/ovsdb/ovsdb-server
+mkdir -p /root/vswitchperf/src/qemu/qemu/x86_64-softmmu/
+touch /root/vswitchperf/src/qemu/qemu/x86_64-softmmu/qemu-system-x86_64
+mkdir -p /root/vswitchperf/src/ovs/ovs/utilities/
+touch /root/vswitchperf/src/ovs/ovs/utilities/ovs-dpctl
+touch /root/vswitchperf/src/ovs/ovs/utilities/ovs-vsctl
+touch /root/vswitchperf/src/ovs/ovs/utilities/ovs-ofctl
+touch /root/vswitchperf/src/ovs/ovs/utilities/ovs-appctl
+mkdir -p /root/vswitchperf/src/ovs/ovs/vswitchd/
+touch /root/vswitchperf/src/ovs/ovs/vswitchd/vswitch.ovsschema
+touch /root/vswitchperf/src/ovs/ovs/vswitchd/ovs-vswitchd
+
+# restore symlink
+#ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf