Skip to content

Commit

Permalink
add test for recording stop all
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Mar 5, 2020
1 parent 6f5a16d commit f85f5af
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
26 changes: 19 additions & 7 deletions tests/recording/basic
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ run_rtpproxy() {
rtp_porto=${3}
rproto=${4}
rport=${5}
recstop=

case "${rproto}" in
files)
Expand All @@ -53,7 +54,10 @@ run_rtpproxy() {
done
;;

singlefile)
singlefile|stopall)
if [ "${rproto}" = "stopall" ]; then
recstop=all
fi
recfile="${rname}.pcap"
if [ -e "${recfile}" ]
then
Expand All @@ -63,7 +67,7 @@ run_rtpproxy() {
esac

(cat "${CD_DIR}/basic.input" "${CD_DIR}/basic.${rproto}.input"; \
sleep 34; cat "${CD_DIR}/basic.recstop.input"; \
sleep 34; cat "${CD_DIR}/basic.recstop${recstop}.input"; \
sleep 34; cat "${CD_DIR}/basic.stats.input") | \
sed -u "s|%%CALLID%%|${CALL_ID}|g ; s|%%REC_PORT%%|${rport}|g" | \
${RTPPROXY} ${RTPP_ARGS} ${RTPP_REC_ARGS} | sed \
Expand All @@ -82,7 +86,7 @@ run_rtpproxy() {
done
;;

singlefile)
singlefile|stopall)
recfile="${rname}.pcap"
if [ -e "${recfile}" ]
then
Expand Down Expand Up @@ -174,18 +178,25 @@ T2_RC=${?}
T2_PID=${!}
report_rc ${T2_RC} "Starting sub-test \"singlefile\""
sleep 0.2
run_recording remote &
run_recording stopall &
T3_RC=${?}
T3_PID=${!}
report_rc ${T3_RC} "Starting sub-test \"remote\""
report_rc ${T3_RC} "Starting sub-test \"stopall\""
sleep 0.2
run_recording remote &
T4_RC=${?}
T4_PID=${!}
report_rc ${T4_RC} "Starting sub-test \"remote\""
wait ${T1_PID}
T1_RC=${?}
wait ${T2_PID}
T2_RC=${?}
wait ${T3_PID}
T3_RC=${?}
wait ${T4_PID}
T4_RC=${?}
cat /dev/null > recording.rlog
for proto in files singlefile remote
for proto in files singlefile stopall remote
do
lfile="recording.${proto}.rlog"
if [ -e "${lfile}" ]
Expand All @@ -195,4 +206,5 @@ do
done
report_rc "${T1_RC}" "Waiting for sub-test \"files\" to complete"
report_rc "${T2_RC}" "Waiting for sub-test \"singlefile\" to complete"
report_rc "${T3_RC}" "Waiting for sub-test \"remote\" to complete"
report_rc "${T3_RC}" "Waiting for sub-test \"stopall\" to complete"
report_rc "${T4_RC}" "Waiting for sub-test \"remote\" to complete"
5 changes: 5 additions & 0 deletions tests/recording/basic.recstopall.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Na %%CALLID%% from_tag_1
Na %%CALLID%% to_tag_1
Na %%CALLID%% to_tag_1 from_tag_1
L %%CALLID%% 127.0.0.1 56780 to_tag_1 from_tag_1
L %%CALLID%% 127.0.0.1 9876 from_tag_1 to_tag_1
3 changes: 3 additions & 0 deletions tests/recording/basic.stopall.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rs %%CALLID%% from_tag_1
Rs %%CALLID%% to_tag_1
Rs %%CALLID%% to_tag_1 from_tag_1
14 changes: 14 additions & 0 deletions tests/recording/basic.stopall.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%%PORT_A%%
%%PORT_O%%
0
E50
0
0
E50
E50
%%PORT_A%%
%%PORT_O%%
rtpa_nsent=3124 rtpa_nrcvd=3124 rtpa_ndups=0 rtpa_nlost=0 rtpa_perrs=0
rtpa_nsent=3128 rtpa_nrcvd=3128 rtpa_ndups=0 rtpa_nlost=0 rtpa_perrs=0
MEMDEB(rtpproxy): all clear
%%CALL_ID%%=from_tag_1.pcap: 3126

0 comments on commit f85f5af

Please sign in to comment.