aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-07-25 09:40:44 +0200
committerHarald Welte <laforge@gnumonks.org>2018-07-25 18:44:54 +0000
commit3629139790831a41092acfc23939b9978f930014 (patch)
treefd0605a6eca83d14ad14c49f868b85b7e6fd098c /library
parentc4181915f7381eaab05121ff567aa204fb9acc82 (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 'library')
-rw-r--r--library/RTP_Emulation.ttcn36
1 files changed, 36 insertions, 0 deletions
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index 2a358a95..fcb158bd 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -242,6 +242,42 @@ function f_rtpem_stats_compare(RtpemStats a, RtpemStats b, integer tolerance :=
return true;
}
+/* Check the statistics for general signs of errors. This is a basic general
+ * check that will fit most situations and is intended to be executed by
+ * the testcases as as needed. */
+function f_rtpem_stats_err_check(RtpemStats s) {
+ log("stats: ", s);
+
+ /* Check if there was some activity at either on the RX or on the
+ * TX side, but complete silence would indicate some problem */
+ if (s.num_pkts_tx < 1 and s.num_pkts_rx < 1) {
+ setverdict(fail, "no RTP packet activity detected (packets)");
+ mtc.stop;
+ }
+ if (s.bytes_payload_tx < 1 and s.bytes_payload_rx < 1) {
+ setverdict(fail, "no RTP packet activity detected (bytes)");
+ mtc.stop;
+ }
+
+ /* Check error counters */
+ if (s.num_pkts_rx_err_seq != 0) {
+ setverdict(fail, "RTP packet sequence number errors occurred");
+ mtc.stop;
+ }
+ if (s.num_pkts_rx_err_ts != 0) {
+ setverdict(fail, "RTP packet timestamp errors occurred");
+ mtc.stop;
+ }
+ if (s.num_pkts_rx_err_pt != 0) {
+ setverdict(fail, "RTP packet payload type errors occurred");
+ mtc.stop;
+ }
+ if (s.num_pkts_rx_err_disabled != 0) {
+ setverdict(fail, "RTP packets received while RX was disabled");
+ mtc.stop;
+ }
+}
+
template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t ts,
octetstring payload, BIT1 marker := '0'B) := {
version := 2,