github.com/openshift/installer@v1.4.17/scripts/openstack/manifest-tests/additional-security-group/test_workers.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 machineset="${assets_dir}/openshift/99_openshift-cluster-api_worker-machineset-0.yaml"
     9  
    10  if ! [ -f "$machineset" ]; then
    11  	>&2 echo 'MachineSet not found'
    12  	result='FAIL'
    13  fi
    14  
    15  if ! >/dev/null yq -e '.spec.template.spec.providerSpec.value.securityGroups[] | select(.uuid=="aaaaaaaa-bbbb-4ccc-dddd-000000000000")' "$machineset"; then
    16  	>&2 echo 'Security group UUID not found in the MachineSet'
    17  	>&2 echo
    18  	>&2 echo 'The file was:'
    19  	>&2 cat "$machineset"
    20  	>&2 echo
    21  	result='FAIL'
    22  fi
    23  
    24  if [ "$result" != 'PASS' ]; then
    25  	exit 1
    26  fi