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

bin/helpers: check for unexpected LXD warnings/errors during cleanup() #135

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
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
Loading