@@ -3,11 +3,13 @@ set -euo pipefail
3
3
4
4
# AU_FROM_SEED="false"
5
5
# OS_IMAGE="Rocky9"
6
- # TAINT_REBUILD="false "
6
+ TAINT_REBUILD=" true "
7
7
8
8
echo " Starting AUFN test action with:"
9
9
echo " AU_FROM_SEED: $AU_FROM_SEED "
10
10
echo " OS Image: $OS_IMAGE "
11
+ echo " TAINT_REBUILD: $TAINT_REBUILD "
12
+ echo
11
13
12
14
if [[ " $OS_IMAGE " == " Ubuntu" ]]; then
13
15
export LAB_IMAGE_USER=" ubuntu"
20
22
21
23
function check_lab_vm_connections() {
22
24
echo " Checking VM connections..."
23
- cat ssh_list.txt
24
25
while IFS= read -r line; do
25
26
ip=$( echo " $line " | awk ' {print $3}' )
26
27
name=$( echo " $line " | awk ' {print $2}' )
27
28
password=$( echo " $line " | awk ' {print $5}' )
28
29
29
- echo " Connecting to $name ($password ) at $ip ..."
30
+ echo
31
+ echo " Connecting to $name at $ip ..."
30
32
sshpass -p " $password " ssh -o StrictHostKeyChecking=no \
31
33
" lab@${ip} " ' echo "Connected to $(hostname)"'
32
34
done < ssh_list.txt
33
35
}
34
36
35
37
function validate_lab_vms() {
38
+ echo
36
39
echo " Validating Lab VMs setup..."
37
40
index=0
38
41
rm -f failed-labs.txt
@@ -42,16 +45,18 @@ function validate_lab_vms() {
42
45
name=$( echo " $line " | awk ' {print $2}' )
43
46
password=$( echo " $line " | awk ' {print $5}' )
44
47
48
+ echo
45
49
echo " Validating $name at $ip ..."
46
50
47
- sshpass -p " $password " ssh -o StrictHostKeyChecking=no \
51
+ sshpass -p " $password " ssh -o StrictHostKeyChecking=no\
48
52
" lab@${ip} " << 'EOF '
49
53
output=$(sudo virsh list --all)
50
54
echo "$output"
51
55
if ! echo "$output" | grep -q 'seed.*running'; then echo "'seed' not running"; fi
52
56
if ! echo "$output" | grep -q 'compute0.*shut off'; then echo "'compute0' not shut off"; fi
53
57
if ! echo "$output" | grep -q 'controller0.*shut off'; then echo "'controller0' not shut off"; fi
54
58
59
+ echo
55
60
echo "$(ssh stack@192.168.33.5 'sudo docker ps')"
56
61
if ! ssh stack@192.168.33.5 'sudo docker ps' | grep -q bifrost_deploy; then echo "Bifrost container isn't deployed"; fi
57
62
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
77
82
index=$(( index + 1 ))
78
83
set -euo pipefail
79
84
done < ssh_list.txt
85
+ echo >> failed-labs.txt
80
86
}
81
87
82
88
function taint_and_reapply() {
@@ -88,7 +94,7 @@ function taint_and_reapply() {
88
94
echo " Tainting failed VMs..."
89
95
while IFS= read -r line; do
90
96
idx=$( echo " $line " | tr -d ' \r' )
91
- echo " Tainting VM at index $idx "
97
+ echo " Tainting aufn-lab $idx VM "
92
98
terraform taint openstack_compute_instance_v2.lab[$idx ]
93
99
done < failed-labs.txt
94
100
echo " Rebuilding tainted Lab VMs..."
0 commit comments