github.com/openshift/installer@v1.4.17/scripts/openstack/manifest-tests/additional-security-group/test_masters.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -Eeuo pipefail
     4  
     5  declare -r assets_dir="$1"
     6  declare result='PASS'
     7  
     8  declare -a machines=(
     9  	"${assets_dir}/openshift/99_openshift-cluster-api_master-machines-0.yaml"
    10  	"${assets_dir}/openshift/99_openshift-cluster-api_master-machines-1.yaml"
    11  	"${assets_dir}/openshift/99_openshift-cluster-api_master-machines-2.yaml"
    12  )
    13  
    14  for machine in "${machines[@]}"; do
    15  	if ! [ -f "$machine" ]; then
    16  		>&2 echo "Machine resource $machine not found"
    17  		result='FAIL'
    18  	fi
    19  
    20  	if ! >/dev/null yq -e '.spec.providerSpec.value.securityGroups[] | select(.uuid=="aaaaaaaa-bbbb-4ccc-dddd-111111111111")' "$machine"; then
    21  		>&2 echo "Security group UUID not found in Machine $machine"
    22  		>&2 echo
    23  		>&2 echo 'The file was:'
    24  		>&2 cat "$machine"
    25  		>&2 echo
    26  		result='FAIL'
    27  	fi
    28  done
    29  
    30  if [ "$result" != 'PASS' ]; then
    31  	exit 1
    32  fi