diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-09 11:30:21 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-09 11:49:47 +0200 |
commit | 20627d3d822e78e8a03af5c39a94e18725e858c7 (patch) | |
tree | 58f682edbd8b41b4837bcb02b1553df3efe3b7e6 /testcases/features/promise.py | |
parent | 073ca5525f38d7a7c9c67252d1b996e895ff9917 (diff) |
Generic Function to create a private network
This is to be used by all the tests which need a private network to work,
for example Tempest, Rally, vPing, ssh..
Added example for vPing and promise scripts.
Change-Id: I5d79e7b60b81b0f34230ea3ef2f3076697a1958c
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/features/promise.py')
-rw-r--r-- | testcases/features/promise.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/testcases/features/promise.py b/testcases/features/promise.py index f10e054cd..c74c7cfa7 100644 --- a/testcases/features/promise.py +++ b/testcases/features/promise.py @@ -60,6 +60,12 @@ GLANCE_IMAGE_FORMAT = functest_yaml.get('general').get('openstack').get( GLANCE_IMAGE_PATH = functest_yaml.get('general').get('directories').get( 'dir_functest_data') + "/" + GLANCE_IMAGE_FILENAME +NET_NAME = functest_yaml.get('promise').get('general').get('network_name') +SUBNET_NAME = functest_yaml.get('promise').get('general').get('subnet_name') +SUBNET_CIDR = functest_yaml.get('promise').get('general').get('subnet_cidr') +ROUTER_NAME = functest_yaml.get('promise').get('general').get('router_name') + + """ logging configuration """ logger = ft_logger.Logger("promise").getLogger() @@ -160,13 +166,16 @@ def main(): % (FLAVOR_NAME, flavor_id)) neutron = ntclient.Client(**nt_creds) - private_net = openstack_utils.get_private_net(neutron) - if private_net is None: - logger.error("There is no private network in the deployment." - "Aborting...") + + network_dic = openstack_utils.create_network_full(logger, + neutron, + NET_NAME, + SUBNET_NAME, + ROUTER_NAME, + SUBNET_CIDR) + if network_dic is False: + logger.error("Failed to create the private network...") exit(-1) - logger.debug("Using private network '%s' (%s)." % (private_net['name'], - private_net['id'])) logger.info("Exporting environment variables...") os.environ["NODE_ENV"] = "functest" @@ -175,7 +184,7 @@ def main(): os.environ["OS_PASSWORD"] = USER_PWD os.environ["OS_TEST_IMAGE"] = image_id os.environ["OS_TEST_FLAVOR"] = flavor_id - os.environ["OS_TEST_NETWORK"] = private_net['id'] + os.environ["OS_TEST_NETWORK"] = network_dic["net_id"] os.chdir(PROMISE_REPO) results_file_name = 'promise-results.json' |