mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-12 19:30:42 +01:00
testbench: fix final issues for python 3 transition
Thanks to Michael Biebl for his help on this issue. This patch also contains some slight test modernization and a "name fix" for a non-valgrind test. closes https://github.com/rsyslog/rsyslog/issues/3853
This commit is contained in:
parent
24e323988d
commit
618f743299
@ -185,6 +185,7 @@ TESTS += \
|
|||||||
glbl_setenv_err.sh \
|
glbl_setenv_err.sh \
|
||||||
glbl_setenv_err_too_long.sh \
|
glbl_setenv_err_too_long.sh \
|
||||||
glbl_setenv.sh \
|
glbl_setenv.sh \
|
||||||
|
mmexternal-SegFault.sh \
|
||||||
nested-call-shutdown.sh \
|
nested-call-shutdown.sh \
|
||||||
dnscache-TTL-0.sh \
|
dnscache-TTL-0.sh \
|
||||||
invalid_nested_include.sh \
|
invalid_nested_include.sh \
|
||||||
@ -473,7 +474,6 @@ TESTS += \
|
|||||||
rscript_backticks_empty_envvar-vg.sh \
|
rscript_backticks_empty_envvar-vg.sh \
|
||||||
rscript-config_enable-off-vg.sh \
|
rscript-config_enable-off-vg.sh \
|
||||||
prop-jsonmesg-vg.sh \
|
prop-jsonmesg-vg.sh \
|
||||||
mmexternal-SegFault-vg.sh \
|
|
||||||
mmexternal-InvldProg-vg.sh \
|
mmexternal-InvldProg-vg.sh \
|
||||||
internal-errmsg-memleak-vg.sh \
|
internal-errmsg-memleak-vg.sh \
|
||||||
glbl-oversizeMsg-log-vg.sh \
|
glbl-oversizeMsg-log-vg.sh \
|
||||||
@ -1558,7 +1558,7 @@ EXTRA_DIST= \
|
|||||||
imbatchreport_delete_toolarge.sh \
|
imbatchreport_delete_toolarge.sh \
|
||||||
imbatchreport_rename_toolarge.sh \
|
imbatchreport_rename_toolarge.sh \
|
||||||
imbatchreport_errmsg_no_params-vg.sh \
|
imbatchreport_errmsg_no_params-vg.sh \
|
||||||
mmexternal-SegFault-vg.sh \
|
mmexternal-SegFault.sh \
|
||||||
mmexternal-SegFault-empty-jroot-vg.sh \
|
mmexternal-SegFault-empty-jroot-vg.sh \
|
||||||
testsuites/mmexternal-SegFault-mm-python.py \
|
testsuites/mmexternal-SegFault-mm-python.py \
|
||||||
mmexternal-InvldProg-vg.sh \
|
mmexternal-InvldProg-vg.sh \
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
# call this via "python[3] script name"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
for _ in range(10):
|
for _ in range(10):
|
||||||
|
|||||||
@ -1,32 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# add 2017-11-06 by PascalWithopf, released under ASL 2.0
|
# add 2017-11-06 by PascalWithopf, released under ASL 2.0
|
||||||
|
|
||||||
. ${srcdir:=.}/diag.sh init
|
. ${srcdir:=.}/diag.sh init
|
||||||
generate_conf
|
generate_conf
|
||||||
add_conf '
|
add_conf '
|
||||||
module(load="../plugins/imtcp/.libs/imtcp")
|
|
||||||
module(load="../plugins/mmexternal/.libs/mmexternal")
|
module(load="../plugins/mmexternal/.libs/mmexternal")
|
||||||
input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port")
|
|
||||||
|
|
||||||
template(name="outfmt" type="string" string="-%$!%-\n")
|
template(name="outfmt" type="string" string="-%$!%-\n")
|
||||||
|
|
||||||
if $msg contains "msgnum:" then {
|
if $msg contains "msgnum:" then {
|
||||||
action(type="mmexternal" interface.input="fulljson"
|
action(type="mmexternal" interface.input="fulljson"
|
||||||
binary="testsuites/mmexternal-SegFault-mm-python.py")
|
binary="'$PYTHON' '${srcdir}'/testsuites/mmexternal-SegFault-mm-python.py")
|
||||||
action(type="omfile" template="outfmt" file=`echo $RSYSLOG_OUT_LOG`)
|
action(type="omfile" template="outfmt" file=`echo $RSYSLOG_OUT_LOG`)
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
startup_vg
|
startup_vg
|
||||||
tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 tag:msgnum:1\""
|
injectmsg litteral "<129>Mar 10 01:00:00 172.20.245.8 tag:msgnum:1"
|
||||||
shutdown_when_empty
|
shutdown_when_empty
|
||||||
wait_shutdown_vg
|
wait_shutdown_vg
|
||||||
check_exit_vg
|
check_exit_vg
|
||||||
|
export EXPECTED='-{ "sometag": "somevalue" }-'
|
||||||
echo '-{ "sometag": "somevalue" }-' | cmp - $RSYSLOG_OUT_LOG
|
cmp_exact
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
echo "invalid response generated, $RSYSLOG_OUT_LOG is:"
|
|
||||||
cat $RSYSLOG_OUT_LOG
|
|
||||||
error_exit 1
|
|
||||||
fi;
|
|
||||||
|
|
||||||
exit_test
|
exit_test
|
||||||
|
|||||||
@ -4,9 +4,7 @@
|
|||||||
. ${srcdir:=.}/diag.sh init
|
. ${srcdir:=.}/diag.sh init
|
||||||
generate_conf
|
generate_conf
|
||||||
add_conf '
|
add_conf '
|
||||||
module(load="../plugins/imtcp/.libs/imtcp")
|
|
||||||
module(load="../plugins/mmexternal/.libs/mmexternal")
|
module(load="../plugins/mmexternal/.libs/mmexternal")
|
||||||
input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port")
|
|
||||||
set $!x = "a";
|
set $!x = "a";
|
||||||
|
|
||||||
template(name="outfmt" type="string" string="-%$!%-\n")
|
template(name="outfmt" type="string" string="-%$!%-\n")
|
||||||
@ -18,12 +16,9 @@ if $msg contains "msgnum:" then {
|
|||||||
}
|
}
|
||||||
'
|
'
|
||||||
startup
|
startup
|
||||||
#startup_vg
|
injectmsg litteral "<129>Mar 10 01:00:00 172.20.245.8 tag:msgnum:1"
|
||||||
tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 tag:msgnum:1\""
|
|
||||||
shutdown_when_empty
|
shutdown_when_empty
|
||||||
wait_shutdown
|
wait_shutdown
|
||||||
#wait_shutdown_vg
|
|
||||||
#check_exit_vg
|
|
||||||
|
|
||||||
export EXPECTED='-{ "x": "a", "sometag": "somevalue" }-'
|
export EXPECTED='-{ "x": "a", "sometag": "somevalue" }-'
|
||||||
cmp_exact
|
cmp_exact
|
||||||
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
# call this via "python[3] script name"
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
# call this via "python[3] script name"
|
||||||
# Added 2017-11-05 by Stephen Workman, released under ASL 2.0
|
# Added 2017-11-05 by Stephen Workman, released under ASL 2.0
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
# call this via "python[3] script name"
|
||||||
import sys
|
import sys
|
||||||
from pysnmp.entity import engine, config
|
from pysnmp.entity import engine, config
|
||||||
from pysnmp.carrier.asyncore.dgram import udp
|
from pysnmp.carrier.asyncore.dgram import udp
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
# call this via "python[3] script name"
|
||||||
# a small url encoder for testbench purposes
|
# a small url encoder for testbench purposes
|
||||||
# written 2018-11-05 by Rainer Gerhards
|
# written 2018-11-05 by Rainer Gerhards
|
||||||
# part of the rsyslog testbench, released under ASL 2.0
|
# part of the rsyslog testbench, released under ASL 2.0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user