summaryrefslogtreecommitdiffstats
path: root/apex/tests
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-08-14 21:17:33 -0400
committerTim Rozet <trozet@redhat.com>2018-08-15 10:58:31 -0400
commitc0a4aa96bbe70eefb179d59a1267b8115651bba5 (patch)
tree27fdca2b00d5ef995d00bf7e91922d78358123bd /apex/tests
parentae5fcc0dd1d19c750cba8d9bf16545f5a7802287 (diff)
Modify common patches schema to per branch
The common patch design doesn't really work across branches very well. This patch makes it so the common patches are specified in the same file, but on a per branch basis. Making it easier to manage common patches per branch. Also, includes a fix and adds test coverage to the prep_image method where we were referencing 'undercloud_admin_ip' before assignment in a case where we were not using ODL and had patches to overcloud. Change-Id: I7672947afd826fdc0042361a0139e22d6d5dd864 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/tests')
-rw-r--r--apex/tests/config/common-patches.yaml7
-rw-r--r--apex/tests/test_apex_overcloud_deploy.py28
2 files changed, 32 insertions, 3 deletions
diff --git a/apex/tests/config/common-patches.yaml b/apex/tests/config/common-patches.yaml
index 35dbf44..fef8fcd 100644
--- a/apex/tests/config/common-patches.yaml
+++ b/apex/tests/config/common-patches.yaml
@@ -1,5 +1,6 @@
---
patches:
- undercloud:
- - change-id: I2e0a40d7902f592e4b7bd727f57048111e0bea36
- project: openstack/tripleo-common
+ queens:
+ undercloud:
+ - change-id: I2e0a40d7902f592e4b7bd727f57048111e0bea36
+ project: openstack/tripleo-common
diff --git a/apex/tests/test_apex_overcloud_deploy.py b/apex/tests/test_apex_overcloud_deploy.py
index a9e4bda..9dd5289 100644
--- a/apex/tests/test_apex_overcloud_deploy.py
+++ b/apex/tests/test_apex_overcloud_deploy.py
@@ -284,6 +284,34 @@ class TestOvercloudDeploy(unittest.TestCase):
mock_c_builder.add_upstream_patches.assert_called()
self.assertListEqual(sorted(rv), ['nova-api', 'opendaylight'])
+ @patch('apex.overcloud.deploy.c_builder')
+ @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_nosdn_upstream_containers_patches(
+ self, mock_os_path, mock_shutil, mock_virt_utils,
+ mock_oc_builder, mock_c_builder):
+ ds_opts = {'dataplane': 'ovs',
+ 'sdn_controller': False,
+ 'odl_version': con.DEFAULT_ODL_VERSION,
+ 'odl_vpp_netvirt': False}
+ ds = {'deploy_options': MagicMock(),
+ 'global_params': MagicMock()}
+ ds['deploy_options'].__getitem__.side_effect = \
+ lambda i: ds_opts.get(i, MagicMock())
+ ds['deploy_options'].__contains__.side_effect = \
+ lambda i: True if i in ds_opts else MagicMock()
+ ns = MagicMock()
+ 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)
+ mock_virt_utils.virt_customize.assert_called()
+ mock_c_builder.add_upstream_patches.assert_called()
+ self.assertListEqual(sorted(rv), ['nova-api'])
+
@patch('apex.overcloud.deploy.oc_builder')
@patch('apex.overcloud.deploy.virt_utils')
@patch('apex.overcloud.deploy.shutil')