Skip to content

Commit

Permalink
watchdog.sh: do not exit in --source-only
Browse files Browse the repository at this point in the history
bats will source 02_watchdog.sh. Move all checks that may exit in the
branch when --source-only is not passed to avoid a false negative in
bats.

Signed-off-by: Eric Chanudet <echanude@redhat.com>
  • Loading branch information
eric-ch authored and nullr0ute committed Apr 19, 2023
1 parent 5a9d47e commit 4c5c297
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions usr/lib/greenboot/check/required.d/02_watchdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ check_if_current_boot_is_wd_triggered() {
fi
}

if ! check_if_there_is_a_watchdog ; then
echo "No watchdog on the system, skipping check"
exit 0
fi

# This is in order to test check_if_current_boot_is_wd_triggered
# function within a container
if [ "${1}" != "--source-only" ]; then
if ! check_if_there_is_a_watchdog ; then
echo "No watchdog on the system, skipping check"
exit 0
fi

source_configuration_file
if [ "${GREENBOOT_WATCHDOG_CHECK_ENABLED,,}" != "true" ]; then
echo "Watchdog check is disabled"
Expand Down

0 comments on commit 4c5c297

Please sign in to comment.