diff --git a/test/bin/scenario.sh b/test/bin/scenario.sh index 678ee7d39b..bae8fce37f 100755 --- a/test/bin/scenario.sh +++ b/test/bin/scenario.sh @@ -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() { @@ -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() { @@ -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() { diff --git a/test/image-blueprints/layer4-release/group3/rhel98-brew-lrel-tuned.toml.disabled b/test/image-blueprints/layer4-release/group3/rhel98-brew-lrel-tuned.toml similarity index 100% rename from test/image-blueprints/layer4-release/group3/rhel98-brew-lrel-tuned.toml.disabled rename to test/image-blueprints/layer4-release/group3/rhel98-brew-lrel-tuned.toml diff --git a/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard1.sh b/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard1.sh index e0e9a1b94e..dcbbcf58dc 100644 --- a/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard1.sh +++ b/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard1.sh @@ -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" @@ -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 diff --git a/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard2.sh b/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard2.sh index 1a9bb37023..a33566dfae 100644 --- a/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard2.sh +++ b/test/scenarios-bootc/el10/releases/el102-lrel@multi-config-standard2.sh @@ -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" @@ -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 diff --git a/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard1.sh b/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard1.sh index dd3304fb00..df93286a50 100644 --- a/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard1.sh +++ b/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard1.sh @@ -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" @@ -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 diff --git a/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard2.sh b/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard2.sh index cd40ac76ba..18e0db5637 100644 --- a/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard2.sh +++ b/test/scenarios-bootc/el9/releases/el98-lrel@multi-config-standard2.sh @@ -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" @@ -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 diff --git a/test/scenarios/releases/el98-lrel@ginkgo-multi-config.sh b/test/scenarios/releases/el98-lrel@ginkgo-multi-config.sh index 3571c9c943..dcedffbd71 100644 --- a/test/scenarios/releases/el98-lrel@ginkgo-multi-config.sh +++ b/test/scenarios/releases/el98-lrel@ginkgo-multi-config.sh @@ -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}" @@ -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..." @@ -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