2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> jenkins-verify-images.sh"
12 # Verifies that openstack contains an image for each config file defined in the
13 # jenkins-config/clouds/openstack directory.
19 for file in jenkins-config/clouds/openstack/*/*; do
20 # Set the $IMAGE_NAME variable to the the file's IMAGE_NAME value
21 export "$(grep ^IMAGE_NAME= "$file")"
22 # The image should be listed as active
24 if ! openstack image list --property name="$IMAGE_NAME" | grep "active"; then
25 echo "ERROR: No matching image found for $IMAGE_NAME"
28 # Set the $HARDWARE_ID variable to the the file's HARDWARE_ID value
29 export "$(grep ^HARDWARE_ID= "$file")"
30 # The flavor should be listed. Spaces in grep string ensure complete match.
32 if ! openstack flavor list | grep " $HARDWARE_ID "; then
33 echo "ERROR: No matching flavor found for $HARDWARE_ID"