summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-02-10 22:04:03 -0500
committerGeorg Kunz <georg.kunz@ericsson.com>2018-02-19 15:05:39 +0100
commit10851a2d74ec28368a97252fa0e21a4171a67f16 (patch)
treea5f9d027a4c586806527887fe633fd1c369dda96
parent51a7666d0d50d0ed13c556d97aded50a3e7f30de (diff)
Add 3 new HA test cases into proposed_tests test suite
Add 3 new HA test cases into proposed_tests test suite and running them on CI. For the current 8 HA test cases and 3 other HA test cases plans to add, do some adaptions for the Yardstick Euphrates release. 1. Don't need the bugfix patch anymore. 2. The data format has changed, and has done some adaptions. 3. For Yardstick Euphrates, if setting OS_INSECURE=True, it needs to set OS_CACERT=False 4. Test case tc011 needs a image and flavor to create the stack. JIRA: DOVETAIL-614 JIRA: DOVETAIL-586 Change-Id: I9da8c8316246b9edee0d81ad18422ae6018becaf Signed-off-by: xudan <xudan16@huawei.com>
-rw-r--r--dovetail/compliance/proposed_tests.yml4
-rw-r--r--dovetail/conf/yardstick_config.yml18
-rw-r--r--dovetail/container.py7
-rw-r--r--dovetail/report.py18
-rw-r--r--dovetail/testcase/ha.tc009.yml9
-rw-r--r--dovetail/testcase/ha.tc010.yml9
-rw-r--r--dovetail/testcase/ha.tc011.yml22
7 files changed, 63 insertions, 24 deletions
diff --git a/dovetail/compliance/proposed_tests.yml b/dovetail/compliance/proposed_tests.yml
index 594abf49..ad70cf6a 100644
--- a/dovetail/compliance/proposed_tests.yml
+++ b/dovetail/compliance/proposed_tests.yml
@@ -6,3 +6,7 @@ proposed_tests:
# smoke
- dovetail.smoke.tc001
- dovetail.smoke.tc002
+ # HA
+ - dovetail.ha.tc009
+ - dovetail.ha.tc010
+ - dovetail.ha.tc011
diff --git a/dovetail/conf/yardstick_config.yml b/dovetail/conf/yardstick_config.yml
index fea8cea7..bbb2133e 100644
--- a/dovetail/conf/yardstick_config.yml
+++ b/dovetail/conf/yardstick_config.yml
@@ -1,30 +1,20 @@
---
yardstick:
image_name: opnfv/yardstick
- docker_tag: danube.3.2
+ docker_tag: opnfv-5.1.0
opts: '-id --privileged=true'
config:
dir: '/home/opnfv/userconfig'
pre_condition:
- # - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
- # source tests/ci/clean_images.sh && cleanup'
- # - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
- # source tests/ci/load_images.sh'
- # Copy Yardstick bugfix patches to Yardstick repository
- - "cp -r /home/opnfv/userconfig/patch/ /home/opnfv/repos/yardstick/"
- # Config git user info for applying bugfix patches
- - "cd /home/opnfv/repos/yardstick && git config --global user.email 'you@example.com'"
- - "cd /home/opnfv/repos/yardstick && git config --global user.name 'Your Name'"
- # Apply all bugfix patchs on tempest code
- - "cd /home/opnfv/repos/yardstick && git am ./patch/*.patch"
+ - 'echo this is pre_condition'
cmds:
- 'mkdir -p /home/opnfv/yardstick/results/'
- - "cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh &&
+ - "cd /home/opnfv/repos/yardstick && source /etc/yardstick/openstack.creds &&
yardstick task start tests/opnfv/test_cases/{{validate_testcase}}.yaml
--output-file /home/opnfv/yardstick/results/{{testcase}}.out
--task-args '{'file': '/home/opnfv/userconfig/pre_config/pod.yaml'}'"
post_condition:
- - ''
+ - 'echo this is post_condition'
result:
dir: '/home/opnfv/yardstick/results'
log: '/tmp/yardstick'
diff --git a/dovetail/container.py b/dovetail/container.py
index ca37d810..8069ea47 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -106,6 +106,9 @@ class Container(object):
else:
cls.logger.error("Can't find any external network.")
return None
+ insecure = os.getenv("OS_INSECURE")
+ if insecure and insecure.lower() == 'true':
+ envs = envs + " -e OS_CACERT=False "
log_vol = '-v %s:%s ' % (dovetail_config['result_dir'],
dovetail_config["yardstick"]['result']['log'])
@@ -356,9 +359,9 @@ class Container(object):
cls.pre_copy(container_id, src, dest)
url = dt_cfg.dovetail_config['report_dest']
if url.startswith("http"):
- cmd = ("sed -i '16s#http://127.0.0.1:8000/results#{}#g' {}"
+ cmd = ("sed -i '17s#http://127.0.0.1:8000/results#{}#g' {}"
.format(url, dest))
cls.exec_cmd(container_id, cmd)
if url.lower() == 'file':
- cmd = ("sed -i '12s/http/file/g' {}".format(dest))
+ cmd = ("sed -i '13s/http/file/g' {}".format(dest))
cls.exec_cmd(container_id, cmd)
diff --git a/dovetail/report.py b/dovetail/report.py
index 91d6d9be..9d0517b4 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -341,14 +341,16 @@ class YardstickCrawler(object):
with open(file_path, 'r') as f:
for jsonfile in f:
data = json.loads(jsonfile)
- if 1 == data['status']:
- try:
- v = data['result'][1]['benchmark']['data']['sla_pass']
- if 1 == v:
- criteria = 'PASS'
- except KeyError as e:
- self.logger.exception(
- 'Pass flag not found {}'.format(e))
+ try:
+ criteria = data['result']['criteria']
+ if criteria == 'PASS':
+ valid_tc = testcase.validate_testcase()
+ details = data['result']['testcases'][valid_tc]
+ sla_pass = details['tc_data'][0]['data']['sla_pass']
+ if not 1 == sla_pass:
+ criteria = 'FAIL'
+ except KeyError as e:
+ self.logger.exception('Pass flag not found {}'.format(e))
json_results = {'criteria': criteria}
self.logger.debug('Results: {}'.format(str(json_results)))
return json_results
diff --git a/dovetail/testcase/ha.tc009.yml b/dovetail/testcase/ha.tc009.yml
new file mode 100644
index 00000000..10f4e506
--- /dev/null
+++ b/dovetail/testcase/ha.tc009.yml
@@ -0,0 +1,9 @@
+---
+dovetail.ha.tc009:
+ name: dovetail.ha.tc009
+ objective: > # OpenStack Controll Node abnormally shutdown.
+ validate:
+ type: yardstick
+ testcase: opnfv_yardstick_tc025
+ report:
+ sub_testcase_list:
diff --git a/dovetail/testcase/ha.tc010.yml b/dovetail/testcase/ha.tc010.yml
new file mode 100644
index 00000000..6508a4dc
--- /dev/null
+++ b/dovetail/testcase/ha.tc010.yml
@@ -0,0 +1,9 @@
+---
+dovetail.ha.tc010:
+ name: dovetail.ha.tc010
+ objective: > # OpenStack Controller Messaging Queue Service High Availability.
+ validate:
+ type: yardstick
+ testcase: opnfv_yardstick_tc056
+ report:
+ sub_testcase_list:
diff --git a/dovetail/testcase/ha.tc011.yml b/dovetail/testcase/ha.tc011.yml
new file mode 100644
index 00000000..d1268826
--- /dev/null
+++ b/dovetail/testcase/ha.tc011.yml
@@ -0,0 +1,22 @@
+---
+dovetail.ha.tc011:
+ name: dovetail.ha.tc011
+ objective: > # OpenStack Controller Virtual Router Service High Availability.
+ validate:
+ type: yardstick
+ testcase: opnfv_yardstick_tc058
+ pre_condition:
+ - 'source /etc/yardstick/openstack.creds && openstack --insecure image create cirros-ha-11
+ --disk-format qcow2 --container-format bare --public
+ --file /home/opnfv/userconfig/pre_config/cirros-0.3.5-x86_64-disk.img'
+ cmds:
+ - 'mkdir -p /home/opnfv/yardstick/results/'
+ - "cd /home/opnfv/repos/yardstick && source /etc/yardstick/openstack.creds &&
+ yardstick task start tests/opnfv/test_cases/{{validate_testcase}}.yaml
+ --output-file /home/opnfv/yardstick/results/{{testcase}}.out
+ --task-args '{'file': '/home/opnfv/userconfig/pre_config/pod.yaml',
+ 'image': 'cirros-ha-11', 'flavor': 'm1.tiny'}'"
+ post_condition:
+ - 'source /etc/yardstick/openstack.creds && openstack --insecure image delete cirros-ha-11'
+ report:
+ sub_testcase_list: