Merge "Separate exclusion list for source and binary types"
This commit is contained in:
commit
75343870e3
@ -10,24 +10,27 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import abc
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from mock import patch
|
from mock import patch
|
||||||
from os import path
|
|
||||||
from oslo_log import fixture as log_fixture
|
from oslo_log import fixture as log_fixture
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslotest import base
|
from oslotest import base
|
||||||
import six
|
import six
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
import sys
|
sys.path.append(
|
||||||
sys.path.append(path.abspath(path.join(path.dirname(__file__), '../tools')))
|
os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')))
|
||||||
from kolla.cmd import build
|
from kolla.cmd import build
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class BuildTest(base.BaseTestCase):
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
|
class BuildTest(object):
|
||||||
|
excluded_images = abc.abstractproperty()
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BuildTest, self).setUp()
|
super(BuildTest, self).setUp()
|
||||||
@ -42,16 +45,9 @@ class BuildTest(base.BaseTestCase):
|
|||||||
LOG.info("Running with args %s", self.build_args)
|
LOG.info("Running with args %s", self.build_args)
|
||||||
bad_results, good_results, unmatched_results = build.main()
|
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
|
failures = 0
|
||||||
for image, result in six.iteritems(bad_results):
|
for image, result in six.iteritems(bad_results):
|
||||||
if image in excluded_images:
|
if image in self.excluded_images:
|
||||||
if result is 'error':
|
if result is 'error':
|
||||||
continue
|
continue
|
||||||
failures = failures + 1
|
failures = failures + 1
|
||||||
@ -70,46 +66,55 @@ class BuildTest(base.BaseTestCase):
|
|||||||
self.assertEqual(failures, 0, "%d failure(s) occurred" % failures)
|
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):
|
def setUp(self):
|
||||||
super(BuildTestCentosBinary, self).setUp()
|
super(BuildTestCentosBinary, self).setUp()
|
||||||
self.build_args.extend(["--base", "centos",
|
self.build_args.extend(["--base", "centos",
|
||||||
"--type", "binary"])
|
"--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):
|
def setUp(self):
|
||||||
super(BuildTestCentosSource, self).setUp()
|
super(BuildTestCentosSource, self).setUp()
|
||||||
self.build_args.extend(["--base", "centos",
|
self.build_args.extend(["--base", "centos",
|
||||||
"--type", "source"])
|
"--type", "source"])
|
||||||
|
|
||||||
|
|
||||||
class BuildTestUbuntuSource(BuildTest):
|
class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
|
||||||
|
excluded_images = []
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(BuildTestUbuntuSource, self).setUp()
|
super(BuildTestUbuntuSource, self).setUp()
|
||||||
self.build_args.extend(["--base", "ubuntu",
|
self.build_args.extend(["--base", "ubuntu",
|
||||||
"--type", "source"])
|
"--type", "source"])
|
||||||
|
|
||||||
|
|
||||||
class DeployTestCentosBinary(BuildTest):
|
class DeployTestCentosBinary(BuildTestCentosBinary):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DeployTestCentosBinary, self).setUp()
|
super(DeployTestCentosBinary, self).setUp()
|
||||||
self.build_args.extend(["--base", "centos",
|
self.build_args.extend(["--profile", "gate"])
|
||||||
"--type", "binary",
|
|
||||||
"--profile", "gate"])
|
|
||||||
|
|
||||||
|
|
||||||
class DeployTestCentosSource(BuildTest):
|
class DeployTestCentosSource(BuildTestCentosSource):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DeployTestCentosSource, self).setUp()
|
super(DeployTestCentosSource, self).setUp()
|
||||||
self.build_args.extend(["--base", "centos",
|
self.build_args.extend(["--profile", "gate"])
|
||||||
"--type", "source",
|
|
||||||
"--profile", "gate"])
|
|
||||||
|
|
||||||
|
|
||||||
class DeployTestUbuntuSource(BuildTest):
|
class DeployTestUbuntuSource(BuildTestUbuntuSource):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(DeployTestUbuntuSource, self).setUp()
|
super(DeployTestUbuntuSource, self).setUp()
|
||||||
self.build_args.extend(["--base", "ubuntu",
|
self.build_args.extend(["--profile", "gate"])
|
||||||
"--type", "source",
|
|
||||||
"--profile", "gate"])
|
|
||||||
|
Loading…
Reference in New Issue
Block a user