test: refactor and generalize setup(), adding a setup2()

This patch refactors the way the primary and secondary syslogd is
started by the test framework.  The generalizations not only make the
code more readable, it hopefully also makes it easier to add new tests
in the future.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-03-06 00:56:03 +01:00
parent 7707715c78
commit f29f31340c
6 changed files with 78 additions and 45 deletions

View File

@ -15,8 +15,7 @@ echo "= Phase 2 - syslog() with openlog() & custom facility ==="
cat <<EOF >${CONFD}/console.conf
console.* -${LOGCONS}
EOF
kill -HUP `cat ${PID}`
sleep 2
reload
./api -i foo
grep "foo: ${MSG}" ${LOGCONS}
@ -29,8 +28,7 @@ echo "= Phase 4 - Verify RFC5424 API with syslogp() ==========="
cat <<EOF >${CONFD}/v1.conf
ftp.* -${LOGV1} ;RFC5424
EOF
kill -HUP `cat ${PID}`
sleep 2
reload
./api -i troglobit -p
sleep 2