Skip to content

Commit 4ea8297

Browse files
committed
Adjust formatting and remove motd
1 parent 8f3580b commit 4ea8297

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.github/actions/aufn-test/run.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# AU_FROM_SEED="false"
4+
AU_FROM_SEED="true"
55
# OS_IMAGE="Rocky9"
6-
# TAINT_REBUILD="false"
6+
TAINT_REBUILD="true"
77

88
echo "Starting AUFN test action with:"
99
echo "AU_FROM_SEED: $AU_FROM_SEED"
1010
echo "OS Image: $OS_IMAGE"
11+
echo "TAINT_REBUILD: $TAINT_REBUILD"
12+
echo
1113

1214
if [[ "$OS_IMAGE" == "Ubuntu" ]]; then
1315
export LAB_IMAGE_USER="ubuntu"
@@ -19,20 +21,24 @@ else
1921
fi
2022

2123
function check_lab_vm_connections() {
24+
echo
2225
echo "Checking VM connections..."
23-
cat ssh_list.txt
26+
echo
2427
while IFS= read -r line; do
2528
ip=$(echo "$line" | awk '{print $3}')
2629
name=$(echo "$line" | awk '{print $2}')
2730
password=$(echo "$line" | awk '{print $5}')
2831

29-
echo "Connecting to $name ($password) at $ip ..."
32+
echo
33+
echo
34+
echo "Connecting to $name at $ip ..."
3035
sshpass -p "$password" ssh -o StrictHostKeyChecking=no \
3136
"lab@${ip}" 'echo "Connected to $(hostname)"'
3237
done < ssh_list.txt
3338
}
3439

3540
function validate_lab_vms() {
41+
echo && echo
3642
echo "Validating Lab VMs setup..."
3743
index=0
3844
rm -f failed-labs.txt
@@ -42,16 +48,18 @@ function validate_lab_vms() {
4248
name=$(echo "$line" | awk '{print $2}')
4349
password=$(echo "$line" | awk '{print $5}')
4450

45-
echo "Validating $name at $ip..."
51+
echo && echo
52+
echo "Validating $name at $ip..." && echo
4653

47-
sshpass -p "$password" ssh -o StrictHostKeyChecking=no \
54+
sshpass -p "$password" ssh -o StrictHostKeyChecking=no\
4855
"lab@${ip}" <<'EOF'
4956
output=$(sudo virsh list --all)
5057
echo "$output"
5158
if ! echo "$output" | grep -q 'seed.*running'; then echo "'seed' not running"; fi
5259
if ! echo "$output" | grep -q 'compute0.*shut off'; then echo "'compute0' not shut off"; fi
5360
if ! echo "$output" | grep -q 'controller0.*shut off'; then echo "'controller0' not shut off"; fi
5461
62+
echo && echo
5563
echo "$(ssh [email protected] 'sudo docker ps')"
5664
if ! ssh [email protected] 'sudo docker ps' | grep -q bifrost_deploy; then echo "Bifrost container isn't deployed"; fi
5765
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,6 +85,7 @@ EOF
7785
index=$((index + 1))
7886
set -euo pipefail
7987
done < ssh_list.txt
88+
# echo >> failed-labs.txt
8089
}
8190

8291
function taint_and_reapply() {
@@ -88,7 +97,7 @@ function taint_and_reapply() {
8897
echo "Tainting failed VMs..."
8998
while IFS= read -r line; do
9099
idx=$(echo "$line" | tr -d '\r')
91-
echo "Tainting VM at index $idx"
100+
echo "Tainting aufn-lab $idx VM"
92101
terraform taint openstack_compute_instance_v2.lab[$idx]
93102
done < failed-labs.txt
94103
echo "Rebuilding tainted Lab VMs..."
@@ -133,7 +142,7 @@ check_lab_vm_connections
133142
validate_lab_vms
134143

135144

136-
if [[ "$TAINT_REBUILD" = "true" ]]; then
145+
if [[ "$TAINT_REBUILD" = "true" && ! -s failed-labs.txt ]]; then
137146
taint_and_reapply
138147
terraform output -json > tf-outputs.json
139148
terraform output -raw labs > ssh_list.txt

.github/workflows/deploy-aufn.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ jobs:
167167
run: |
168168
terraform output -raw labs > ssh_list.txt
169169
sed -i 's/"//g' ssh_list.txt
170+
echo >> ssh_list.txt
170171
171172
- name: Echo Lab VMs info
172173
run: |

0 commit comments

Comments
 (0)