From d6c3c6ac77bb78e1f7bad6f4d9ce499791fa1cf9 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Wed, 9 Dec 2015 12:07:40 +0100 Subject: Create a common network for functest for all the tests Some installers provide a private network by default, if that is the case, it will not create another one. This is needed for Rally/Tempest to work. Removed from vPing test case, since it will use that network as well. Change-Id: Iaff8a9e18026fe5aba31e567a4a8d5faf4a0bb6b Signed-off-by: jose.lausuch --- testcases/functest_utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'testcases/functest_utils.py') diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py index d09ae831..7dce96da 100644 --- a/testcases/functest_utils.py +++ b/testcases/functest_utils.py @@ -250,6 +250,17 @@ def update_sg_quota(neutron_client, tenant_id, sg_quota, sg_rule_quota): print "Error:", sys.exc_info()[0] return False + +def get_private_net(neutron_client): + # Checks if there is an existing private network + networks = neutron_client.list_networks()['networks'] + if len(networks) == 0: + return None + for net in networks: + if net['router:external'] == False: + return net + return None + # ################ GLANCE ################# -- cgit 1.2.3-korg