summaryrefslogtreecommitdiffstats
path: root/sdnvpn/test
diff options
context:
space:
mode:
authorStamatis Katsaounis <mokats@intracom-telecom.com>2018-10-15 10:18:27 +0300
committernikoskarandreas <nick@intracom-telecom.com>2018-10-15 14:58:45 +0300
commit90780e7d12b9003955cfbb8ff0155baf75b26323 (patch)
treeec874d93b0a228ea0d5d56c1dfa62677c48f83e6 /sdnvpn/test
parentcfcb04c938abdcddd76bcdd2375b4a81ea28fa51 (diff)
Replace heat client calls with openstack sdk
JIRA: SDNVPN-220 This patch replaces all calls of heat client with openstack sdk. Change-Id: I75571e8de8c06d144204af787ce240c99faea6d3 Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
Diffstat (limited to 'sdnvpn/test')
-rw-r--r--sdnvpn/test/functest/testcase_1bis.py36
1 files changed, 15 insertions, 21 deletions
diff --git a/sdnvpn/test/functest/testcase_1bis.py b/sdnvpn/test/functest/testcase_1bis.py
index f33d247..c090182 100644
--- a/sdnvpn/test/functest/testcase_1bis.py
+++ b/sdnvpn/test/functest/testcase_1bis.py
@@ -33,7 +33,7 @@ def main():
results.add_to_summary(2, "STATUS", "SUBTEST")
results.add_to_summary(0, "=")
- heat_client = os_utils.get_heat_client()
+ conn = os_utils.get_os_connection()
# neutron client is needed as long as bgpvpn heat module
# is not yet installed by default in apex (APEX-618)
neutron_client = os_utils.get_neutron_client()
@@ -60,32 +60,26 @@ def main():
env = test_utils.get_heat_environment(TESTCASE_CONFIG, COMMON_CONFIG)
logger.debug("Environment is read: '%s'" % env)
- kwargs = {
- "stack_name": TESTCASE_CONFIG.stack_name,
- "template": templ,
- "environment": env,
- "parameters": {
- "image_n": TESTCASE_CONFIG.image_name,
- "av_zone_1": az_1,
- "av_zone_2": az_2
- }
- }
- stack_id = os_utils.create_stack(heat_client, **kwargs)
+ env['name'] = TESTCASE_CONFIG.stack_name
+ env['template'] = templ
+ env['parameters']['image_n'] = TESTCASE_CONFIG.image_name
+ env['parameters']['av_zone_1'] = az_1
+ env['parameters']['av_zone_2'] = az_2
+
+ stack_id = os_utils.create_stack(conn, **env)
if stack_id is None:
logger.error("Stack create start failed")
raise SystemError("Stack create start failed")
- test_utils.wait_stack_for_status(heat_client,
- stack_id, 'CREATE_COMPLETE')
+ test_utils.wait_stack_for_status(conn, stack_id, 'CREATE_COMPLETE')
- net_1_output = os_utils.get_output(heat_client, stack_id, 'net_1_o')
- network_1_id = net_1_output['output']['output_value']
- net_2_output = os_utils.get_output(heat_client, stack_id, 'net_2_o')
- network_2_id = net_2_output['output']['output_value']
+ net_1_output = os_utils.get_output(conn, stack_id, 'net_1_o')
+ network_1_id = net_1_output['output_value']
+ net_2_output = os_utils.get_output(conn, stack_id, 'net_2_o')
+ network_2_id = net_2_output['output_value']
vm_stack_output_keys = ['vm1_o', 'vm2_o', 'vm3_o', 'vm4_o', 'vm5_o']
- vms = test_utils.get_vms_from_stack_outputs(heat_client,
- conn,
+ vms = test_utils.get_vms_from_stack_outputs(conn,
stack_id,
vm_stack_output_keys)
@@ -203,7 +197,7 @@ def main():
[], [], [], [])
try:
- test_utils.delete_stack_and_wait(heat_client, stack_id)
+ test_utils.delete_stack_and_wait(conn, stack_id)
except Exception as e:
logger.error(
"exception occurred while executing testcase_1bis: %s", e)