aboutsummaryrefslogtreecommitdiff
path: root/kolla/tests
diff options
context:
space:
mode:
authorAllen Gao <wanlong.gao@easystack.cn>2016-02-01 20:08:57 +0800
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2016-02-04 16:48:12 +0800
commitdb53ad1ddf4f3b87582fbd2a8516b77d9c031723 (patch)
treee4afa067d83ed2d2a5fec7ecdc8210c42b4de264 /kolla/tests
parent1057dcd50a8963e5220f7ca5cc7b66183a06340e (diff)
downloadkolla-db53ad1ddf4f3b87582fbd2a8516b77d9c031723.tar.gz
kolla-db53ad1ddf4f3b87582fbd2a8516b77d9c031723.zip
Move the install base type check to kolla-build
The install type is converted in kolla-build, so it will never fail in dockerfile, move the check to kolla-build just above the install type converting. TrivialFix Co-Authored-By: Jeffrey Zhang <jeffrey.zhang@99cloud.net> Change-Id: I1500d3b47e909f94ea9f68c5245297733f63a70b
Diffstat (limited to 'kolla/tests')
-rw-r--r--kolla/tests/test_build.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index d1ace9ec8..634fa3abb 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -11,6 +11,7 @@
# limitations under the License.
import fixtures
+import itertools
import mock
import os
@@ -102,3 +103,28 @@ class WorkerThreadTest(base.TestCase):
path=FAKE_IMAGE['path'], tag=FAKE_IMAGE['fullname'],
nocache=False, rm=True, pull=True, forcerm=True,
buildargs=build_args)
+
+
+class KollaWorkerTest(base.TestCase):
+
+ def test_supported_base_type(self):
+ rh_base = ['fedora', 'centos', 'oraclelinux', 'rhel']
+ rh_type = ['source', 'binary', 'rdo', 'rhos']
+ deb_base = ['ubuntu', 'debian']
+ deb_type = ['source', 'binary']
+
+ for base_distro, install_type in itertools.chain(
+ itertools.product(rh_base, rh_type),
+ itertools.product(deb_base, deb_type)):
+ self.conf.set_override('base', base_distro)
+ self.conf.set_override('install_type', install_type)
+ # should no exception raised
+ build.KollaWorker(self.conf)
+
+ def test_unsupported_base_type(self):
+ for base_distro, install_type in itertools.product(
+ ['ubuntu', 'debian'], ['rdo', 'rhos']):
+ self.conf.set_override('base', base_distro)
+ self.conf.set_override('install_type', install_type)
+ self.assertRaises(build.KollaMismatchBaseTypeException,
+ build.KollaWorker, self.conf)