diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-07-25 09:40:44 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-07-25 18:44:54 +0000 |
commit | 3629139790831a41092acfc23939b9978f930014 (patch) | |
tree | fd0605a6eca83d14ad14c49f868b85b7e6fd098c /mgw | |
parent | c4181915f7381eaab05121ff567aa204fb9acc82 (diff) |
MGCP_Test: add function to check for RTP err counters
At the moment we check the error counters of the RTP statistics in
the testcases. However, in most situations we will do the check to
make sure that no errors occurred (all counters == 0). Rather than
having a long tail of if statements in the testcases we should have
a function for this. This also makes it much easier in case we add
more error countes lateron.
- add and use function f_rtpem_stats_err_check()
Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1
Related: OS#3384
Diffstat (limited to 'mgw')
-rw-r--r-- | mgw/MGCP_Test.ttcn | 61 |
1 files changed, 14 insertions, 47 deletions
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 264ac285..a6d34607 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -961,21 +961,8 @@ module MGCP_Test { if (stats.bytes_payload_tx < 190) { setverdict(fail); } - if (stats.num_pkts_rx != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_seq != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_ts != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_pt != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_disabled != 0) { - setverdict(fail); - } + + f_rtpem_stats_err_check(stats); setverdict(pass); } @@ -1005,18 +992,8 @@ module MGCP_Test { if (stats.bytes_payload_tx != stats.bytes_payload_rx) { setverdict(fail); } - if (stats.num_pkts_rx_err_seq != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_ts != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_pt != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_disabled != 0) { - setverdict(fail); - } + + f_rtpem_stats_err_check(stats); setverdict(pass); } @@ -1068,10 +1045,8 @@ module MGCP_Test { mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); setverdict(pass); } @@ -1174,20 +1149,15 @@ module MGCP_Test { setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); /* Tear down */ f_flow_delete(RTPEM[0]); @@ -1240,10 +1210,8 @@ module MGCP_Test { mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[0]); setverdict(pass); } @@ -1308,10 +1276,9 @@ module MGCP_Test { mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); + f_rtpem_stats_err_check(stats[2]); setverdict(pass); } |