diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 00995bfb1..976bc461f 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); }