fedora-iot / greenboot

Generic Health Checking Framework for systemd
GNU Lesser General Public License v2.1
101 stars 29 forks source link

watchdog.sh: do not exit in --source-only #96

Closed eric-ch closed 1 year ago

eric-ch commented 1 year ago

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.

wdctl may return:

# wdctl 
wdctl: No default device is available.: No such file or directory

Using the provided Dockerfile environment (with 5a9d47e8767d0059b395de86991e816b5511fc41):

$ podman build -t fc37-greenboot-test .
$ podman run --rm -v /run/systemd/journal:/run/systemd/journal -it fc37-greenboot-test
check_watchdog_support.bats
 ✗ Ensure watchdog check is working
   (from function `source' in file /usr/lib/greenboot/check/required.d/02_watchdog.sh, line 47,
    from function `setup' in test file check_watchdog_support.bats, line 4)
     `source $GREENBOOT_DEFAULT_CHECK_PATH/required.d/02_watchdog.sh --source-only' failed
   No watchdog on the system, skipping check
[...]
miabbott commented 1 year ago

@paulwhalen @nullr0ute could you provide additional review and kick off the additional workflow?