Enable testing without a public network
Scenario: when the floating IP pool is not specified and there is direct access to the private network (management network for the Sahara cluster). Change-Id: I19a1798790b8173d458be66bc4a28bb1cb6f970e
This commit is contained in:
parent
0cbdf47218
commit
82a5d28150
|
@ -349,7 +349,7 @@ This section is dictionary-type.
|
|||
| private_network | string | True | private | name or id of |
|
||||
| | | | | private network|
|
||||
+-----------------------------+---------+----------+---------+----------------+
|
||||
| public_network | string | True | public | name or id of |
|
||||
| public_network | string | | public | name or id of |
|
||||
| | | | | private network|
|
||||
+-----------------------------+---------+----------+---------+----------------+
|
||||
| type | string | | neutron | "neutron" or |
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The public network field can be omitted from the configuration file of
|
||||
the scenario, enabling the testing when only the project network is used.
|
|
@ -522,11 +522,12 @@ class BaseTestCase(base.BaseTestCase):
|
|||
security_group = None
|
||||
proxy_exist = False
|
||||
|
||||
if self.network['type'] == 'neutron':
|
||||
floating_ip_pool = self.neutron.get_network_id(
|
||||
self.network['public_network'])
|
||||
elif not self.network['auto_assignment_floating_ip']:
|
||||
floating_ip_pool = self.network['public_network']
|
||||
if self.network['public_network']:
|
||||
if self.network['type'] == 'neutron':
|
||||
floating_ip_pool = self.neutron.get_network_id(
|
||||
self.network['public_network'])
|
||||
elif not self.network['auto_assignment_floating_ip']:
|
||||
floating_ip_pool = self.network['public_network']
|
||||
|
||||
node_groups = []
|
||||
for ng in self.testcase['node_group_templates']:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<%page args="network_public_name=''"/>
|
||||
|
||||
network:
|
||||
type: ${network_type}
|
||||
private_network: ${network_private_name}
|
||||
public_network: ${network_public_name}
|
||||
type: '${network_type}'
|
||||
private_network: '${network_private_name}'
|
||||
public_network: '${network_public_name}'
|
||||
|
|
|
@ -51,7 +51,7 @@ def set_defaults(config):
|
|||
net['private_network'] = net.get('private_network', 'private')
|
||||
net['auto_assignment_floating_ip'] = net.get('auto_assignment_floating_ip',
|
||||
False)
|
||||
net['public_network'] = net.get('public_network', 'public')
|
||||
net['public_network'] = net.get('public_network', '')
|
||||
|
||||
default_scenario = ['run_jobs', 'scale', 'run_jobs']
|
||||
|
||||
|
|
|
@ -74,8 +74,7 @@ SCHEMA = {
|
|||
"type": "boolean"
|
||||
},
|
||||
"public_network": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
"type": "string"
|
||||
},
|
||||
"private_network": {
|
||||
"type": "string",
|
||||
|
|
|
@ -63,7 +63,7 @@ class RunnerUnitTest(testtools.TestCase):
|
|||
"network": {
|
||||
"type": "neutron",
|
||||
"private_network": "private",
|
||||
"public_network": "public",
|
||||
"public_network": "",
|
||||
"auto_assignment_floating_ip": False
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue