summaryrefslogtreecommitdiffstats
path: root/apex/tests
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-11-13 16:10:36 -0500
committerTim Rozet <trozet@redhat.com>2017-11-16 14:51:16 -0500
commitb66bc18349140b0a3e34fac207819c57c25a1cbb (patch)
tree6d63e597faf292c21e9dca4f4d93cd02ea299573 /apex/tests
parente1c2217d0310a3fec511f34b36e8391aa83eac01 (diff)
Migrates Apex to Pike
JIRA: APEX-544 Change-Id: Ibee2068e782da75268ed76beb36ccb5dcd1847d6 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/tests')
-rw-r--r--apex/tests/test_apex_deploy.py6
-rw-r--r--apex/tests/test_apex_ip_utils.py2
-rw-r--r--apex/tests/test_apex_network_environment.py13
3 files changed, 9 insertions, 12 deletions
diff --git a/apex/tests/test_apex_deploy.py b/apex/tests/test_apex_deploy.py
index 0a9b6c1..403b709 100644
--- a/apex/tests/test_apex_deploy.py
+++ b/apex/tests/test_apex_deploy.py
@@ -107,6 +107,7 @@ class TestDeploy(unittest.TestCase):
args.virtual = True
assert_raises(ApexDeployException, validate_deploy_args, args)
+ @patch('apex.deploy.network_data.create_network_data')
@patch('apex.deploy.shutil')
@patch('apex.deploy.oc_deploy')
@patch('apex.deploy.uc_lib')
@@ -131,7 +132,7 @@ class TestDeploy(unittest.TestCase):
mock_deploy_sets, mock_net_sets, mock_net_env,
mock_utils, mock_parsers, mock_oc_cfg,
mock_virt_utils, mock_inv, mock_build_vms, mock_uc_lib,
- mock_oc_deploy, mock_shutil):
+ mock_oc_deploy, mock_shutil, mock_network_data):
net_sets_dict = {'networks': MagicMock(),
'dns_servers': 'test'}
ds_opts_dict = {'global_params': MagicMock(),
@@ -177,6 +178,7 @@ class TestDeploy(unittest.TestCase):
args.debug = True
main()
+ @patch('apex.deploy.network_data.create_network_data')
@patch('apex.deploy.shutil')
@patch('apex.deploy.oc_deploy')
@patch('apex.deploy.uc_lib')
@@ -201,7 +203,7 @@ class TestDeploy(unittest.TestCase):
mock_deploy_sets, mock_net_sets, mock_net_env,
mock_utils, mock_parsers, mock_oc_cfg,
mock_virt_utils, mock_inv, mock_build_vms, mock_uc_lib,
- mock_oc_deploy, mock_shutil):
+ mock_oc_deploy, mock_shutil, mock_network_data):
# didn't work yet line 412
# net_sets_dict = {'networks': {'admin': {'cidr': MagicMock()}},
# 'dns_servers': 'test'}
diff --git a/apex/tests/test_apex_ip_utils.py b/apex/tests/test_apex_ip_utils.py
index eb4549d..5fdae31 100644
--- a/apex/tests/test_apex_ip_utils.py
+++ b/apex/tests/test_apex_ip_utils.py
@@ -75,8 +75,6 @@ class TestIpUtils:
def test_find_gateway(self):
assert_is_instance(find_gateway(self.iface), str)
- iface_virbr0 = get_interface('virbr0')
- assert_equal(find_gateway(iface_virbr0), None)
def test_get_ip(self):
cidr = ipaddress.ip_network("10.10.10.0/24")
diff --git a/apex/tests/test_apex_network_environment.py b/apex/tests/test_apex_network_environment.py
index 4e3ae11..79a72a5 100644
--- a/apex/tests/test_apex_network_environment.py
+++ b/apex/tests/test_apex_network_environment.py
@@ -76,8 +76,7 @@ class TestNetworkEnvironment:
# Test removing EXTERNAL_NETWORK
ns.enabled_network_list.remove(EXTERNAL_NETWORK)
ne = NetworkEnvironment(ns, os.path.join(TEST_BUILD_DIR, NET_ENV_FILE))
- regstr = ne['resource_registry']['OS::TripleO::Network::External']
- assert_equal(regstr.split('/')[-1], 'OS::Heat::None')
+ assert 'OS::TripleO::Network::External' not in ne['resource_registry']
def test_netenv_settings_tenant_network_vlans(self):
# test vlans
@@ -101,8 +100,7 @@ class TestNetworkEnvironment:
# Test removing TENANT_NETWORK
ns.enabled_network_list.remove(TENANT_NETWORK)
ne = NetworkEnvironment(ns, os.path.join(TEST_BUILD_DIR, NET_ENV_FILE))
- regstr = ne['resource_registry']['OS::TripleO::Network::Tenant']
- assert_equal(regstr.split('/')[-1], 'OS::Heat::None')
+ assert 'OS::TripleO::Network::Tenant' not in ne['resource_registry']
def test_netenv_settings_storage_network_vlans(self):
# test vlans
@@ -122,8 +120,7 @@ class TestNetworkEnvironment:
# Test removing STORAGE_NETWORK
ns.enabled_network_list.remove(STORAGE_NETWORK)
ne = NetworkEnvironment(ns, os.path.join(TEST_BUILD_DIR, NET_ENV_FILE))
- regstr = ne['resource_registry']['OS::TripleO::Network::Storage']
- assert_equal(regstr.split('/')[-1], 'OS::Heat::None')
+ assert 'OS::TripleO::Network::Storage' not in ne['resource_registry']
def test_netenv_settings_api_network_v4(self):
ns = copy(self.ns_vlans)
@@ -153,8 +150,8 @@ class TestNetworkEnvironment:
ns = copy(self.ns)
# API_NETWORK is not in the default network settings file
ne = NetworkEnvironment(ns, os.path.join(TEST_BUILD_DIR, NET_ENV_FILE))
- regstr = ne['resource_registry']['OS::TripleO::Network::InternalApi']
- assert_equal(regstr.split('/')[-1], 'OS::Heat::None')
+ assert 'OS::TripleO::Network::InternalApi' not in ne[
+ 'resource_registry']
def test_numa_configs(self):
ne = NetworkEnvironment(self.ns,