summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-08-28 18:04:41 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-08-29 01:50:10 +0700
commit6ef5dfab86227330babbc7a0f4712668807e2b48 (patch)
tree25f9db8168056d955ed3d6095e9a072dbb28d174 /bsc
parent4806396589a3410172fd9de92e84117c8b7a987f (diff)
BSC_Tests: add TC_rll_{rel_ind,err_ind,timeout}_sapi_n_reject
The idea of these new test cases is to verify that the IUT does send BSSMAP SAPI N Reject in the following cases respectively: - on receipt of an unexpected RLL RELease INDication message in response to RLL ESTablish REQuest (for SAPI=3 link); - on receipt of an unexpected RLL ERROR INDication message in response to RLL ESTablish REQuest (for SAPI=3 link); - due to SAPI=3 link establishment timeout. Change-Id: I00489e2af3befe5780380f64b09fb01e726c8df5 Related: SYS#5047, OS#4728
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests.ttcn116
1 files changed, 116 insertions, 0 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 61b700c..dce9ae9 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1881,6 +1881,117 @@ testcase TC_rll_est_ind_inval_sacch() runs on test_CT {
setverdict(pass);
}
+private function f_exp_sapi_n_reject(template (present) GsmSapi sapi := ?,
+ template myBSSMAP_Cause cause := ?,
+ float T_val := 2.0)
+runs on test_CT {
+ var BSSAP_N_DATA_ind rx_di;
+ timer T;
+
+ var template BSSMAP_IE_Cause tr_cause := tr_BSSMAP_IE_Cause(cause);
+ var template PDU_BSSAP tr_pdu := tr_BSSMAP_SAPInReject(sapi);
+
+ T.start(T_val);
+ alt {
+ [] BSSAP.receive(tr_BSSAP_DATA_ind(?, tr_pdu)) -> value rx_di {
+ var BSSMAP_IE_Cause rx_cause := rx_di.userData.pdu.bssmap.sAPInReject.cause;
+ if (not match(rx_cause, tr_cause)) {
+ setverdict(fail, "Rx unexpected Cause IE: ",
+ rx_cause, " vs expected ", tr_cause);
+ }
+ setverdict(pass);
+ }
+ [] BSSAP.receive(BSSAP_N_DATA_ind:?) -> value rx_di {
+ setverdict(fail, "Rx unexpected BSSAP PDU: ", rx_di);
+ }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for BSSMAP SAPI N Reject");
+ }
+ }
+}
+
+/* Check if we get SAPI N Reject on receipt of unexpected RLL RELease INDication */
+testcase TC_rll_rel_ind_sapi_n_reject() runs on test_CT {
+ var octetstring rnd_data := f_rnd_octstring(16);
+ var RSL_Message rx_rsl;
+ var DchanTuple dt;
+
+ f_init(1);
+
+ /* MS establishes a SAPI=0 link on DCCH */
+ dt := f_est_dchan(f_rnd_ra_cs(), 23, rnd_data);
+
+ /* MSC sends some data on (not yet established) SAPI=3 link */
+ BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSAP_DTAP(rnd_data, '03'O)));
+ /* BSC attempts to establish a SAPI=3 link on DCCH */
+ rx_rsl := f_exp_ipa_rx(0, tr_RSL_EST_REQ(dt.rsl_chan_nr, tr_RslLinkID_DCCH(3)));
+
+ /* MS sends unexpected RELease INDication on SAPI=3 */
+ f_ipa_tx(0, ts_RSL_REL_IND(dt.rsl_chan_nr, ts_RslLinkID_DCCH(3)));
+ /* We expect to receive BSSMAP SAPI N Reject message from the BSC */
+ f_exp_sapi_n_reject(3, GSM0808_CAUSE_MS_NOT_EQUIPPED);
+
+ /* Clean up the connection */
+ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
+ f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
+
+ setverdict(pass);
+}
+
+/* Check if we get SAPI N Reject on receipt of unexpected RLL ERROR INDication */
+testcase TC_rll_err_ind_sapi_n_reject() runs on test_CT {
+ var octetstring rnd_data := f_rnd_octstring(16);
+ var RSL_Message rx_rsl;
+ var DchanTuple dt;
+
+ f_init(1);
+
+ /* MS establishes a SAPI=0 link on DCCH */
+ dt := f_est_dchan(f_rnd_ra_cs(), 23, rnd_data);
+
+ /* MSC sends some data on (not yet established) SAPI=3 link */
+ BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSAP_DTAP(rnd_data, '03'O)));
+ /* BSC attempts to establish a SAPI=3 link on DCCH */
+ rx_rsl := f_exp_ipa_rx(0, tr_RSL_EST_REQ(dt.rsl_chan_nr, tr_RslLinkID_DCCH(3)));
+
+ /* BTS sends unexpected ERROR INDication on SAPI=3 */
+ f_ipa_tx(0, ts_RSL_ERROR_IND(dt.rsl_chan_nr, ts_RslLinkID_DCCH(3), ''O));
+ /* We expect to receive BSSMAP SAPI N Reject message from the BSC */
+ f_exp_sapi_n_reject(3, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
+
+ /* Clean up the connection */
+ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
+ f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
+
+ setverdict(pass);
+}
+
+/* Check if we get SAPI N Reject due to a SAPI=3 link establishment timeout */
+testcase TC_rll_timeout_sapi_n_reject() runs on test_CT {
+ var octetstring rnd_data := f_rnd_octstring(16);
+ var RSL_Message rx_rsl;
+ var DchanTuple dt;
+
+ f_init(1);
+
+ /* MS establishes a SAPI=0 link on DCCH */
+ dt := f_est_dchan(f_rnd_ra_cs(), 23, rnd_data);
+
+ /* MSC sends some data on (not yet established) SAPI=3 link */
+ BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSAP_DTAP(rnd_data, '03'O)));
+ /* BSC attempts to establish a SAPI=3 link on DCCH */
+ rx_rsl := f_exp_ipa_rx(0, tr_RSL_EST_REQ(dt.rsl_chan_nr, tr_RslLinkID_DCCH(3)));
+
+ /* MS does not respond, so the link establishment timeout triggers SAPI N Reject */
+ f_exp_sapi_n_reject(3, GSM0808_CAUSE_BSS_NOT_EQUIPPED, T_val := 8.0);
+
+ /* Clean up the connection */
+ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));
+ f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);
+
+ setverdict(pass);
+}
+
testcase TC_si_default() runs on test_CT {
f_init(0);
f_init_bts_and_check_sysinfo(0, expect_si := SystemInformationConfig_default);
@@ -6446,6 +6557,11 @@ control {
execute( TC_rll_est_ind_inval_sapi3() );
execute( TC_rll_est_ind_inval_sacch() );
+ /* SAPI N Reject triggered by RLL establishment failures */
+ execute( TC_rll_rel_ind_sapi_n_reject() );
+ execute( TC_rll_err_ind_sapi_n_reject() );
+ execute( TC_rll_timeout_sapi_n_reject() );
+
/* Paging related tests */
execute( TC_paging_imsi_nochan() );
execute( TC_paging_tmsi_nochan() );