@@ -3,11 +3,13 @@ set -euo pipefail
33
44# AU_FROM_SEED="false"
55# OS_IMAGE="Rocky9"
6- # TAINT_REBUILD="false "
6+ TAINT_REBUILD=" true "
77
88echo " Starting AUFN test action with:"
99echo " AU_FROM_SEED: $AU_FROM_SEED "
1010echo " OS Image: $OS_IMAGE "
11+ echo " TAINT_REBUILD: $TAINT_REBUILD "
12+ echo
1113
1214if [[ " $OS_IMAGE " == " Ubuntu" ]]; then
1315 export LAB_IMAGE_USER=" ubuntu"
2022
2123function check_lab_vm_connections() {
2224 echo " Checking VM connections..."
23- cat ssh_list.txt
2425 while IFS= read -r line; do
2526 ip=$( echo " $line " | awk ' {print $3}' )
2627 name=$( echo " $line " | awk ' {print $2}' )
2728 password=$( echo " $line " | awk ' {print $5}' )
2829
29- echo " Connecting to $name ($password ) at $ip ..."
30+ echo
31+ echo " Connecting to $name at $ip ..."
3032 sshpass -p " $password " ssh -o StrictHostKeyChecking=no \
3133 " lab@${ip} " ' echo "Connected to $(hostname)"'
3234 done < ssh_list.txt
3335}
3436
3537function validate_lab_vms() {
38+ echo
3639 echo " Validating Lab VMs setup..."
3740 index=0
3841 rm -f failed-labs.txt
@@ -42,16 +45,18 @@ function validate_lab_vms() {
4245 name=$( echo " $line " | awk ' {print $2}' )
4346 password=$( echo " $line " | awk ' {print $5}' )
4447
48+ echo
4549 echo " Validating $name at $ip ..."
4650
47- sshpass -p " $password " ssh -o StrictHostKeyChecking=no \
51+ sshpass -p " $password " ssh -o StrictHostKeyChecking=no\
4852 " lab@${ip} " << 'EOF '
4953 output=$(sudo virsh list --all)
5054 echo "$output"
5155 if ! echo "$output" | grep -q 'seed.*running'; then echo "'seed' not running"; fi
5256 if ! echo "$output" | grep -q 'compute0.*shut off'; then echo "'compute0' not shut off"; fi
5357 if ! echo "$output" | grep -q 'controller0.*shut off'; then echo "'controller0' not shut off"; fi
5458
59+ echo
5560 echo "$(ssh [email protected] 'sudo docker ps')" 5661 if ! ssh [email protected] 'sudo docker ps' | grep -q bifrost_deploy; then echo "Bifrost container isn't deployed"; fi 5762 if ! tail -n 10 a-seed-from-nothing.out | grep -q 'PLAY RECAP.*failed=0'; then echo "There was an error in running 'a-seed-from-nothing'"; fi
7782 index=$(( index + 1 ))
7883 set -euo pipefail
7984 done < ssh_list.txt
85+ echo >> failed-labs.txt
8086}
8187
8288function taint_and_reapply() {
@@ -88,7 +94,7 @@ function taint_and_reapply() {
8894 echo " Tainting failed VMs..."
8995 while IFS= read -r line; do
9096 idx=$( echo " $line " | tr -d ' \r' )
91- echo " Tainting VM at index $idx "
97+ echo " Tainting aufn-lab $idx VM "
9298 terraform taint openstack_compute_instance_v2.lab[$idx ]
9399 done < failed-labs.txt
94100 echo " Rebuilding tainted Lab VMs..."
0 commit comments