diff options
Diffstat (limited to 'testcases')
-rwxr-xr-x | testcases/config_functest.py | 7 | ||||
-rw-r--r-- | testcases/functest_utils.py | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/testcases/config_functest.py b/testcases/config_functest.py index 483c02c4c..b4e29bf69 100755 --- a/testcases/config_functest.py +++ b/testcases/config_functest.py @@ -263,6 +263,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) |