Skip to content

Commit

Permalink
Reorder 0010-basic.t logfile check for replay
Browse files Browse the repository at this point in the history
In t/0010-basic.t, a check is performed for a replayed credential.
This is immediately followed by a check for a log message of the
replayed credential.

On at least one occasion (on NetBSD 7.1.2, not reproducible), the
logfile check failed because the message had not yet appeared in the
logfile by the time the check was performed.  This happened despite the
logfile having its stream set to unbuffered (see log.c:log_open_file).

Check for a replayed credential log message after munged has stopped
to (hopefully) ensure all log messages have been written to file.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
  • Loading branch information
dun committed May 6, 2019
1 parent a65af40 commit baf36a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions t/0010-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ test_expect_success 'replay credential' '
test_must_fail "${UNMUNGE}" --socket="${MUNGE_SOCKET}" <cred.$$ >/dev/null
'

test_expect_success 'check logfile for replay' '
grep "Replayed credential" "${MUNGE_LOGFILE}"
'

test_expect_success 'stop munged' '
munged_stop_daemon
'
Expand All @@ -80,4 +76,8 @@ test_expect_success 'check seedfile creation' '
test -s "${MUNGE_SEEDFILE}"
'

test_expect_success 'check logfile for replay' '
grep "Replayed credential" "${MUNGE_LOGFILE}"
'

test_done

0 comments on commit baf36a3

Please sign in to comment.