summaryrefslogtreecommitdiffstats
path: root/tests/test_apex_network_settings.py
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-09-28 17:22:42 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-09-28 17:22:42 +0000
commit9239d8f96cdd4dfc014de2d211312c3719eceaca (patch)
treec61fca329350af8a14fd06d97c04ece040e1b9d4 /tests/test_apex_network_settings.py
parent523c9cb5bea77f19c909ebce4fa23c9676c4dd6d (diff)
parentd8059095ab25e5939373777330b955075d064ec6 (diff)
Merge "Removing --flat and network_isolation variables"
Diffstat (limited to 'tests/test_apex_network_settings.py')
-rw-r--r--tests/test_apex_network_settings.py50
1 files changed, 25 insertions, 25 deletions
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')