Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ run_command_on_vm() {
# Necessary in devenv for entering input i.e. system registration, etc.
term_opt="-t"
fi
ssh "redhat@${ip}" -p "${ssh_port}" ${term_opt} "${command}"

# Must return normally so local variables are cleaned up on command failure,
# otherwise stale values and readonly attributes break SOS collection
local rc=0
ssh "redhat@${ip}" -p "${ssh_port}" ${term_opt} "${command}" || rc=$?
return "${rc}"
}

copy_file_to_vm() {
Expand All @@ -126,7 +131,11 @@ copy_file_to_vm() {
fi
local -r ssh_port=$(get_vm_property "${vmname}" ssh_port)

scp -P "${ssh_port}" "${local_filename}" "redhat@${ip}:${remote_filename}"
# Must return normally so local variables are cleaned up on command failure,
# otherwise stale values and readonly attributes break SOS collection
local rc=0
scp -P "${ssh_port}" "${local_filename}" "redhat@${ip}:${remote_filename}" || rc=$?
return "${rc}"
}

copy_file_from_vm() {
Expand All @@ -141,7 +150,11 @@ copy_file_from_vm() {
fi
local -r ssh_port=$(get_vm_property "${vmname}" ssh_port)

scp -P "${ssh_port}" "redhat@${ip}:${remote_filename}" "${local_filename}"
# Must return normally so local variables are cleaned up on command failure,
# otherwise stale values and readonly attributes break SOS collection
local rc=0
scp -P "${ssh_port}" "redhat@${ip}:${remote_filename}" "${local_filename}" || rc=$?
return "${rc}"
}

sos_report() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ scenario_run_tests() {
sleep 5
done

# Stop MicroShift before applying TLS configuration
run_command_on_vm host1 "sudo systemctl stop microshift" || true

# Apply TLSv1.3 configuration via drop-in config
echo "INFO: Configuring TLSv1.3..."
run_command_on_vm host1 "sudo mkdir -p /etc/microshift/config.d"
Expand All @@ -68,9 +71,8 @@ apiServer:
minVersion: VersionTLS13
EOF"

# Restart MicroShift to apply TLS configuration
echo "INFO: Restarting MicroShift to apply TLS configuration..."
run_command_on_vm host1 "sudo systemctl restart microshift"
# Start MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl start microshift"

# Wait for MicroShift to be ready
wait_for_microshift_to_be_ready host1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ scenario_run_tests() {
sleep 5
done

# Stop MicroShift before applying TLS configuration
run_command_on_vm host1 "sudo systemctl stop microshift" || true

# Apply TLSv1.3 configuration via drop-in config
echo "INFO: Configuring TLSv1.3..."
run_command_on_vm host1 "sudo mkdir -p /etc/microshift/config.d"
Expand All @@ -68,8 +71,8 @@ apiServer:
minVersion: VersionTLS13
EOF"

# Restart MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl restart microshift"
# Start MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl start microshift"

# Wait for MicroShift to be ready
wait_for_microshift_to_be_ready host1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ scenario_run_tests() {
sleep 5
done

# Stop MicroShift before applying TLS configuration
run_command_on_vm host1 "sudo systemctl stop microshift" || true

# Apply TLSv1.3 configuration via drop-in config
echo "INFO: Configuring TLSv1.3..."
run_command_on_vm host1 "sudo mkdir -p /etc/microshift/config.d"
Expand All @@ -68,9 +71,8 @@ apiServer:
minVersion: VersionTLS13
EOF"

# Restart MicroShift to apply TLS configuration
echo "INFO: Restarting MicroShift to apply TLS configuration..."
run_command_on_vm host1 "sudo systemctl restart microshift"
# Start MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl start microshift"

# Wait for MicroShift to be ready
wait_for_microshift_to_be_ready host1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ scenario_run_tests() {
sleep 5
done

# Stop MicroShift before applying TLS configuration
run_command_on_vm host1 "sudo systemctl stop microshift" || true

# Apply TLSv1.3 configuration via drop-in config
echo "INFO: Configuring TLSv1.3..."
run_command_on_vm host1 "sudo mkdir -p /etc/microshift/config.d"
Expand All @@ -77,8 +80,8 @@ apiServer:
minVersion: VersionTLS13
EOF"

# Restart MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl restart microshift"
# Start MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl start microshift"

# Wait for MicroShift to be ready
wait_for_microshift_to_be_ready host1
Expand Down
40 changes: 20 additions & 20 deletions test/scenarios/releases/el98-lrel@ginkgo-multi-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_IPV6_NETWORK}")"
# shellcheck disable=SC2034 # used elsewhere
WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}"

# TODO: Consider using tuned image once it is enabled in the build system
start_image="rhel98-brew-lrel-optional"
start_image="rhel98-brew-lrel-tuned"

scenario_create_vms() {
exit_if_commit_not_found "${start_image}"
Expand Down Expand Up @@ -48,22 +47,23 @@ scenario_remove_vms() {
scenario_run_tests() {
exit_if_commit_not_found "${start_image}"

# TODO: Re-enable once kernel-rt is available for RHEL 9.8 and the
# rhel98-brew-lrel-tuned image is used as start_image.
# # Wait for microshift-tuned to reboot the node
# local -r start_time=$(date +%s)
# while true; do
# boot_num=$(run_command_on_vm host1 "sudo journalctl --list-boots --quiet | wc -l" || true)
# boot_num="${boot_num%$'\r'*}"
# if [[ "${boot_num}" -ge 2 ]]; then
# break
# fi
# if [ $(( $(date +%s) - start_time )) -gt 60 ]; then
# echo "Timed out waiting for VM having 2 boots"
# exit 1
# fi
# sleep 5
# done
# Wait for microshift-tuned to reboot the node
local -r start_time=$(date +%s)
while true; do
boot_num=$(run_command_on_vm host1 "sudo journalctl --list-boots --quiet | wc -l" || true)
boot_num="${boot_num%$'\r'*}"
if [[ "${boot_num}" -ge 2 ]]; then
break
fi
if [ $(( $(date +%s) - start_time )) -gt 60 ]; then
echo "Timed out waiting for VM having 2 boots"
exit 1
fi
sleep 5
done

# Stop MicroShift before applying TLS configuration
run_command_on_vm host1 "sudo systemctl stop microshift" || true

# Apply TLSv1.3 configuration via drop-in config
echo "INFO: Configuring TLSv1.3..."
Expand All @@ -74,8 +74,8 @@ apiServer:
minVersion: VersionTLS13
EOF"

# Restart MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl restart microshift"
# Start MicroShift to apply TLS configuration
run_command_on_vm host1 "sudo systemctl start microshift"

# Wait for MicroShift to be ready
wait_for_microshift_to_be_ready host1
Expand Down