rsyslog/tests/omrelp_wrong_authmode.sh
PascalWithopf 4ff58bbf26 omrelp: permit all authmodes; updated tests
omrelp for some time limited authentication modes to those
that were known. While this was OK, it prevented the easy
introduction of new auth modes into librel.

This has now been changed; omrelp now checks the validity of
the authmode directly via librelp by doing some librelp calls
upon processing the configuration.

Also, some tests have been updated to check this feature and
also ensure that the new librelp mode "certvalid" works
(if it is available).
2018-09-14 15:33:47 +02:00

28 lines
892 B
Bash
Executable File

#!/bin/bash
# add 2018-09-13 by Pascal Withopf, released under ASL 2.0
. $srcdir/diag.sh init
generate_conf
add_conf '
module(load="../plugins/omrelp/.libs/omrelp")
module(load="../plugins/imtcp/.libs/imtcp")
input(type="imtcp" port="13514" ruleset="ruleset")
ruleset(name="ruleset") {
action(type="omrelp" target="127.0.0.1" port="10514" tls="on" tls.authMode="INVALID_AUTH_MODE" tls.caCert="tls-certs/ca.pem" tls.myCert="tls-certs/cert.pem" tls.myPrivKey="tls-certs/key.pem" tls.permittedPeer=["rsyslog-test-root-ca"])
}
action(type="omfile" file="'$RSYSLOG_OUT_LOG'")
'
startup
shutdown_when_empty
wait_shutdown
grep "omrelp.* invalid auth.*mode .*INVALID_AUTH_MODE" $RSYSLOG_OUT_LOG > /dev/null
if [ $? -ne 0 ]; then
echo "FAIL: expected error message from missing input file not found. $RSYSLOG_OUT_LOG is:"
cat -n $RSYSLOG_OUT_LOG
error_exit 1
fi
exit_test