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
This commit is contained in:
parent
95a5edc308
commit
2609c750d5
|
@ -2146,6 +2146,88 @@ module MGCP_Test {
|
|||
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 @@ module MGCP_Test {
|
|||
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());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue