diff options
author | Dan Radez <dradez@redhat.com> | 2016-09-15 14:36:24 -0400 |
---|---|---|
committer | Dan Radez <dradez@redhat.com> | 2016-09-27 15:34:58 -0400 |
commit | d8059095ab25e5939373777330b955075d064ec6 (patch) | |
tree | 3254a048d2d183e848d772e4bf6f61c96a0a3577 /tests | |
parent | fdcadb59d666e277d91629ed75705b4636a8749c (diff) |
Removing --flat and network_isolation variables
VLAN support allows a set of nodes with a single nic to deploy removing
the need for --flat. flat was not well maintained or tested.
Change-Id: Ieae1c2350c83544ce50048b44300fa0b8e68dd43
Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_apex_network_environment.py | 10 | ||||
-rw-r--r-- | tests/test_apex_network_settings.py | 50 | ||||
-rw-r--r-- | tests/test_apex_python_utils_py.py | 1 |
3 files changed, 30 insertions, 31 deletions
diff --git a/tests/test_apex_network_environment.py b/tests/test_apex_network_environment.py index 7c9b922f..df0f0334 100644 --- a/tests/test_apex_network_environment.py +++ b/tests/test_apex_network_environment.py @@ -37,11 +37,11 @@ class TestNetworkEnvironment(object): def setup_class(klass): """This method is run once for each class before any tests are run""" klass.ns = NetworkSettings( - '../config/network/network_settings.yaml', True) + '../config/network/network_settings.yaml') klass.ns_vlans = NetworkSettings( - '../config/network/network_settings_vlans.yaml', True) + '../config/network/network_settings_vlans.yaml') klass.ns_ipv6 = NetworkSettings( - '../config/network/network_settings_v6.yaml', True) + '../config/network/network_settings_v6.yaml') @classmethod def teardown_class(klass): @@ -130,7 +130,7 @@ class TestNetworkEnvironment(object): ns = copy(self.ns_vlans) ns['networks'][API_NETWORK]['enabled'] = True ns['networks'][API_NETWORK]['cidr'] = '10.11.12.0/24' - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) # test vlans ne = NetworkEnvironment(ns, '../build/network-environment.yaml') assert_equal(ne['parameter_defaults']['InternalApiNetworkVlanID'], 101) @@ -138,7 +138,7 @@ class TestNetworkEnvironment(object): def test_netenv_settings_api_network_vlans(self): ns = copy(self.ns_vlans) ns['networks'][API_NETWORK]['enabled'] = True - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) # test vlans ne = NetworkEnvironment(ns, '../build/network-environment.yaml') assert_equal(ne['parameter_defaults']['InternalApiNetworkVlanID'], 101) diff --git a/tests/test_apex_network_settings.py b/tests/test_apex_network_settings.py index 47c13cc5..955c0cf7 100644 --- a/tests/test_apex_network_settings.py +++ b/tests/test_apex_network_settings.py @@ -44,12 +44,12 @@ class TestNetworkSettings(object): def test_init(self): assert_is_instance( - NetworkSettings(files_dir+'network_settings.yaml', True), + NetworkSettings(files_dir+'network_settings.yaml'), NetworkSettings) def test_init_vlans(self): assert_is_instance( - NetworkSettings(files_dir+'network_settings_vlans.yaml', True), + NetworkSettings(files_dir+'network_settings_vlans.yaml'), NetworkSettings) # TODO, v6 test is stuck @@ -59,34 +59,34 @@ class TestNetworkSettings(object): # NetworkSettings) def test_init_admin_disabled_or_missing(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove admin, apex section will re-add it ns['networks'].pop('admin', None) - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) # remove admin and apex ns.pop('apex', None) ns['networks'].pop('admin', None) - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) def test_init_collapse_storage(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove storage ns['networks'].pop('storage', None) - assert_is_instance(NetworkSettings(ns, True), NetworkSettings) + assert_is_instance(NetworkSettings(ns), NetworkSettings) def test_init_missing_dns_domain(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove storage ns.pop('dns-domain', None) - assert_is_instance(NetworkSettings(ns, True), NetworkSettings) + assert_is_instance(NetworkSettings(ns), NetworkSettings) def test_dump_bash(self): - ns = NetworkSettings('../config/network/network_settings.yaml', True) + ns = NetworkSettings('../config/network/network_settings.yaml') assert_equal(ns.dump_bash(), None) assert_equal(ns.dump_bash(path='/dev/null'), None) def test_get_network_settings(self): - ns = NetworkSettings('../config/network/network_settings.yaml', True) + ns = NetworkSettings('../config/network/network_settings.yaml') assert_is_instance(ns, NetworkSettings) for role in ['controller', 'compute']: nic_index = 1 @@ -97,41 +97,41 @@ class TestNetworkSettings(object): nic_index += 1 def test_get_enabled_networks(self): - ns = NetworkSettings('../config/network/network_settings.yaml', True) + ns = NetworkSettings('../config/network/network_settings.yaml') assert_is_instance(ns.enabled_network_list, list) def test_invalid_nic_members(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') storage_net_nicmap = ns['networks'][STORAGE_NETWORK]['nic_mapping'] # set duplicate nic storage_net_nicmap['compute']['members'][0] = 'nic1' - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) # remove nic members storage_net_nicmap['compute']['members'] = [] - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) def test_missing_vlan(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') storage_net_nicmap = ns['networks'][STORAGE_NETWORK]['nic_mapping'] # remove vlan from storage net storage_net_nicmap['compute'].pop('vlan', None) - assert_is_instance(NetworkSettings(ns, True), NetworkSettings) + assert_is_instance(NetworkSettings(ns), NetworkSettings) # TODO # need to manipulate interfaces some how # maybe for ip_utils to return something to pass this # def test_admin_auto_detect(self): -# ns = NetworkSettings(files_dir+'network_settings.yaml', True) +# ns = NetworkSettings(files_dir+'network_settings.yaml') # # remove cidr to force autodetection # ns['networks'][ADMIN_NETWORK].pop('cidr', None) -# assert_is_instance(NetworkSettings(ns, True), NetworkSettings) +# assert_is_instance(NetworkSettings(ns), NetworkSettings) def test_admin_fail_auto_detect(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove cidr and installer_vm to fail autodetect ns['networks'][ADMIN_NETWORK].pop('cidr', None) ns['networks'][ADMIN_NETWORK].pop('installer_vm', None) - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) def test_exception(self): e = NetworkSettingsException("test") @@ -139,22 +139,22 @@ class TestNetworkSettings(object): assert_is_instance(e, NetworkSettingsException) def test_config_ip(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # set the provisioner ip to None to force _gen_ip to generate one ns['networks'][ADMIN_NETWORK]['installer_vm']['ip'] = None ns['networks'][EXTERNAL_NETWORK][0]['installer_vm']['ip'] = None # Now rebuild network settings object and check for repopulated values - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) assert_equal(ns['networks'][ADMIN_NETWORK]['installer_vm']['ip'], '192.0.2.1') assert_equal(ns['networks'][EXTERNAL_NETWORK][0]['installer_vm']['ip'], '192.168.37.1') def test_config_gateway(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # set the gateway ip to None to force _config_gateway to generate one ns['networks'][EXTERNAL_NETWORK][0]['gateway'] = None # Now rebuild network settings object and check for a repopulated value - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) assert_equal(ns['networks'][EXTERNAL_NETWORK][0]['gateway'], '192.168.37.1') diff --git a/tests/test_apex_python_utils_py.py b/tests/test_apex_python_utils_py.py index 28180f06..eb16f67d 100644 --- a/tests/test_apex_python_utils_py.py +++ b/tests/test_apex_python_utils_py.py @@ -62,7 +62,6 @@ class TestCommonUtils(object): tmp_dir = tempfile.mkdtemp() args = self.parser.parse_args(['parse-net-settings', '-s', net_sets, - '--flat', '-td', tmp_dir, '-e', net_env]) assert_equal(parse_net_settings(args), None) |