From 7df85f63bf8647a3e6fd4554b1e9e531834d2b5d Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 25 Jul 2018 10:26:09 +0200 Subject: [PATCH] MGCP_Test: Test what happens when two ends use different PT It is legal that two connections use the same codec but negotiate different dynamic payload types for both connections. Then the MGW is expected to receive packets with one PT and send them with the other PT. This is currently not done in osmo-mgw so the two tests that this commit adds are expected to fail for now. - add testcase TC_two_crcx_diff_pt_and_rtp - add testcase TC_two_crcx_diff_pt_and_rtp_bidir Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 Related: OS#3384 --- mgw/MGCP_Test.ttcn | 23 ++++++++++++++++++----- mgw/expected-results.xml | 6 ++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index a6d34607c..494e8bba5 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -998,7 +998,8 @@ module MGCP_Test { setverdict(pass); } - function f_TC_two_crcx_and_rtp(boolean bidir) runs on dummy_CT { + function f_TC_two_crcx_and_rtp(boolean bidir, charstring codec_name_a, integer pt_a, + charstring codec_name_b, integer pt_b) runs on dummy_CT { var RtpFlowData flow[2]; var RtpemStats stats[2]; var MgcpResponse resp; @@ -1009,13 +1010,13 @@ module MGCP_Test { f_init(ep); /* from us to MGW */ - flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000")); + flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_a, codec_name_a)); /* bind local RTP emulation sockets */ flow[0].em.portnr := 10000; f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]); /* from MGW back to us */ - flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000")); + flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_b, codec_name_b)); flow[1].em.portnr := 20000; f_flow_create(RTPEM[1], ep, call_id, "sendrecv", flow[1]); @@ -1053,13 +1054,23 @@ module MGCP_Test { /* create two local RTP emulations; create two connections on MGW EP, exchange some data */ testcase TC_two_crcx_and_rtp() runs on dummy_CT { - f_TC_two_crcx_and_rtp(false); + f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 98); } /* create two local RTP emulations; create two connections on MGW EP, * exchange some data in both directions */ testcase TC_two_crcx_and_rtp_bidir() runs on dummy_CT { - f_TC_two_crcx_and_rtp(true); + f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 98); + } + + /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */ + testcase TC_two_crcx_diff_pt_and_rtp() runs on dummy_CT { + f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 112); + } + + /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */ + testcase TC_two_crcx_diff_pt_and_rtp_bidir() runs on dummy_CT { + f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 112); } /* create two local RTP emulations and pass data in both directions */ @@ -1328,6 +1339,8 @@ module MGCP_Test { execute(TC_one_crcx_loopback_rtp()); execute(TC_two_crcx_and_rtp()); execute(TC_two_crcx_and_rtp_bidir()); + execute(TC_two_crcx_diff_pt_and_rtp()); + execute(TC_two_crcx_diff_pt_and_rtp_bidir()); execute(TC_two_crcx_mdcx_and_rtp()); execute(TC_two_crcx_and_unsolicited_rtp()); execute(TC_two_crcx_and_one_mdcx_rtp_ho()); diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml index f201099a0..92b935189 100644 --- a/mgw/expected-results.xml +++ b/mgw/expected-results.xml @@ -34,6 +34,12 @@ + + RTP packet payload type errors occurred + + + RTP packet payload type errors occurred +