summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Panchenko <apanchenko@mirantis.com>2016-11-29 16:02:37 +0200
committerArtem Panchenko <apanchenko@mirantis.com>2016-11-29 16:08:52 +0200
commitde7c9a4fd7803c009ce0d0f9914c1522a987b27c (patch)
treeb3da97383ea7826322b374d852d0659e39e44064
parentd6f8b580e6451a6497d5a183683089ba424c7d60 (diff)
Fix regexp for required images matching
Notes
Notes (review): Verified+1: Mirantis CCP CI <mirantis-fuel-ccp-ci@mirantis.com> Code-Review+1: Sergey Kulanov <skulanov@mirantis.com> Code-Review+1: tatyana-leontovich <tleontovich@mirantis.com> Code-Review+2: Andrey Sledzinskiy <asledzinskiy@mirantis.com> Workflow+1: Andrey Sledzinskiy <asledzinskiy@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 29 Nov 2016 16:14:30 +0000 Reviewed-on: https://review.openstack.org/404231 Project: openstack/fuel-ccp-tests Branch: refs/heads/master
-rw-r--r--fuel_ccp_tests/helpers/post_install_k8s_checks.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/fuel_ccp_tests/helpers/post_install_k8s_checks.py b/fuel_ccp_tests/helpers/post_install_k8s_checks.py
index f71c312..c85ffd9 100644
--- a/fuel_ccp_tests/helpers/post_install_k8s_checks.py
+++ b/fuel_ccp_tests/helpers/post_install_k8s_checks.py
@@ -54,11 +54,12 @@ def required_images_exists(node_name, underlay, required_images):
54 images = set([x.strip() for x in result['stdout']]) 54 images = set([x.strip() for x in result['stdout']])
55 LOG.debug('Containers on node "{0}" use images: ' 55 LOG.debug('Containers on node "{0}" use images: '
56 '{1}'.format(node_name, images)) 56 '{1}'.format(node_name, images))
57 # Image name could contain unpredictable Docker registry name 57 # Image name could contain unpredictable Docker registry name (host:port)
58 # (host:port), e.g. example.net:5000/hyperkube-amd64:v1.4.1 58 # and namespace, e.g. example.net:5000/mirantis/k8s/hyperkube-amd64:v1.4.1
59 # Use regex to check that image (base name) is used by some container 59 # Use regex to check that image (base name) is used by some container
60 assert all( 60 assert all(
61 any(re.match('^([\w.-]+(:\d+)?/)?' # Host:port (optional) 61 any(re.match('^([\w.-]+(:\d+)?/)?' # Host:port (optional)
62 '([\w/]+/)?' # namespace and/or project name (optional)
62 '{0}:\S+$' # image name + ":" + image tag 63 '{0}:\S+$' # image name + ":" + image tag
63 .format(required_image), image) 64 .format(required_image), image)
64 for image in images) 65 for image in images)