aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/functest_utils.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2015-12-09 12:07:40 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2015-12-09 14:07:44 +0100
commitd6c3c6ac77bb78e1f7bad6f4d9ce499791fa1cf9 (patch)
treeacb03e1e87739b0469d65c2514bc7d35ed5b129d /testcases/functest_utils.py
parent8bea42bb341239f93f8fac24b472c19e9377aa78 (diff)
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 <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/functest_utils.py')
-rw-r--r--testcases/functest_utils.py11
1 files changed, 11 insertions, 0 deletions
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 #################