Skip to content

Commit

Permalink
test: prefix grep with tenacious when using logger
Browse files Browse the repository at this point in the history
When running tests on CI it may take a while for the logger message to
propagate to the log file.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Jan 1, 2025
1 parent 2147b3a commit c425c1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ EOF
verify_rfc5424()
{
../src/logger -p ftp.notice -u "${SOCK}" -m "MSDSD" -d '[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"]' "waldo"
grep "exampleSDID@32473" "${LOGV1}"
tenacious 2 grep "exampleSDID@32473" "${LOGV1}"
}

verify_fqdn()
{
../src/logger -p ftp.notice -u "${SOCK}" -m "MSDSD" -H "baz.example.com" "Xyzzy"
grep "baz.example.com" "${LOGV1}"
tenacious 2 grep "baz.example.com" "${LOGV1}"
}

# Expected to fail, logs with LOG_INFO
Expand All @@ -70,13 +70,13 @@ EOF
reload

../src/logger -p local7.info -u "${SOCK}" "nopenope"
grep "nopenope" "${LOG2}" || return 0
tenacious 2 grep "nopenope" "${LOG2}" || return 0
}

verify_localN_notice()
{
../src/logger -p local7.notice -u "${SOCK}" "aye matey"
grep "aye matey" "${LOG2}"
tenacious 2 grep "aye matey" "${LOG2}"
}

#
Expand Down

0 comments on commit c425c1f

Please sign in to comment.