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
This commit is contained in:
Neels Hofmeyr 2018-11-04 23:09:58 +01:00 committed by Neels Hofmeyr
parent 861a4c174c
commit a5302c8151
2 changed files with 53 additions and 17 deletions

View File

@ -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));
if (handle_rll_rel) {
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 */
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);
}

View File

@ -603,6 +603,8 @@ type record AssignmentState {
boolean is_assignment,
/* Assignment related bits */
boolean rr_ass_cmpl_seen,
boolean old_lchan_deact_sacch_seen,
boolean old_lchan_rll_rel_req_seen,
boolean assignment_done,
RslChannelNr old_chan_nr,
/* Modify related bits */
@ -614,6 +616,8 @@ template (value) AssignmentState ts_AssignmentStateInit := {
voice_call := false,
is_assignment := false,
rr_ass_cmpl_seen := false,
old_lchan_deact_sacch_seen := false,
old_lchan_rll_rel_req_seen := false,
assignment_done := false,
old_chan_nr := -,
rr_modify_seen := false,
@ -683,9 +687,11 @@ altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr {
}
}
[st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_DEACT_SACCH(st.old_chan_nr)) {
st.old_lchan_deact_sacch_seen := true;
repeat;
}
[st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) {
st.old_lchan_rll_rel_req_seen := true;
RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0))));
repeat;
}
@ -994,6 +1000,17 @@ runs on MSC_ConnHdlr {
}
f_check_mgcp_expectations();
if (st.is_assignment and st.assignment_done) {
if (not st.old_lchan_deact_sacch_seen) {
setverdict(fail, "f_establish_fully(): Assignment completed, but the old lchan was not",
" released properly: expected a Deact SACCH on the old lchan, but saw none.");
}
if (st.old_lchan_rll_rel_req_seen) {
setverdict(fail, "f_establish_fully(): Assignment completed, but the old lchan was not",
" released properly: saw an RLL Release on the old lchan, but expecting none.");
}
}
}
type record HandoverState {