diff options
author | Tim Rozet <trozet@redhat.com> | 2018-08-13 14:51:09 -0400 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2018-08-14 15:38:59 -0400 |
commit | ae5fcc0dd1d19c750cba8d9bf16545f5a7802287 (patch) | |
tree | 8bd9601966ded90b63373ccaa3ac3993d21beffa /apex/tests/test_apex_deployment_tripleo.py | |
parent | c5959cc14b95e9d10b78ebf3c8e2525c672fc0c7 (diff) |
Allow common patches file
This patch adds allowing for common patches that should be applied to
every scenario to be included. It by default pulls in a file in the
deploy directory 'common-patches.yaml', but can optionally be
overridden.
This patch also includes a patch upstream to fix OSCLI not working
anymore due to breakage with the Cinder version in the overcloudrc.
Change-Id: I97b9efb937deff07e085b9ef75b9799fb65bfc57
Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/tests/test_apex_deployment_tripleo.py')
-rw-r--r-- | apex/tests/test_apex_deployment_tripleo.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/apex/tests/test_apex_deployment_tripleo.py b/apex/tests/test_apex_deployment_tripleo.py new file mode 100644 index 00000000..912fe104 --- /dev/null +++ b/apex/tests/test_apex_deployment_tripleo.py @@ -0,0 +1,49 @@ +############################################################################## +# Copyright (c) 2018 Tim Rozet (trozet@redhat.com) (Red Hat) +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import os +import unittest + +from apex.deployment.tripleo import ApexDeployment +from apex.settings.deploy_settings import DeploySettings +from apex.tests.constants import TEST_DUMMY_CONFIG + + +class TestApexDeployment(unittest.TestCase): + @classmethod + def setup_class(cls): + """This method is run once for each class before any tests are run""" + + @classmethod + def teardown_class(cls): + """This method is run once for each class _after_ all tests are run""" + + def setup(self): + """This method is run once before _each_ test method is executed""" + + def teardown(self): + """This method is run once after _each_ test method is executed""" + + def test_determine_patches(self): + self.maxDiff = None + ds_file = os.path.join(TEST_DUMMY_CONFIG, 'dummy-deploy-settings.yaml') + ds = DeploySettings(ds_file) + patches_file = os.path.join(TEST_DUMMY_CONFIG, 'common-patches.yaml') + d = ApexDeployment(deploy_settings=ds, patch_file=patches_file, + ds_file=ds_file) + patches = d.determine_patches() + test_patches = { + 'undercloud': + [{'change-id': 'I2e0a40d7902f592e4b7bd727f57048111e0bea36', + 'project': 'openstack/tripleo-common'}], + 'overcloud': + [{'change-id': 'Ie988ba6a2d444a614e97c0edf5fce24b23970310', + 'project': 'openstack/puppet-tripleo'}] + } + self.assertDictEqual(patches, test_patches) |