From a5302c8151d1da2e43ed52efc0544d70bffab911 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sun, 4 Nov 2018 23:09:58 +0100 Subject: bsc: check channel release message presence Instead of vaguely allowing any release messages to be present or not, exactly pinpoint for each test case the exact release messages expected during lchan release. Related: an osmo-bsc change broke sending of RR Release messages, which was utterly ignored and hence not caught by ttcn tests. That must not happen again. I am not actually sure that these expectations are 100% correct; if errors become apparent, we shall change the expectations in ttcn3 and then fix osmo-bsc according to that. Adjust f_expect_chan_rel() and callers, and the Assignment procedures (as_assignment and f_establish_fully). The current state of the bsc tests should all pass with osmo-bsc Id3301df059582da2377ef82feae554e94fa42035 Related: OS#3413 Change-Id: Ibc64058f1e214bea585f4e8dcb66f3df8ead3845 --- bsc/BSC_Tests.ttcn | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'bsc/BSC_Tests.ttcn') diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b1f3a310..e06f4964 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -429,7 +429,7 @@ testcase TC_chan_act_ack_est_ind_noreply() runs on test_CT { /* expect BSC to disable the channel again if there's no response from MSC */ /* MS waits 20s (T3210) at LU; 10s (T3230) at CM SERV REQ and 5s (T3220) AT detach */ - f_expect_chan_rel(0, chan_nr); + f_expect_chan_rel(0, chan_nr, expect_rll_rel_req := false); setverdict(pass); } @@ -450,7 +450,7 @@ testcase TC_chan_act_ack_est_ind_refused() runs on test_CT { BSSAP.send(ts_BSSAP_DISC_req(rx_c_ind.connectionId, 0)); /* expect BSC to disable the channel */ - f_expect_chan_rel(0, chan_nr); + f_expect_chan_rel(0, chan_nr, expect_rll_rel_req := false); setverdict(pass); } @@ -817,32 +817,38 @@ testcase TC_late_conn_fail() runs on test_CT { } function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, - boolean handle_rll_rel := true) runs on test_CT { + boolean expect_deact_sacch := true, + boolean expect_rr_chan_rel := true, + boolean expect_rll_rel_req := true, + boolean handle_rll_rel := true + ) runs on test_CT { var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); var octetstring l3_rr_chan_rel := '060D00'O; + var boolean got_deact_sacch := false; + var boolean got_rr_chan_rel := false; + var boolean got_rll_rel_req := false; + log("f_expect_chan_rel() expecting: expect_deact_sacch=", expect_deact_sacch, " expect_rr_chan_rel=", expect_rr_chan_rel, + " expect_rll_rel_req=", expect_rll_rel_req); alt { - /* ignore DEACTIVATE SACCH (if any) */ [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DEACT_SACCH(rsl_chan_nr))) { + got_deact_sacch := true; repeat; } [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DATA_REQ(rsl_chan_nr, ?, l3_rr_chan_rel))) { + got_rr_chan_rel := true; repeat; } - /* acknowledge RLL release (if any)*/ - [handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_REL_REQ(rsl_chan_nr, ?))) { + got_rll_rel_req := true; /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch)); - repeat; - } - [not handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(rsl_chan_nr, ?))) { - /* Do not reply, just continue */ + if (handle_rll_rel) { + f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch)); + } repeat; } - /* Expect RF channel release from BSC on Abis */ [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { /* respond with CHAN REL ACK */ @@ -853,6 +859,19 @@ function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, repeat; } } + + log("f_expect_chan_rel() summary: got_deact_sacch=", got_deact_sacch, " got_rr_chan_rel=", got_rr_chan_rel, + " got_rll_rel_req=", got_rll_rel_req); + + if (expect_deact_sacch != got_deact_sacch) { + setverdict(fail, "f_expect_chan_rel(): expect_deact_sacch=", expect_deact_sacch, " got_deact_sacch=", got_deact_sacch); + } + if (expect_rr_chan_rel != got_rr_chan_rel) { + setverdict(fail, "f_expect_chan_rel(): expect_rr_chan_rel=", expect_rr_chan_rel, " got_rr_chan_rel=", got_rr_chan_rel); + } + if (expect_rll_rel_req != got_rll_rel_req) { + setverdict(fail, "f_expect_chan_rel(): expect_rll_rel_req=", expect_rll_rel_req, " got_rll_rel_req=", got_rll_rel_req); + } } /* Test behavior of channel release after hard Clear Command from MSC */ @@ -874,7 +893,7 @@ testcase TC_chan_rel_hard_clear() runs on test_CT { BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); } - f_expect_chan_rel(0, dt.rsl_chan_nr); + f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false); setverdict(pass); } @@ -889,7 +908,7 @@ testcase TC_chan_rel_hard_rlsd() runs on test_CT { /* release the SCCP connection */ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); - f_expect_chan_rel(0, dt.rsl_chan_nr); + f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false); setverdict(pass); } @@ -904,7 +923,7 @@ testcase TC_chan_rel_hard_rlsd_ms_dead() runs on test_CT { /* release the SCCP connection */ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); - f_expect_chan_rel(0, dt.rsl_chan_nr, handle_rll_rel := false); + f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false); setverdict(pass); } @@ -926,7 +945,7 @@ testcase TC_chan_rel_a_reset() runs on test_CT { [] BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)) { } } - f_expect_chan_rel(0, dt.rsl_chan_nr); + f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false); setverdict(pass); } -- cgit v1.2.3