summaryrefslogtreecommitdiffstats
path: root/apex/tests
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-06-25 15:21:07 -0400
committerTim Rozet <trozet@redhat.com>2018-06-25 20:08:47 +0000
commit107c1c3d73ee689eb09ae8851e3048428456fe2e (patch)
tree39c6b889bca16e14962d87f94f26087a6b2fc1e3 /apex/tests
parent6cb6b372fc0f74daf952e04b9d5712c6930cee42 (diff)
Deprecates the use of '--upstream' argument
We only support the use of upstream deployments from Gambia onwards. Therefore deprecating the parameter and forcing upstream to always be used. Change-Id: I7926a65a2c32bca2272855ba45fdb6005f67616f Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/tests')
-rw-r--r--apex/tests/test_apex_deploy.py12
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py20
2 files changed, 22 insertions, 10 deletions
diff --git a/apex/tests/test_apex_deploy.py b/apex/tests/test_apex_deploy.py
index 6c2a185..b7941f6 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.uc_builder')
@patch('apex.deploy.network_data.create_network_data')
@patch('apex.deploy.shutil')
@patch('apex.deploy.oc_deploy')
@@ -132,7 +133,8 @@ 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_network_data):
+ mock_oc_deploy, mock_shutil, mock_network_data,
+ mock_uc_builder):
net_sets_dict = {'networks': MagicMock(),
'dns_servers': 'test'}
ds_opts_dict = {'global_params': MagicMock(),
@@ -149,7 +151,7 @@ class TestDeploy(unittest.TestCase):
args.virtual = False
args.quickstart = False
args.debug = False
- args.upstream = False
+ args.upstream = True
net_sets = mock_net_sets.return_value
net_sets.enabled_network_list = ['external']
net_sets.__getitem__.side_effect = net_sets_dict.__getitem__
@@ -179,6 +181,7 @@ class TestDeploy(unittest.TestCase):
args.debug = True
main()
+ @patch('apex.deploy.uc_builder')
@patch('apex.deploy.network_data.create_network_data')
@patch('apex.deploy.shutil')
@patch('apex.deploy.oc_deploy')
@@ -204,7 +207,8 @@ 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_network_data):
+ mock_oc_deploy, mock_shutil, mock_network_data,
+ mock_uc_builder):
# didn't work yet line 412
# net_sets_dict = {'networks': {'admin': {'cidr': MagicMock()}},
# 'dns_servers': 'test'}
@@ -228,7 +232,7 @@ class TestDeploy(unittest.TestCase):
args.virt_compute_nodes = 1
args.virt_compute_ram = None
args.virt_default_ram = 12
- args.upstream = False
+ args.upstream = True
net_sets = mock_net_sets.return_value
net_sets.enabled_network_list = ['admin']
deploy_sets = mock_deploy_sets.return_value
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index f1db91a..83e2b02 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -207,11 +207,13 @@ class TestOvercloudDeploy(unittest.TestCase):
assert_raises(ApexDeployException, create_deploy_cmd,
ds, ns, inv, '/tmp', virt)
+ @patch('apex.builders.overcloud_builder.inject_opendaylight')
@patch('apex.overcloud.deploy.virt_utils')
@patch('apex.overcloud.deploy.shutil')
@patch('apex.overcloud.deploy.os.path')
@patch('builtins.open', mock_open())
- def test_prep_image(self, mock_os_path, mock_shutil, mock_virt_utils):
+ def test_prep_image(self, mock_os_path, mock_shutil, mock_virt_utils,
+ mock_inject_odl):
ds_opts = {'dataplane': 'fdio',
'sdn_controller': 'opendaylight',
'odl_version': 'master',
@@ -223,6 +225,7 @@ class TestOvercloudDeploy(unittest.TestCase):
ns = MagicMock()
prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test')
mock_virt_utils.virt_customize.assert_called()
+ mock_inject_odl.assert_called()
@patch('apex.overcloud.deploy.virt_utils')
@patch('apex.overcloud.deploy.shutil')
@@ -240,12 +243,13 @@ class TestOvercloudDeploy(unittest.TestCase):
prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test')
mock_virt_utils.virt_customize.assert_called()
+ @patch('apex.builders.overcloud_builder.inject_opendaylight')
@patch('apex.overcloud.deploy.virt_utils')
@patch('apex.overcloud.deploy.shutil')
@patch('apex.overcloud.deploy.os.path')
@patch('builtins.open', mock_open())
def test_prep_image_sdn_odl(self, mock_os_path, mock_shutil,
- mock_virt_utils):
+ mock_virt_utils, mock_inject_odl):
ds_opts = {'dataplane': 'ovs',
'sdn_controller': 'opendaylight',
'odl_version': con.DEFAULT_ODL_VERSION,
@@ -259,6 +263,7 @@ class TestOvercloudDeploy(unittest.TestCase):
ns = MagicMock()
prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test')
mock_virt_utils.virt_customize.assert_called()
+ mock_inject_odl.assert_called()
@patch('apex.overcloud.deploy.c_builder')
@patch('apex.overcloud.deploy.oc_builder')
@@ -283,18 +288,20 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_c_builder.add_upstream_patches.return_value = ['nova-api']
patches = ['dummy_nova_patch']
rv = prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test',
- docker_tag='latest', patches=patches, upstream=True)
- mock_oc_builder.inject_opendaylight.assert_called
+ docker_tag='latest', patches=patches)
+ mock_oc_builder.inject_opendaylight.assert_called()
mock_virt_utils.virt_customize.assert_called()
- mock_c_builder.add_upstream_patches.assert_called
+ mock_c_builder.add_upstream_patches.assert_called()
self.assertListEqual(sorted(rv), ['nova-api', 'opendaylight'])
+ @patch('apex.overcloud.deploy.oc_builder')
@patch('apex.overcloud.deploy.virt_utils')
@patch('apex.overcloud.deploy.shutil')
@patch('apex.overcloud.deploy.os.path')
@patch('builtins.open', mock_open())
def test_prep_image_sdn_odl_not_def(self, mock_os_path,
- mock_shutil, mock_virt_utils):
+ mock_shutil, mock_virt_utils,
+ mock_oc_builder):
ds_opts = {'dataplane': 'ovs',
'sdn_controller': 'opendaylight',
'odl_version': 'uncommon'}
@@ -305,6 +312,7 @@ class TestOvercloudDeploy(unittest.TestCase):
ns = MagicMock()
prep_image(ds, ns, 'undercloud.qcow2', '/tmp', root_pw='test')
mock_virt_utils.virt_customize.assert_called()
+ mock_oc_builder.inject_opendaylight.assert_called()
@patch('apex.overcloud.deploy.virt_utils')
@patch('apex.overcloud.deploy.shutil')