From e33af351034bcc05c317718a62fe1bf07bea595a Mon Sep 17 00:00:00 2001 From: David Ames Date: Thu, 13 Sep 2018 15:43:48 -0700 Subject: [PATCH] Allow different workaround files per series --- zaza/charm_tests/series_upgrade/tests.py | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/zaza/charm_tests/series_upgrade/tests.py b/zaza/charm_tests/series_upgrade/tests.py index a15025a..3dd8d89 100644 --- a/zaza/charm_tests/series_upgrade/tests.py +++ b/zaza/charm_tests/series_upgrade/tests.py @@ -38,6 +38,11 @@ class SeriesUpgradeTest(unittest.TestCase): cls.lts = LTSGuestCreateTest() cls.from_series = None cls.to_series = None + # While there are packaging upgrade bugs we need to be cheeky and + # workaround by using the new package's version of files + cls.workaround_script = "/home/ubuntu/package-workarounds.sh" + cls.src_workaround_script = os.path.basename(cls.workaround_script) + cls.files = [] def validate_pre_series_upgrade_cloud(self): """Validate pre series upgrade.""" @@ -49,13 +54,6 @@ class SeriesUpgradeTest(unittest.TestCase): # Set Feature Flag os.environ["JUJU_DEV_FEATURE_FLAGS"] = "upgrade-series" - # While there are packaging upgrade bugs we need to be cheeky and - # workaround by using the new package's version of files - workaround_script = "/home/ubuntu/package-workarounds.sh" - src_workaround_script = os.path.basename(workaround_script) - - files = [src_workaround_script, 'corosync', 'corosync.conf'] - applications = model.get_status().applications for application in applications: # Defaults @@ -86,8 +84,8 @@ class SeriesUpgradeTest(unittest.TestCase): from_series=self.from_series, to_series=self.to_series, origin=origin, - workaround_script=workaround_script, - files=files) + workaround_script=self.workaround_script, + files=self.files) def validate_series_upgraded_cloud(self): """Validate post series upgrade.""" @@ -101,10 +99,11 @@ class TrustyXenialSeriesUpgrade(SeriesUpgradeTest): @classmethod def setUpClass(cls): """Run setup for Trusty to Xenial Series Upgrades.""" - cli_utils.setup_logging() - cls.lts = LTSGuestCreateTest() + super(TrustyXenialSeriesUpgrade, cls).setUpClass() cls.from_series = "trusty" cls.to_series = "xenial" + cls.files = [cls.src_workaround_script, + 'corosync', 'corosync.conf'] class XenialBionicSeriesUpgrade(SeriesUpgradeTest): @@ -113,10 +112,11 @@ class XenialBionicSeriesUpgrade(SeriesUpgradeTest): @classmethod def setUpClass(cls): """Run setup for Xenial to Bionic Series Upgrades.""" - cli_utils.setup_logging() - cls.lts = LTSGuestCreateTest() + super(XenialBionicSeriesUpgrade, cls).setUpClass() cls.from_series = "xenial" cls.to_series = "bionic" + cls.files = [cls.src_workaround_script, + 'corosync', 'corosync.conf', 'haproxy.cfg'] if __name__ == "__main__":