Add optional shared network for tempest testing
For some nova tests tempest creates instances without specifying
a network. As a result, neutron can't to create an interface on
external network (as in contrail env) or can't choose network if
we have several external or shared networks.
This optional network will be added to generated tempest config
only if appropriate class is included in model.
Change-Id: If91b98410f96b9d3f80fa6abbf729db13f855c44
Closes-bug: PROD-25148
diff --git a/_modules/runtest/tempest_sections/compute.py b/_modules/runtest/tempest_sections/compute.py
index d131018..3400c12 100644
--- a/_modules/runtest/tempest_sections/compute.py
+++ b/_modules/runtest/tempest_sections/compute.py
@@ -77,6 +77,10 @@
fixed_network_name = self.get_item_when_condition_match('ironic.conductor.neutron.provisioning_network', c)
if fixed_network_name:
return fixed_network_name
+ net_condition = conditions.BaseRule('*.neutron.client.server.admin_identity.network.tempest-net.shared',
+ 'eq', True, multiple='any')
+ if net_condition.check(self.pillar):
+ return 'tempest-net'
return
@property
diff --git a/metadata/service/tempest/tempest_net.yml b/metadata/service/tempest/tempest_net.yml
new file mode 100644
index 0000000..f140a54
--- /dev/null
+++ b/metadata/service/tempest/tempest_net.yml
@@ -0,0 +1,20 @@
+parameters:
+ neutron:
+ client:
+ enabled: true
+ server:
+ admin_identity:
+ network:
+ tempest-net:
+ tenant: admin
+ shared: True
+ router_external: False
+ admin_state_up: True
+ subnet:
+ tempest-subnet:
+ cidr: 10.20.40.0/24
+ allocation_pools:
+ - start: 10.20.40.10
+ end: 10.20.40.254
+ gateway: 10.20.40.1
+ enable_dhcp: True
\ No newline at end of file