summaryrefslogtreecommitdiff
path: root/kolla/tests
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2016-11-03 12:31:07 +0000
committerPaul Bourke <paul.bourke@oracle.com>2016-11-04 10:27:39 +0000
commit5ddba7892df71d23fefbf7116e8cfec11a2f41da (patch)
treef33901dbf14755b54c9498a2b6065fe7e746ee30 /kolla/tests
parentdc7001de4cbbf244ec5493d81bfb193a42b2dbe0 (diff)
downloadkolla-5ddba7892df71d23fefbf7116e8cfec11a2f41da.tar.gz
kolla-5ddba7892df71d23fefbf7116e8cfec11a2f41da.zip
Fix plugin parsing for base images
If we try to add a plugin to a base image, e.g. [neutron-base-plugin-neutron-fwaas] type = git location = https://github.com/openstack/neutron-fwaas reference = master The build will fail as it parses the above as both "neutron-base-plugin-neutron-fwaas" and "base-plugin-neutron-fwaas". Update the regex to ensure the image name is anchored to the beginning of the conf section. Change-Id: I4099ebd0d25cd28a9bb3bdc4fcfbf311ce22a3fd Closes-Bug: #1638900
Diffstat (limited to 'kolla/tests')
-rw-r--r--kolla/tests/etc/default.conf5
-rw-r--r--kolla/tests/test_build.py18
2 files changed, 23 insertions, 0 deletions
diff --git a/kolla/tests/etc/default.conf b/kolla/tests/etc/default.conf
index 214ca8841..545953e34 100644
--- a/kolla/tests/etc/default.conf
+++ b/kolla/tests/etc/default.conf
@@ -6,6 +6,11 @@ reference = master
location = https://git.openstack.org/openstack/networking-arista
type = git
+[neutron-base-plugin-neutron-fwaas]
+reference = master
+location = https://git.openstack.org/openstack/neutron-fwaas
+type = git
+
[profiles]
default = image-base
all = image-base,image-child
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index 515aa1ddd..d822a4dfe 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -195,6 +195,24 @@ class KollaWorkerTest(base.TestCase):
else:
self.fail('Can not find the expected neutron arista plugin')
+ def test_build_image_list_plugin_parsing(self):
+ """Ensure regex used to parse plugins adds them to the correct image"""
+ self.conf.set_override('install_type', 'source')
+
+ kolla = build.KollaWorker(self.conf)
+ kolla.setup_working_dir()
+ kolla.find_dockerfiles()
+ kolla.create_dockerfiles()
+ kolla.build_image_list()
+ for image in kolla.images:
+ if image.name == 'base':
+ self.assertEqual(len(image.plugins), 0,
+ 'base image should not have any plugins '
+ 'registered')
+ break
+ else:
+ self.fail('Expected to find the base image in this test')
+
def _get_matched_images(self, images):
return [image for image in images
if image.status == build.STATUS_MATCHED]