Change in osmo-ttcn3-hacks[master]: MGCP_Test: add E1 related testscases

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Aug 12 18:21:49 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19561 )

Change subject: MGCP_Test: add E1 related testscases
......................................................................

MGCP_Test: add E1 related testscases

osmo-mgw recently added support for E1 trunks via libosmoabis. While the
actual E1 plane may be difficult to test, there is some functionality
that can already be tested without having E1 support in TTCN3.

Lets add three testcases:
- TC_e1_crcx_and_dlcx_ep:
  Does a CRCX to an E1 endpoint followed by a DLCX
- TC_e1_crcx_with_overlap:
  Not all E1 endpoint combinations are possible at the same time. This
  test verifies that invalid endpoint combinations are prevented.
- TC_e1_crcx_loopback:
  Opes an E1 endpoint and tests if RTP loopback works (NO E1 traffic
  involved)

Change-Id: I673eeffcb3012b42f039789960c54d99282e1aad
Related: OS#2659
---
M mgw/MGCP_Test.ttcn
1 file changed, 87 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 6caef79..24bfdaf 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -2146,6 +2146,88 @@
 		setverdict(pass);
 	}
 
+	/* Test (valid) CRCX followed by (valid) DLCX containing EP (E1) */
+	testcase TC_e1_crcx_and_dlcx_ep() runs on dummy_CT {
+		var template MgcpCommand cmd;
+		var MgcpResponse resp;
+		var MgcpEndpoint ep := "ds/e1-1/s-1/su16-0@" & c_mgw_domain;
+		var MgcpCallId call_id := '8376F297'H;
+
+		f_init(ep);
+
+		cmd := ts_CRCX(get_next_trans_id(), ep, "recvonly", call_id);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+
+		f_dlcx_ok(ep);
+
+		setverdict(pass);
+	}
+
+	/* Test what happens when overlapping endpoints are selected (E1) */
+	testcase TC_e1_crcx_with_overlap() runs on dummy_CT {
+		var template MgcpCommand cmd;
+		var MgcpResponse resp;
+		var MgcpEndpoint ep_1 := "ds/e1-1/s-1/su8-0@" & c_mgw_domain;
+		var MgcpEndpoint ep_2 := "ds/e1-1/s-1/su16-0@" & c_mgw_domain;
+		var MgcpCallId call_id_1 := '8376F297'H;
+		var MgcpCallId call_id_2 := '837AF2A7'H;
+
+		f_init();
+
+		/* ep_1 and ep_2 are overlapping, selecting both one after
+		 * another should work fine: */
+		cmd := ts_CRCX(get_next_trans_id(), ep_1, "recvonly", call_id_1);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+		f_dlcx_ok(ep_1);
+		cmd := ts_CRCX(get_next_trans_id(), ep_2, "recvonly", call_id_2);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+		f_dlcx_ok(ep_2);
+
+		/* When ep_1 is serving a call we can not select ep_2 becaus
+		 * it is overlapping with ep_1 */
+		cmd := ts_CRCX(get_next_trans_id(), ep_1, "recvonly", call_id_1);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+		cmd := ts_CRCX(get_next_trans_id(), ep_2, "recvonly", call_id_2);
+		resp := mgcp_transceive_mgw(cmd, ?);
+		if (resp.line.code != "501") {
+			setverdict(fail, "unexpected CRCX returncode, CRCX should fail!");
+		}
+		f_dlcx_ok(ep_1);
+
+		setverdict(pass);
+	}
+
+	/* Create one connection in loopback mode, test if the RTP packets are
+	 * actually reflected */
+	testcase TC_e1_crcx_loopback() runs on dummy_CT {
+		var RtpFlowData flow;
+		var MgcpEndpoint ep := "ds/e1-1/s-1/su16-0@" & c_mgw_domain;
+		var MgcpCallId call_id := '12250989'H;
+		var RtpemStats stats;
+
+		f_init(ep);
+		flow := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 111, "GSM-HR-08/8000/1"));
+		flow.em.portnr := 10000;
+		f_flow_create(RTPEM[0], ep, call_id, "loopback", flow);
+
+		f_rtpem_mode(RTPEM[0], RTPEM_MODE_BIDIR);
+		f_sleep(1.0);
+		f_flow_delete(RTPEM[0], ep, call_id);
+
+		stats := f_rtpem_stats_get(RTPEM[0]);
+
+		if (stats.num_pkts_tx != stats.num_pkts_rx) {
+			setverdict(fail);
+		}
+		if (stats.bytes_payload_tx != stats.bytes_payload_rx) {
+			setverdict(fail);
+		}
+
+		f_rtpem_stats_err_check(stats);
+
+		setverdict(pass);
+	}
+
 	control {
 		execute(TC_selftest());
 		execute(TC_crcx());
@@ -2201,5 +2283,10 @@
 		execute(TC_amr_bwe_bwe_rtp_conversion());
 
 		execute(TC_conn_timeout());
+
+		execute(TC_e1_crcx_and_dlcx_ep());
+		execute(TC_e1_crcx_with_overlap());
+		execute(TC_e1_crcx_loopback());
+
 	}
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19561
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I673eeffcb3012b42f039789960c54d99282e1aad
Gerrit-Change-Number: 19561
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200812/1afb2923/attachment.htm>


More information about the gerrit-log mailing list