Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-install test for new modularization #1330

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 1 addition & 9 deletions script-pre-install.ks.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions script-pre-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down