summaryrefslogtreecommitdiffstats
path: root/ci/envs
diff options
context:
space:
mode:
authorNavya <navyax.bathula@intel.com>2017-10-04 02:55:58 -0700
committerNavya Bathula <navyax.bathula@intel.com>2017-11-29 10:32:48 +0000
commit7ea7eea6dab8c1b40c2626eead4ced80e77f87b9 (patch)
tree9e914f0c3c68405d0cacc813613c7a11cfb798c2 /ci/envs
parentc8298861407f3f33af25691ea60841c104938dac (diff)
Execution of Livemigration through Yardstickopnfv-5.2.0
This Patch includes the scripts to execute the live migration test using Yardstick and providing the information of VM downtime, setuptime,totaltime Change-Id: Ibe768adde1e5b2289a716524a274081cca97751d Co-Authored by:RajithaY<rajithax.yerrumsetty@intel.com> Signed-off-by: Navya <navyax.bathula@intel.com>
Diffstat (limited to 'ci/envs')
-rwxr-xr-xci/envs/host-run-livemigration.sh17
-rwxr-xr-xci/envs/host-setup0.sh5
-rwxr-xr-xci/envs/lmtest.sh77
3 files changed, 91 insertions, 8 deletions
diff --git a/ci/envs/host-run-livemigration.sh b/ci/envs/host-run-livemigration.sh
index a089ad482..a5f285282 100755
--- a/ci/envs/host-run-livemigration.sh
+++ b/ci/envs/host-run-livemigration.sh
@@ -41,7 +41,7 @@ function run_qemusrc() {
-device virtio-net-pci,netdev=net1,mac=$MACADDRESS1 \
-chardev socket,id=char2,path=$VHOSTPATH2 \
-netdev type=vhost-user,id=net2,chardev=char2,vhostforce \
- -device virtio-net-pci,netdev=net2,mac=$MACADDRESS2 -m 1024 -mem-path /dev/hugepages \
+ -device virtio-net-pci,netdev=net2,mac=$MACADDRESS2 -m 2048 -mem-path /dev/hugepages \
-mem-prealloc -realtime mlock=on -monitor unix:${qmp_sock_src},server,nowait \
-balloon virtio -drive file=/root/guest1.qcow2 -vnc :1 &
if [ ${?} -ne 0 ] ; then
@@ -56,7 +56,7 @@ function run_qemulisten() {
-device virtio-net-pci,netdev=net1,mac=$MACADDRESS1 \
-chardev socket,id=char2,path=$VHOSTPATH4 \
-netdev type=vhost-user,id=net2,chardev=char2,vhostforce \
- -device virtio-net-pci,netdev=net2,mac=$MACADDRESS2 -m 1024 -mem-path /dev/hugepages \
+ -device virtio-net-pci,netdev=net2,mac=$MACADDRESS2 -m 2048 -mem-path /dev/hugepages \
-mem-prealloc -realtime mlock=on -monitor unix:${qmp_sock_dst},server,nowait \
-balloon virtio -drive file=/root/guest1.qcow2 -incoming tcp:${incoming_ip}:${migrate_port} -vnc :3 &
if [ ${?} -ne 0 ] ; then
@@ -101,8 +101,11 @@ sleep 60
echo "Running Qemu listen"
run_qemulisten
sleep 60
-do_migration $qmp_sock_src $qmp_sock_dst
-if [ ${?} -ne 0 ] ; then
- echo "Migration Failed"
- exit 1
-fi
+echo "To check qemu src and dst are created"
+ls -la /tmp/ | grep qmp-sock-*
+echo "End of host-run-livemigration"
+#do_migration $qmp_sock_src $qmp_sock_dst
+#if [ ${?} -ne 0 ] ; then
+ #echo "Migration Failed"
+ #exit 1
+#fi
diff --git a/ci/envs/host-setup0.sh b/ci/envs/host-setup0.sh
index 1bd7f1205..e852726d7 100755
--- a/ci/envs/host-setup0.sh
+++ b/ci/envs/host-setup0.sh
@@ -19,6 +19,7 @@ if [ -z $KERNEL_VERSION ];then
fi
rpmdir=${1:-"/root/workspace/rpm/"}
rpmpat="kernel-${KERNEL_VERSION}*.rpm"
+rpmdev="kernel-devel-${KERNEL_VERSION}*.rpm"
config_grub () {
key=$1
@@ -31,7 +32,7 @@ config_grub () {
fi
}
-# The script's caller should passing the rpm directory that is built out from
+# The script's caller should passing the rpm directory that is built out from
# build.sh. The default rpmdir is the one used by yardstick scripts.
install_kernel () {
# Install the kernel rpm
@@ -46,7 +47,9 @@ install_kernel () {
exit 1
else
krpm=`find "${rpmdir}" -name "${rpmpat}"`
+ kdrpm=`find "${rpmdir}" -name "${rpmdev}"`
rpm -ihv $krpm
+ rpm -ihv $kdrpm
fi
}
diff --git a/ci/envs/lmtest.sh b/ci/envs/lmtest.sh
new file mode 100755
index 000000000..9136fb62b
--- /dev/null
+++ b/ci/envs/lmtest.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+###########################################################
+## Invoking this script from ubuntu docker container runs
+## cyclictest through yardstick
+###########################################################
+source utils.sh
+
+HOST_IP=$( getHostIP )
+pod_config='/opt/scripts/pod.yaml'
+lmtest_context_file='/opt/migrate-node-context.yaml'
+yardstick_prefix='/root/yardstick/yardstick/benchmark/scenarios/compute' # yardstick teardown path
+
+if [ ! -f ${pod_config} ] ; then
+ echo "file ${pod_config} not found"
+ exit 1
+fi
+
+if [ ! -f ${lmtest_context_file} ] ; then
+ echo "file ${lmtest_context_file} not found"
+ exit 1
+fi
+
+#Execution of the post-execute script copied requires re-installation of yardstick
+( cd /root/yardstick ; python setup.py install )
+
+#setting up of image for launching guest vm.
+ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
+root@$HOST_IP "cp /root/images/guest1.qcow2 /root/"
+
+#Updating the yardstick.conf file for daily
+function updateConfDaily() {
+ DISPATCHER_TYPE=influxdb
+ DISPATCHER_FILE_NAME="/tmp/yardstick.out"
+ # Use the influxDB on the jumping server
+ DISPATCHER_INFLUXDB_TARGET="http://104.197.68.199:8086"
+ mkdir -p /etc/yardstick
+ cat << EOF > /etc/yardstick/yardstick.conf
+[DEFAULT]
+debug = True
+dispatcher = ${DISPATCHER_TYPE}
+
+[dispatcher_file]
+file_name = ${DISPATCHER_FILE_NAME}
+
+[dispatcher_influxdb]
+timeout = 5
+db_name = yardstick
+username = opnfv
+password = 0pnfv2015
+target = ${DISPATCHER_INFLUXDB_TARGET}
+EOF
+}
+
+#Function call to update yardstick conf file based on Job type
+#if [ "$testType" == "daily" ];then
+# updateConfDaily
+#fi
+
+echo "changing the qemu-migrate.py"
+sed -i "s/\/root\/workspace/\/root\/workspace\//g" ${yardstick_prefix}/qemu_migrate.py
+sed -i "s/host.put_file/host._put_file_shell/g" ${yardstick_prefix}/qemu_migrate.py
+
+#Running livemigration through yardstick
+echo "Executing livemigration through yardstick"
+yardstick -d task start ${lmtest_context_file}
+output=$?
+
+if [ "$testType" == "verify" ];then
+ chmod 777 /tmp/yardstick.out
+ cat /tmp/yardstick.out > /opt/yardstick.out
+fi
+
+if [ $output != 0 ];then
+ echo "Yardstick Failed !!!"
+ exit 1
+fi