diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-01-26 05:52:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-01-26 05:52:06 +0000 |
| commit | 75343870e395e257c8d8267ccd9c74e70c7fceb5 (patch) | |
| tree | bcd69f3f539712032bbf7a3af2a8fd96c0af11a7 /tests | |
| parent | 06b16d577d502d95587e69c970c099850ad3f0ae (diff) | |
| parent | dcbfbcd2c8392fba4b4b15bc97076dd8cc2cfa1f (diff) | |
| download | kolla-75343870e395e257c8d8267ccd9c74e70c7fceb5.tar.gz kolla-75343870e395e257c8d8267ccd9c74e70c7fceb5.zip | |
Merge "Separate exclusion list for source and binary types"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_build.py | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/tests/test_build.py b/tests/test_build.py index 86bcbf7d9..eda87a4e7 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -10,24 +10,27 @@ # License for the specific language governing permissions and limitations # under the License. +import abc import os +import sys from mock import patch -from os import path from oslo_log import fixture as log_fixture from oslo_log import log as logging from oslotest import base import six import testtools -import sys -sys.path.append(path.abspath(path.join(path.dirname(__file__), '../tools'))) +sys.path.append( + os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools'))) from kolla.cmd import build LOG = logging.getLogger(__name__) -class BuildTest(base.BaseTestCase): +@six.add_metaclass(abc.ABCMeta) +class BuildTest(object): + excluded_images = abc.abstractproperty() def setUp(self): super(BuildTest, self).setUp() @@ -42,16 +45,9 @@ class BuildTest(base.BaseTestCase): LOG.info("Running with args %s", self.build_args) bad_results, good_results, unmatched_results = build.main() - # these are images that are known to not build properly - excluded_images = ["gnocchi-base", - "murano-base", - "ironic-pxe", - "ironic-discoverd", - "mistral-base"] - failures = 0 for image, result in six.iteritems(bad_results): - if image in excluded_images: + if image in self.excluded_images: if result is 'error': continue failures = failures + 1 @@ -70,46 +66,55 @@ class BuildTest(base.BaseTestCase): self.assertEqual(failures, 0, "%d failure(s) occurred" % failures) -class BuildTestCentosBinary(BuildTest): +class BuildTestCentosBinary(BuildTest, base.BaseTestCase): + excluded_images = ["gnocchi-base", + "murano-base", + "ironic-pxe", + "ironic-discoverd", + "mistral-base", + "murano-base"] + def setUp(self): super(BuildTestCentosBinary, self).setUp() self.build_args.extend(["--base", "centos", "--type", "binary"]) -class BuildTestCentosSource(BuildTest): +class BuildTestCentosSource(BuildTest, base.BaseTestCase): + excluded_images = ["gnocchi-base", + "murano-base", + "ironic-pxe", + "ironic-discoverd", + "mistral-base"] + def setUp(self): super(BuildTestCentosSource, self).setUp() self.build_args.extend(["--base", "centos", "--type", "source"]) -class BuildTestUbuntuSource(BuildTest): +class BuildTestUbuntuSource(BuildTest, base.BaseTestCase): + excluded_images = [] + def setUp(self): super(BuildTestUbuntuSource, self).setUp() self.build_args.extend(["--base", "ubuntu", "--type", "source"]) -class DeployTestCentosBinary(BuildTest): +class DeployTestCentosBinary(BuildTestCentosBinary): def setUp(self): super(DeployTestCentosBinary, self).setUp() - self.build_args.extend(["--base", "centos", - "--type", "binary", - "--profile", "gate"]) + self.build_args.extend(["--profile", "gate"]) -class DeployTestCentosSource(BuildTest): +class DeployTestCentosSource(BuildTestCentosSource): def setUp(self): super(DeployTestCentosSource, self).setUp() - self.build_args.extend(["--base", "centos", - "--type", "source", - "--profile", "gate"]) + self.build_args.extend(["--profile", "gate"]) -class DeployTestUbuntuSource(BuildTest): +class DeployTestUbuntuSource(BuildTestUbuntuSource): def setUp(self): super(DeployTestUbuntuSource, self).setUp() - self.build_args.extend(["--base", "ubuntu", - "--type", "source", - "--profile", "gate"]) + self.build_args.extend(["--profile", "gate"]) |
