summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Tikkanen <viktor.tikkanen@nokia.com>2016-01-05 07:31:56 +0200
committerViktor Tikkanen <viktor.tikkanen@nokia.com>2016-01-05 07:44:42 +0200
commita215e9127631b428420ba9b89077271a161facc4 (patch)
tree8d046323136fa3a0eda58e58f43cc2d40f43f155
parentc7dbde64949e3af540d6a6520853325111dac988 (diff)
Using shared private network
Number of tempest test cases search for shared private networks and use value of fixed_network_name parameter from tempest.conf file in case when multiple shared networks are found. Private network created by functest is updated to be "shared". Added routine for network updating into functest_utils.py. Note that currently used OpenDaylight release (Lithium) doesn't support shared private networks so network updating will fail (this is however not a fatal error). Change-Id: I5a9a0f950b3ef61b6ebfda1af4345460134cc0e3 Signed-off-by: Viktor Tikkanen <viktor.tikkanen@nokia.com>
-rwxr-xr-xtestcases/config_functest.py7
-rw-r--r--testcases/functest_utils.py10
2 files changed, 17 insertions, 0 deletions
diff --git a/testcases/config_functest.py b/testcases/config_functest.py
index 20d3a9dd7..918282a33 100755
--- a/testcases/config_functest.py
+++ b/testcases/config_functest.py
@@ -254,6 +254,13 @@ def create_private_neutron_net(neutron):
if not network_id:
return False
logger.debug("Network '%s' created successfully" % network_id)
+
+ logger.info('Updating neutron network %s...' % NEUTRON_PRIVATE_NET_NAME)
+ if functest_utils.update_neutron_net(neutron, network_id, shared=True):
+ logger.debug("Network '%s' updated successfully" % network_id)
+ else:
+ logger.info('Updating neutron network %s failed' % network_id)
+
logger.debug('Creating Subnet....')
subnet_id = functest_utils. \
create_neutron_subnet(neutron,
diff --git a/testcases/functest_utils.py b/testcases/functest_utils.py
index fe0b3be74..682c33ee3 100644
--- a/testcases/functest_utils.py
+++ b/testcases/functest_utils.py
@@ -143,6 +143,16 @@ def create_neutron_net(neutron_client, name):
return False
+def update_neutron_net(neutron_client, network_id, shared=False):
+ json_body = {'network': {'shared': shared}}
+ try:
+ neutron_client.update_network(network_id, body=json_body)
+ return True
+ except:
+ print "Error:", sys.exc_info()[0]
+ return False
+
+
def delete_neutron_net(neutron_client, network_id):
try:
neutron_client.delete_network(network_id)