Skip to content

Commit

Permalink
Extend badargs to run both debug and non-debug versions of the
Browse files Browse the repository at this point in the history
rtpproxy as well as to use recently added "badmod" modules to
go over error handling during module loading.
  • Loading branch information
sobomax committed May 28, 2020
1 parent bb6cb94 commit e7b7c3e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
30 changes: 21 additions & 9 deletions tests/startstop/badargs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,33 @@ __beforeexit_cleanup()
fi
}

do_run()
{
for bad_rargs in ${1}
do
IFS=\&
set -o noglob
RTPP_ARGS=`eval "echo \"${bad_rargs}\""`
rtpproxy_start ${RTPP_ARGS}
reportifnotfail "`basename ${RTPPROXY}` don't start with bad argumens: \""${RTPP_ARGS}"\""
cat "${TMP_LOGFILE}" >> "${TS_LOGFILE}"
rm "${TMP_LOGFILE}"
done
}

RTPP_OUTFILE="startstop.rout"

truncate -s 0 "${TS_LOGFILE}"

myuid="`id -un`"
mygid="`id -gn`"

bad_rargs_all=`cat ${BASEDIR}/startstop/badargs.input`
for bad_rargs in ${bad_rargs_all}
for rtpv in debug nodebug
do
IFS=\&
set -o noglob
RTPP_ARGS=`eval "echo \"${bad_rargs}\""`
rtpproxy_start ${RTPP_ARGS}
reportifnotfail "rtpproxy don't start with bad argumens: \""${RTPP_ARGS}"\""
cat "${TMP_LOGFILE}" >> "${TS_LOGFILE}"
rm "${TMP_LOGFILE}"
. ${BASEDIR}/startstop/badargs.${rtpv}.sub
bad_rargs_all=`cat ${BA_ADD} ${BASEDIR}/startstop/badargs.common.input`
do_run "${bad_rargs_all}" &
DR_PID=${!}
wait ${DR_PID}
report "checks for `basename ${RTPPROXY}`"
done
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--dso&&
--dso&/not/there/garbage/100500
--dso&../modules/acct_rtcp_hep/.libs/rtpp_acct_rtcp_hep_debug.so
--nice&&
--nice&100500
--nice&garbage
Expand Down
6 changes: 6 additions & 0 deletions tests/startstop/badargs.debug.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--dso&../modules/acct_rtcp_hep/.libs/rtpp_acct_rtcp_hep_debug.so
--dso&../modules/badmod/.libs/rtpp_badmod1_debug.so
--dso&../modules/badmod/.libs/rtpp_badmod2_debug.so
--dso&../modules/badmod/.libs/rtpp_badmod3.so
--dso&../modules/badmod/.libs/rtpp_badmod3_debug.so
--dso&../modules/badmod/.libs/rtpp_badmod4_debug.so
2 changes: 2 additions & 0 deletions tests/startstop/badargs.debug.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RTPPROXY="${RTPPROXY_DBG}"
BA_ADD="${BASEDIR}/startstop/badargs.debug.input"
6 changes: 6 additions & 0 deletions tests/startstop/badargs.nodebug.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--dso&../modules/acct_rtcp_hep/.libs/rtpp_acct_rtcp_hep.so
--dso&../modules/badmod/.libs/rtpp_badmod1.so
--dso&../modules/badmod/.libs/rtpp_badmod2.so
--dso&../modules/badmod/.libs/rtpp_badmod3_debug.so
--dso&../modules/badmod/.libs/rtpp_badmod3.so
--dso&../modules/badmod/.libs/rtpp_badmod4.so
2 changes: 2 additions & 0 deletions tests/startstop/badargs.nodebug.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RTPPROXY="${RTPPROXY_PROD}"
BA_ADD="${BASEDIR}/startstop/badargs.nodebug.input"

0 comments on commit e7b7c3e

Please sign in to comment.