From ae5fcc0dd1d19c750cba8d9bf16545f5a7802287 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Mon, 13 Aug 2018 14:51:09 -0400 Subject: 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 --- apex/tests/test_apex_deployment_tripleo.py | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 apex/tests/test_apex_deployment_tripleo.py (limited to 'apex/tests/test_apex_deployment_tripleo.py') 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) -- cgit 1.2.3-korg