summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2019-02-27 03:46:32 -0500
committerxudan <xudan16@huawei.com>2019-02-27 03:52:51 -0500
commit346e28bf54f17354a7f784f57d3d52b9b91f22cd (patch)
tree8ae58002f3448bc993e5e05a64eab7653075e517
parent05ffb18a9d045fe94e93e9fdae376939f5d12d0b (diff)
Add a patch to Bottlenecks
This submit add a patch to Bottlenecks container created by Dovetail to change source code in Yardstick container created by Bottlenecks itself. The changes are: 1. Add SLA check to avoid the Nonetype exception 2. Let the target server be created before the host server in order to give the target one more time to setup. Change-Id: If988a33e4ae6fccd56b10547885b65aa3c019cca Signed-off-by: xudan <xudan16@huawei.com>
-rw-r--r--etc/conf/bottlenecks_config.yml1
-rw-r--r--etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-add-patch-yardstick-container.patch46
-rw-r--r--etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-adding-ping-bottlenecks-sla.patch47
-rwxr-xr-xetc/patches/bottlenecks/bugfix-add-ping-sla/apply.sh14
4 files changed, 108 insertions, 0 deletions
diff --git a/etc/conf/bottlenecks_config.yml b/etc/conf/bottlenecks_config.yml
index c365a3c9..9afae8d2 100644
--- a/etc/conf/bottlenecks_config.yml
+++ b/etc/conf/bottlenecks_config.yml
@@ -21,6 +21,7 @@ bottlenecks:
pre_condition:
- 'cp /home/opnfv/userconfig/images/ubuntu-16.04-server-cloudimg-amd64-disk1.img /tmp/yardstick.img'
- '/home/patches/bottlenecks/make-ram_num-configurable/apply.sh'
+ - '/home/patches/bottlenecks/bugfix-add-ping-sla/apply.sh'
cmds:
- 'python /home/opnfv/bottlenecks/testsuites/run_testsuite.py testcase {{validate_testcase}} False'
post_condition:
diff --git a/etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-add-patch-yardstick-container.patch b/etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-add-patch-yardstick-container.patch
new file mode 100644
index 00000000..44fbfe49
--- /dev/null
+++ b/etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-add-patch-yardstick-container.patch
@@ -0,0 +1,46 @@
+From ad1bcede4a1961209a2972e2776027273b965bac Mon Sep 17 00:00:00 2001
+From: Dovetail <verified@opnfv.org>
+Date: Wed, 27 Feb 2019 04:08:38 +0000
+Subject: [PATCH] Bugfix add patch yardstick container
+
+Signed-off-by: Dovetail <verified@opnfv.org>
+---
+ testsuites/run_testsuite.py | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/testsuites/run_testsuite.py b/testsuites/run_testsuite.py
+index 0f03d3e..d05c1b7 100644
+--- a/testsuites/run_testsuite.py
++++ b/testsuites/run_testsuite.py
+@@ -104,6 +104,20 @@ def docker_env_prepare(config):
+ return
+
+
++def patch_yardstick_container():
++ LOG.info("Begin to patch yardstick container")
++ client = docker_env.get_client()
++ yardstick_container = docker_env.yardstick_info["container"]
++ cmd = "/bin/bash -c 'cd /home/opnfv/repos/yardstick && \
++ git config --global user.email verified@opnfv.org && \
++ git config --global user.name Dovetail && \
++ git am /home/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-adding-ping-bottlenecks-sla.patch'"
++ try:
++ yardstick_container.exec_run(cmd=cmd, privileged=True, tty=True, detach=True)
++ except docker_env.docker.errors.APIError:
++ LOG.error("Failed to patch yardstick container.")
++
++
+ def testsuite_run(test_level, test_name, REPORT="False"):
+ tester_parser = test_name.split("_")
+ if test_level == "testcase":
+@@ -117,6 +131,7 @@ def testsuite_run(test_level, test_name, REPORT="False"):
+ start_date = datetime.datetime.now()
+ docker_env_prepare(config[testcase])
+ copy_hosts_file()
++ patch_yardstick_container()
+ #try:
+ # posca_testcase_run(tester_parser[0], testcase, config[testcase])
+ #except Exception, e:
+--
+2.7.4
+
diff --git a/etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-adding-ping-bottlenecks-sla.patch b/etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-adding-ping-bottlenecks-sla.patch
new file mode 100644
index 00000000..01e0b582
--- /dev/null
+++ b/etc/patches/bottlenecks/bugfix-add-ping-sla/0001-Bugfix-adding-ping-bottlenecks-sla.patch
@@ -0,0 +1,47 @@
+From 6ce4dbf96eb2e6b0b4c4681d51473cb151601ddf Mon Sep 17 00:00:00 2001
+From: Dovetail <verified@opnfv.org>
+Date: Tue, 26 Feb 2019 12:05:20 +0000
+Subject: [PATCH] Bugfix adding ping bottlenecks sla
+
+Signed-off-by: Dovetail <verified@opnfv.org>
+---
+ samples/ping_bottlenecks.yaml | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/samples/ping_bottlenecks.yaml b/samples/ping_bottlenecks.yaml
+index 6a586cb..895ec78 100644
+--- a/samples/ping_bottlenecks.yaml
++++ b/samples/ping_bottlenecks.yaml
+@@ -27,12 +27,14 @@ scenarios:
+ type: Ping
+ options:
+ packetsize: 100
+- host: demo1.demo{{num}}
+- target: demo2.demo{{num}}
++ host: demo2.demo{{num}}
++ target: demo1.demo{{num}}
+ runner:
+ type: Duration
+ duration: 60
+ interval: 1
++ sla:
++ max_rtt: 10
+ {% endfor %}
+
+ contexts:
+@@ -67,10 +69,10 @@ contexts:
+ policy: "availability"
+
+ servers:
+- demo1:
++ demo2:
+ floating_ip: true
+ placement: "pgrp1"
+- demo2:
++ demo1:
+ placement: "pgrp1"
+
+ networks:
+--
+2.7.4
+
diff --git a/etc/patches/bottlenecks/bugfix-add-ping-sla/apply.sh b/etc/patches/bottlenecks/bugfix-add-ping-sla/apply.sh
new file mode 100755
index 00000000..9e56ef5a
--- /dev/null
+++ b/etc/patches/bottlenecks/bugfix-add-ping-sla/apply.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e
+set -u
+
+cd /home/opnfv/bottlenecks
+# without setting the user, git does not allow to create a commit
+git config --global user.email "verified@opnfv.org"
+git config --global user.name "Dovetail"
+
+git am $(dirname $0)/0001-Bugfix-add-patch-yardstick-container.patch
+
+cp testsuites/run_testsuite.py /usr/local/lib/python2.7/dist-packages/testsuites/run_testsuite.py
+
+exit 0