pespin has uploaded this change for review.

View Change

mgw: Introduce test TC_crcx_osmux_257

Related: SYS#5987
Change-Id: I74e6c760e076fe2547b6297a54524255fb8bc41b
---
M mgw/MGCP_Test.ttcn
M mgw/osmo-mgw.cfg
2 files changed, 47 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/61/29661/1
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index ef99403..2a040f2 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -1171,6 +1171,51 @@
setverdict(pass);
}

+ /* test Creating 257 concurrent osmux conns. It should fail since maximum is 256. */
+ testcase TC_crcx_osmux_257() runs on dummy_CT {
+ var MgcpEndpoint ep := c_mgw_ep_rtpbridge & "*@" & c_mgw_domain;
+ var template MgcpCommand cmd;
+ var MgcpResponse resp;
+ var charstring cid_response;
+ var integer i;
+
+ f_init(ep, true);
+
+ for (i := 0; i < 256; i := i + 1) {
+
+ cmd := ts_CRCX_osmux(get_next_trans_id(), ep, "recvonly", int2hex(i, 4), -1);
+ resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK_osmux);
+ extract_conn_id(resp);
+
+ /* extract Osmux CID we got assigned by the MGW */
+ var MgcpMessage resp_msg := {
+ response := resp
+ }
+
+ if (f_mgcp_find_param(resp_msg, "X-OSMUX", cid_response) == false) {
+ setverdict(fail, "No Osmux CID in MGCP response", resp);
+ mtc.stop;
+ }
+
+ /* Make sure response is no wildcard */
+ if (f_mgcp_osmux_cid_decode(cid_response) == -1) {
+ setverdict(fail, "Osmux CID in MGCP response contains unexpected wildcard");
+ mtc.stop;
+ }
+ }
+
+ /* Now conn num 257, it should fail due to all Osmux conns already allocated: */
+ cmd := ts_CRCX_osmux(get_next_trans_id(), ep, "recvonly", int2hex(i, 4), -1);
+ resp := mgcp_transceive_mgw(cmd, tr_MgcpResp_Err("400"));
+
+ setverdict(pass);
+
+ /* Clean up */
+ for (i := 0; i < 256; i := i + 1) {
+ f_dlcx_ok(ep, int2hex(i, 4));
+ }
+ }
+
/* Create one half open connection in receive-only mode. The MGW must accept
* the packets but must not send any. */
testcase TC_one_crcx_receive_only_osmux() runs on dummy_CT {
@@ -2839,6 +2884,7 @@
execute(TC_crcx_osmux_wildcard());
execute(TC_crcx_osmux_fixed());
execute(TC_crcx_osmux_fixed_twice());
+ execute(TC_crcx_osmux_257());
execute(TC_one_crcx_receive_only_osmux());
execute(TC_one_crcx_loopback_osmux());
execute(TC_two_crcx_and_rtp_osmux());
diff --git a/mgw/osmo-mgw.cfg b/mgw/osmo-mgw.cfg
index 1c5cfce..417026e 100644
--- a/mgw/osmo-mgw.cfg
+++ b/mgw/osmo-mgw.cfg
@@ -44,7 +44,7 @@
sdp audio-payload send-name
conn-timeout 0
loop 0
- number endpoints 31
+ number endpoints 300
allow-transcoding
osmux off
osmux bind-ip 127.0.0.1

To view, visit change 29661. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I74e6c760e076fe2547b6297a54524255fb8bc41b
Gerrit-Change-Number: 29661
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange