Merge pull request #4159 from rgerhards/tb-random-testid

testbench: create random test_id
This commit is contained in:
Rainer Gerhards 2020-02-11 12:12:43 +01:00 committed by GitHub
commit 4de426bcf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -2486,7 +2486,7 @@ case $1 in
echo "hint: was init accidentally called twice?"
exit 2
fi
export RSYSLOG_DYNNAME="rstb_$(./test_id $(basename $0))"
export RSYSLOG_DYNNAME="rstb_$(./test_id $(basename $0))$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 4 | head -n 1)"
export RSYSLOG_OUT_LOG="${RSYSLOG_DYNNAME}.out.log"
export RSYSLOG2_OUT_LOG="${RSYSLOG_DYNNAME}_2.out.log"
export RSYSLOG_PIDBASE="${RSYSLOG_DYNNAME}:" # also used by instance 2!

View File

@ -4,9 +4,11 @@
. $srcdir/diag.sh check-inotify-only
export IMFILECHECKTIMEOUT="60"
mkdir ${RSYSLOG_DYNNAME}.statefiles
generate_conf
add_conf '
module(load="../plugins/imfile/.libs/imfile" timeoutGranularity="1")
module(load="../plugins/imfile/.libs/imfile" timeoutGranularity="1"
statefile.Directory="'${RSYSLOG_DYNNAME}'.statefiles")
input(type="imfile" File="./'$RSYSLOG_DYNNAME'.input" Tag="file:"
PersistStateInterval="1" readTimeout="2" startmsg.regex="^[^ ]")
@ -18,7 +20,7 @@ template(name="outfmt" type="list") {
}
if $msg contains "msgnum:" then
action( type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="outfmt")
action( type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt")
'
startup
@ -33,8 +35,10 @@ echo ' msgnum:2
# we now do a stop and restart of rsyslog. This checks that everything
# works across restarts.
shutdown_when_empty # shut down rsyslogd when done processing messages
wait_shutdown # we need to wait until rsyslogd is finished!
shutdown_when_empty
wait_shutdown
# re-start (so we read persisted state file)
startup
# new data