diff options
-rw-r--r-- | dovetail/compliance/proposed_tests.yml | 4 | ||||
-rw-r--r-- | dovetail/conf/yardstick_config.yml | 18 | ||||
-rw-r--r-- | dovetail/container.py | 7 | ||||
-rw-r--r-- | dovetail/report.py | 18 | ||||
-rw-r--r-- | dovetail/testcase/ha.tc009.yml | 9 | ||||
-rw-r--r-- | dovetail/testcase/ha.tc010.yml | 9 | ||||
-rw-r--r-- | dovetail/testcase/ha.tc011.yml | 22 |
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: |