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>
# smoke
- dovetail.smoke.tc001
- dovetail.smoke.tc002
+ # HA
+ - dovetail.ha.tc009
+ - dovetail.ha.tc010
+ - dovetail.ha.tc011
---
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'
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'])
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)
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
--- /dev/null
+---
+dovetail.ha.tc009:
+ name: dovetail.ha.tc009
+ objective: > # OpenStack Controll Node abnormally shutdown.
+ validate:
+ type: yardstick
+ testcase: opnfv_yardstick_tc025
+ report:
+ sub_testcase_list:
--- /dev/null
+---
+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:
--- /dev/null
+---
+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: