X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjenkins-verify-images.sh;h=c97f06305a1bc4f0fb6b35ee4812d04b4030241e;hb=2a10c83b2d506008cc6c01c134515fb6328e1f3a;hp=aed8d12f11c02b1b7bbaec1a7373d4b6282f2df5;hpb=50bb84fc6e18daa187d5047968dc130b215a02c0;p=releng%2Fglobal-jjb.git diff --git a/shell/jenkins-verify-images.sh b/shell/jenkins-verify-images.sh index aed8d12f..c97f0630 100755 --- a/shell/jenkins-verify-images.sh +++ b/shell/jenkins-verify-images.sh @@ -12,19 +12,29 @@ echo "---> jenkins-verify-images.sh" # Verifies that openstack contains an image for each config file defined in the # jenkins-config/clouds/openstack directory. +set -eux -o pipefail + error=false for file in jenkins-config/clouds/openstack/*/*; do # Set the $IMAGE_NAME variable to the the file's IMAGE_NAME value - export "$(grep IMAGE_NAME $file)" + export "$(grep ^IMAGE_NAME= $file)" # The image should be listed as active - openstack image list --property name="$IMAGE_NAME" | grep "active" - if [ $? -ne 0 ]; then + + if ! openstack image list --property name="$IMAGE_NAME" | grep "active"; then echo "ERROR: No matching image found for $IMAGE_NAME" error=true fi + # Set the $HARDWARE_ID variable to the the file's HARDWARE_ID value + export "$(grep ^HARDWARE_ID= $file)" + # The flavor should be listed. Spaces in grep string ensure complete match. + + if ! openstack flavor list | grep " $HARDWARE_ID "; then + echo "ERROR: No matching flavor found for $HARDWARE_ID" + error=true + fi done -if [ "$error" = true ]; then +if $error; then exit 1 fi