diff --git a/script-pre-install.ks.in b/script-pre-install.ks.in index 3d822882..ae659a65 100644 --- a/script-pre-install.ks.in +++ b/script-pre-install.ks.in @@ -12,16 +12,8 @@ with open("/mnt/sysroot/root/preinstall_python.log", "a") as log_file: %end # Second pre-install script with intentional error -%pre-install --erroronfail --log=/mnt/sysroot/root/preinstall_error.log +%pre-install --log=/mnt/sysroot/root/preinstall_error.log echo "SUCCESS" echo "Logging from bash pre-install script" >> /mnt/sysroot/root/preinstall_error.log -shutdown +1 exit 1 %end - -# Pre-install script that should be unreachable -%pre-install -echo "Unreachable code" >> /mnt/sysroot/root/preinstall_error.log -%end - -text diff --git a/script-pre-install.sh b/script-pre-install.sh index d71d13b6..7f6ce32c 100755 --- a/script-pre-install.sh +++ b/script-pre-install.sh @@ -37,10 +37,9 @@ validate() { status=1 fi - # Ensure that the "Unreachable code" message is NOT present. - grep -q "Unreachable code" "${disksdir}/virt-install.log" - if [[ $? == 0 ]]; then - echo '*** ERROR: The test failed because unreachable code was executed after "exit 1".' + # Check for the specific error message in the virt-install.log + if ! grep -q "kickstart.script: Error code 1 running the kickstart script" "${disksdir}/virt-install.log"; then + echo '*** ERROR: Expected error message "kickstart.script: Error code 1 running the kickstart script" not found in virt-install.log.' status=1 fi