aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-06-18 13:08:22 +0200
committerpespin <pespin@sysmocom.de>2019-06-19 10:52:11 +0000
commit1fc30b94835d9125393d02c5ba51e002973c8b3c (patch)
treee0bda6b02f9916abefa1387314b3719123b5b53a
parentae8f262651ffd5b753075ea40a1685584649b985 (diff)
bsc-sccplite: Fix expected DLCX in HO tests
* TTCN3 code was not ACKing the DLCXs, and as a result retransmitted DLCX BSC->MGW were being counted as 2nd DLCX. * In SCCPLite, only 1 DLCX is expected BSC->MGW, because the BSC only takes care of the BTS-side conn in the endpoint, while MSC takes care of the MSC-side conn (which is not sent in this case because doesn't really involved the BSC other than forwarding the message, which will already be tested in other places in forthcoming commits). * Getting rid of retransmissions by ACKing the DLCX, it unconvers a bug in TC_ho_out_fail_no_ho_detect when on AoIP, where BSC only deletes one of the 2 previously created connections. * Code is refactored into the function because its logic is made more complex, and may be even more complex in forthcoming commits when we add MGCP-over-IPA forwarding verification support. Change-Id: Ia1d0db9af073760105cc8509e228e317dbea2268
-rw-r--r--bsc/BSC_Tests.ttcn95
1 files changed, 31 insertions, 64 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 00995bfb..976bc461 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2887,6 +2887,28 @@ testcase TC_ho_int() runs on test_CT {
vc_conn.done;
}
+/* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
+private function f_expect_dlcx_conns(boolean exp_clear_cmpl := true) runs on MSC_ConnHdlr {
+ var MgcpCommand mgcp;
+
+ MGCP.receive(tr_DLCX()) -> value mgcp {
+ log("Got first DLCX: ", mgcp);
+ MGCP.send(ts_DLCX_ACK2(mgcp.line.trans_id));
+ };
+
+ /* For SCCPLite, BSC doesn't handle the MSC-side */
+ if (g_pars.aoip) {
+ MGCP.receive(tr_DLCX()) -> value mgcp {
+ log("Got second DLCX: ", mgcp);
+ MGCP.send(ts_DLCX_ACK2(mgcp.line.trans_id));
+ };
+ }
+
+ if (exp_clear_cmpl) {
+ BSSAP.receive(tr_BSSMAP_ClearComplete);
+ }
+}
+
private function f_tc_ho_out_of_this_bsc(charstring id) runs on MSC_ConnHdlr {
g_pars := f_gen_test_hdlr_pars();
@@ -2937,17 +2959,7 @@ private function f_tc_ho_out_of_this_bsc(charstring id) runs on MSC_ConnHdlr {
var BssmapCause cause := enum2int(cause_val);
BSSAP.send(ts_BSSMAP_ClearCommand(cause));
- /* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
- var MgcpCommand mgcp;
- interleave {
- [] BSSAP.receive(tr_BSSMAP_ClearComplete);
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got first DLCX: ", mgcp);
- }
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got second DLCX: ", mgcp);
- }
- }
+ f_expect_dlcx_conns(true);
setverdict(pass);
f_sleep(1.0);
}
@@ -3154,14 +3166,10 @@ private function f_tc_ho_out_fail_no_ho_detect(charstring id) runs on MSC_ConnHd
[] BSSAP.receive(tr_BSSMAP_ClearRequest) {
log("Got BSSMAP Clear Request");
}
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got first DLCX: ", mgcp);
- }
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got second DLCX: ", mgcp);
- }
}
+ f_expect_dlcx_conns(false);
+
setverdict(pass);
f_sleep(1.0);
}
@@ -3305,17 +3313,7 @@ private function f_tc_ho_in_fail_msc_clears(charstring id) runs on MSC_ConnHdlr
var BssmapCause cause := enum2int(cause_val);
BSSAP.send(ts_BSSMAP_ClearCommand(cause));
- /* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
- var MgcpCommand mgcp;
- interleave {
- [] BSSAP.receive(tr_BSSMAP_ClearComplete);
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got first DLCX: ", mgcp);
- }
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got second DLCX: ", mgcp);
- }
- }
+ f_expect_dlcx_conns(true);
setverdict(pass);
f_sleep(1.0);
@@ -3397,17 +3395,7 @@ private function f_tc_ho_in_fail_msc_clears_after_ho_detect(charstring id) runs
var BssmapCause cause := enum2int(cause_val);
BSSAP.send(ts_BSSMAP_ClearCommand(cause));
- /* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
- var MgcpCommand mgcp;
- interleave {
- [] BSSAP.receive(tr_BSSMAP_ClearComplete);
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got first DLCX: ", mgcp);
- }
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got second DLCX: ", mgcp);
- }
- }
+ f_expect_dlcx_conns(true);
setverdict(pass);
f_sleep(1.0);
}
@@ -3486,17 +3474,7 @@ private function f_tc_ho_in_fail_no_detect(charstring id) runs on MSC_ConnHdlr {
var BssmapCause cause := enum2int(cause_val);
BSSAP.send(ts_BSSMAP_ClearCommand(cause));
- /* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
- var MgcpCommand mgcp;
- interleave {
- [] BSSAP.receive(tr_BSSMAP_ClearComplete);
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got first DLCX: ", mgcp);
- }
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got second DLCX: ", mgcp);
- }
- }
+ f_expect_dlcx_conns(true);
setverdict(pass);
f_sleep(1.0);
@@ -3563,24 +3541,13 @@ private function f_tc_ho_in_fail_no_detect2(charstring id) runs on MSC_ConnHdlr
BSSAP.receive(tr_BSSMAP_HandoverFailure);
/* MSC plays dumb and sends no Clear Command */
-
- /* Expecting MGCP to DLCX the endpoint's two connections: towards BTS and towards MSC */
var PDU_BSSAP rx_clear_request;
- var MgcpCommand mgcp;
- interleave {
- [] BSSAP.receive(tr_BSSMAP_ClearRequest) -> value rx_clear_request {
+
+ BSSAP.receive(tr_BSSMAP_ClearRequest) -> value rx_clear_request {
var BssmapCause cause := bit2int(rx_clear_request.pdu.bssmap.clearRequest.cause.causeValue);
BSSAP.send(ts_BSSMAP_ClearCommand(cause));
};
- [] BSSAP.receive(tr_BSSMAP_ClearComplete);
-
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got first DLCX: ", mgcp);
- }
- [] MGCP.receive(tr_DLCX()) -> value mgcp {
- log("Got second DLCX: ", mgcp);
- }
- }
+ f_expect_dlcx_conns(true);
setverdict(pass);
f_sleep(1.0);
}