Skip to content

Commit

Permalink
bin/helpers: check for unexpected LXD warnings/errors during cleanup()
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Apr 10, 2024
1 parent 353e85f commit 453eb88
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bin/helpers
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ certificateFingerprintShort() (
)

# cleanup: report if the test passed or not and return the appropriate return code.
# Also fail the test if unexpected warnings/errors are logged by LXD
cleanup() {
set +e
echo ""
Expand All @@ -208,6 +209,19 @@ cleanup() {
echo "::endgroup::"

exit 1
else
# The test passed but check for unexpected warnings/errors
problems="$(journalctl --quiet --no-hostname --output cat --no-pager --boot=0 --lines=100 --unit=snap.lxd.daemon.service --grep ' level=(warning|error) ' | \
grep -vF 'per-instance network priority will be ignored. Please use per-device limits.priority instead')"
if [ -n "${problems}" ]; then
echo "Test failed"

echo "Unexpected LXD warnings/errors:"
echo
echo "${problems}"

exit 1
fi
fi

echo "Test passed"
Expand Down

0 comments on commit 453eb88

Please sign in to comment.