Review at https://gerrit.osmocom.org/7219
bsc: add test for OS#3041 Change-Id: Ie4aa2f01c83b40303fa40ed64dbfce372b7cd96c --- M bsc/BSC_Tests.ttcn 1 file changed, 64 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/19/7219/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index dc266ab..42ab5bf 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -233,6 +233,13 @@ } } +altstep no_bssmap_reset() runs on test_CT { + [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) { + setverdict(fail, "unexpected BSSMAP Reset"); + self.stop; + } +} + function f_init_mgcp(charstring id) runs on test_CT { id := id & "-MGCP"; @@ -1694,6 +1701,61 @@ vc_conn.done; } +/* OS#3041: Open and close N connections in a normal fashion, and expect no + * BSSMAP Reset just because of that. */ +testcase TC_bssmap_clear_does_not_cause_bssmap_reset() runs on test_CT { + var default d; + var integer i; + var DchanTuple dt; + + f_init(); + + /* Wait for initial BSSMAP Reset to pass */ + f_sleep(4.0); + + d := activate(no_bssmap_reset()); + + /* Setup up a number of connections and RLSD them again from the MSC + * side. In the buggy behavior, the fourth one triggers BSSMAP Reset. + * Let's do it some more times for good measure. */ + for (i := 0; i < 8; i := i+1) { + /* Setup a BSSAP connection and clear it right away. This is + * the MSC telling the BSC about a planned release, it's not an + * erratic loss of a connection. */ + dt := f_est_dchan('23'O, 23, '00010203040506'O); + + /* TODO for this test: maybe a plain RLSD could be considered + * erratic, in which case this test would have to play out a + * BSSMAP Clear as well. That would pan out something like + * testcase TC_chan_rel_rll_rel_ind(), however, at the time of + * writing that test fails and it makes no sense to import that + * failure here. */ + if (false) { + /* simulate RLL REL IND */ + f_ipa_tx(0, ts_RSL_REL_IND(dt.rsl_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); + + /* expect BSC to disable the channel */ + f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); + /* respond with CHAN REL ACK */ + f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); + + /* expect DISC_IND on MSC side */ + BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)); + } + + /* MSC disconnects as instructed. */ + BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); + } + + /* In the buggy behavior, a timeout of 2 seconds happens between above + * trigger (logs "SIGTRAN connection down, reconnecting...") and the + * actual BSSMAP Reset. Wait a bit longer just to make sure. */ + f_sleep(4.0); + + deactivate(d); + f_shutdown_helper(); +} + control { /* CTRL interface testing */ @@ -1768,6 +1830,8 @@ execute( TC_err_82_short_msg() ); execute( TC_err_84_unknown_msg() ); execute( TC_ho_int() ); + + execute( TC_bssmap_clear_does_not_cause_bssmap_reset() ); } } -- To view, visit https://gerrit.osmocom.org/7219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4aa2f01c83b40303fa40ed64dbfce372b7cd96c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>