aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-11-26 15:55:51 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2020-11-26 15:57:18 +0100
commit95260dfc4fc815c06863441b9a09909d1ce741d0 (patch)
treec3eefa65ab913cb83301ce6886923f3bba7ec34b
parent6ec008d1f66a74839141f6b9d8fed2d7ed3d1360 (diff)
Allow running tempest without tenant network resources.
It fits the Airship deployment where there is neither tenant networks nor floating ips. It only updates the scenarios and must be completed by other changes for all the advanced testcases (Rally, Tempest, etc) Change-Id: I8077400536628ed2349b548efee3c3e165a0a5c3 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit d88bd86e9e5b00f0c5bbbe9df0cb6f3002cb06b0)
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py40
1 files changed, 32 insertions, 8 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index d2c54262a..fc92a69b0 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -283,6 +283,8 @@ class TempestCommon(singlevm.VmReady2):
assert os.path.exists(
account_file), "{} doesn't exist".format(account_file)
rconfig.set('auth', 'test_accounts_file', account_file)
+ if env.get('NO_TENANT_NETWORK').lower() == 'true':
+ rconfig.set('auth', 'create_isolated_networks', False)
rconfig.set('identity', 'admin_role', admin_role_name)
rconfig.set('identity', 'default_domain_id', domain_id)
if not rconfig.has_section('network'):
@@ -502,8 +504,11 @@ class TempestCommon(singlevm.VmReady2):
rconfig.read(self.conf_file)
if not rconfig.has_section('network'):
rconfig.add_section('network')
- rconfig.set('network', 'public_network_id', self.ext_net.id)
- rconfig.set('network', 'floating_network_name', self.ext_net.name)
+ if self.ext_net:
+ rconfig.set('network', 'public_network_id', self.ext_net.id)
+ rconfig.set('network', 'floating_network_name', self.ext_net.name)
+ else:
+ rconfig.set('network-feature-enabled', 'floating_ips', False)
with open(self.conf_file, 'w') as config_file:
rconfig.write(config_file)
@@ -513,7 +518,9 @@ class TempestCommon(singlevm.VmReady2):
rconfig.read(self.conf_file)
if not rconfig.has_section('compute'):
rconfig.add_section('compute')
- rconfig.set('compute', 'fixed_network_name', self.network.name)
+ rconfig.set(
+ 'compute', 'fixed_network_name',
+ self.network.name if self.network else env.get("EXTERNAL_NETWORK"))
with open(self.conf_file, 'w') as config_file:
rconfig.write(config_file)
@@ -523,7 +530,12 @@ class TempestCommon(singlevm.VmReady2):
rconfig.read(self.conf_file)
if not rconfig.has_section('validation'):
rconfig.add_section('validation')
- rconfig.set('validation', 'network_for_ssh', self.network.name)
+ rconfig.set(
+ 'validation', 'connect_method',
+ 'floating' if self.ext_net else 'fixed')
+ rconfig.set(
+ 'validation', 'network_for_ssh',
+ self.network.name if self.network else env.get("EXTERNAL_NETWORK"))
with open(self.conf_file, 'w') as config_file:
rconfig.write(config_file)
@@ -719,10 +731,22 @@ class TempestHeat(TempestCommon):
rconfig.set('heat_plugin', 'instance_type', self.flavor_alt.id)
rconfig.set('heat_plugin', 'minimal_image_ref', self.image.id)
rconfig.set('heat_plugin', 'minimal_instance_type', self.flavor.id)
- rconfig.set('heat_plugin', 'floating_network_name', self.ext_net.name)
- rconfig.set('heat_plugin', 'fixed_network_name', self.network.name)
- rconfig.set('heat_plugin', 'fixed_subnet_name', self.subnet.name)
- rconfig.set('heat_plugin', 'network_for_ssh', self.network.name)
+ if self.ext_net:
+ rconfig.set(
+ 'heat_plugin', 'floating_network_name', self.ext_net.name)
+ if self.network:
+ rconfig.set('heat_plugin', 'fixed_network_name', self.network.name)
+ rconfig.set('heat_plugin', 'fixed_subnet_name', self.subnet.name)
+ rconfig.set('heat_plugin', 'network_for_ssh', self.network.name)
+ else:
+ LOGGER.warning(
+ 'No tenant network created. '
+ 'Trying EXTERNAL_NETWORK as a fallback')
+ rconfig.set(
+ 'heat_plugin', 'fixed_network_name',
+ env.get("EXTERNAL_NETWORK"))
+ rconfig.set(
+ 'heat_plugin', 'network_for_ssh', env.get("EXTERNAL_NETWORK"))
with open(self.conf_file, 'w') as config_file:
rconfig.write(config_file)
self.backup_tempest_config(self.conf_file, self.res_dir)