<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19874">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BSC_Tests: add TC_rll_{rel_ind,err_ind,timeout}_sapi_n_reject<br><br>The idea of these new test cases is to verify that the IUT does<br>send BSSMAP SAPI N Reject in the following cases respectively:<br><br> - on receipt of an unexpected RLL RELease INDication message<br> in response to RLL ESTablish REQuest (for SAPI=3 link);<br><br> - on receipt of an unexpected RLL ERROR INDication message<br> in response to RLL ESTablish REQuest (for SAPI=3 link);<br><br> - due to SAPI=3 link establishment timeout.<br><br>Change-Id: I00489e2af3befe5780380f64b09fb01e726c8df5<br>Related: SYS#5047, OS#4728<br>---<br>M bsc/BSC_Tests.ttcn<br>1 file changed, 117 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/74/19874/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn</span><br><span>index 61b700c..f100972 100644</span><br><span>--- a/bsc/BSC_Tests.ttcn</span><br><span>+++ b/bsc/BSC_Tests.ttcn</span><br><span>@@ -1881,6 +1881,118 @@</span><br><span> setverdict(pass);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+private function f_exp_sapi_n_reject(template (present) GsmSapi sapi := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+ template myBSSMAP_Cause cause := ?)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var BSSAP_N_DATA_ind rx_di;</span><br><span style="color: hsl(120, 100%, 40%);">+ timer T := 2.0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ var template BSSMAP_IE_Cause tr_cause := tr_BSSMAP_IE_Cause(cause);</span><br><span style="color: hsl(120, 100%, 40%);">+ var template PDU_BSSAP tr_pdu := tr_BSSMAP_SAPInReject(sapi);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ T.start;</span><br><span style="color: hsl(120, 100%, 40%);">+ alt {</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSSAP.receive(tr_BSSAP_DATA_ind(?, tr_pdu)) -> value rx_di {</span><br><span style="color: hsl(120, 100%, 40%);">+ var BSSMAP_IE_Cause rx_cause := rx_di.userData.pdu.bssmap.sAPInReject.cause;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (not match(rx_cause, tr_cause)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(fail, "Rx unexpected Cause IE: ",</span><br><span style="color: hsl(120, 100%, 40%);">+ rx_cause, " vs expected ", tr_cause);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSSAP.receive(BSSAP_N_DATA_ind:?) -> value rx_di {</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(fail, "Rx unexpected BSSAP PDU: ", rx_di);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ [] T.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(fail, "Timeout waiting for BSSMAP SAPI N Reject");</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Check if we get SAPI N Reject on receipt of unexpected RLL RELease INDication */</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_rll_rel_ind_sapi_n_reject() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var octetstring rnd_data := f_rnd_octstring(16);</span><br><span style="color: hsl(120, 100%, 40%);">+ var RSL_Message rx_rsl;</span><br><span style="color: hsl(120, 100%, 40%);">+ var DchanTuple dt;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ f_init(1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MS establishes a SAPI=0 link on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+ dt := f_est_dchan(f_rnd_ra_cs(), 23, rnd_data);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MSC sends some data on (not yet established) SAPI=3 link */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSAP_DTAP(rnd_data, '03'O)));</span><br><span style="color: hsl(120, 100%, 40%);">+ /* BSC attempts to establish a SAPI=3 link on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+ rx_rsl := f_exp_ipa_rx(0, tr_RSL_EST_REQ(dt.rsl_chan_nr, tr_RslLinkID_DCCH(3)));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MS sends unexpected RELease INDication on SAPI=3 */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_ipa_tx(0, ts_RSL_REL_IND(dt.rsl_chan_nr, ts_RslLinkID_DCCH(3)));</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect to receive BSSMAP SAPI N Reject message from the BSC */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_exp_sapi_n_reject(3, GSM0808_CAUSE_MS_NOT_EQUIPPED);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Clean up the connection */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));</span><br><span style="color: hsl(120, 100%, 40%);">+ f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Check if we get SAPI N Reject on receipt of unexpected RLL ERROR INDication */</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_rll_err_ind_sapi_n_reject() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var octetstring rnd_data := f_rnd_octstring(16);</span><br><span style="color: hsl(120, 100%, 40%);">+ var RSL_Message rx_rsl;</span><br><span style="color: hsl(120, 100%, 40%);">+ var DchanTuple dt;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ f_init(1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MS establishes a SAPI=0 link on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+ dt := f_est_dchan(f_rnd_ra_cs(), 23, rnd_data);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MSC sends some data on (not yet established) SAPI=3 link */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSAP_DTAP(rnd_data, '03'O)));</span><br><span style="color: hsl(120, 100%, 40%);">+ /* BSC attempts to establish a SAPI=3 link on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+ rx_rsl := f_exp_ipa_rx(0, tr_RSL_EST_REQ(dt.rsl_chan_nr, tr_RslLinkID_DCCH(3)));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* BTS sends unexpected ERROR INDication on SAPI=3 */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_ipa_tx(0, ts_RSL_ERROR_IND(dt.rsl_chan_nr, ts_RslLinkID_DCCH(3), ''O));</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect to receive BSSMAP SAPI N Reject message from the BSC */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_exp_sapi_n_reject(3, GSM0808_CAUSE_BSS_NOT_EQUIPPED);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Clean up the connection */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));</span><br><span style="color: hsl(120, 100%, 40%);">+ f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Check if we get SAPI N Reject due to a timeout */</span><br><span style="color: hsl(120, 100%, 40%);">+testcase TC_rll_timeout_sapi_n_reject() runs on test_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var octetstring rnd_data := f_rnd_octstring(16);</span><br><span style="color: hsl(120, 100%, 40%);">+ var RSL_Message rx_rsl;</span><br><span style="color: hsl(120, 100%, 40%);">+ var DchanTuple dt;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ f_init(1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MS establishes a SAPI=0 link on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+ dt := f_est_dchan(f_rnd_ra_cs(), 23, rnd_data);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MSC sends some data on (not yet established) SAPI=3 link */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSAP_DTAP(rnd_data, '03'O)));</span><br><span style="color: hsl(120, 100%, 40%);">+ /* BSC attempts to establish a SAPI=3 link on DCCH */</span><br><span style="color: hsl(120, 100%, 40%);">+ rx_rsl := f_exp_ipa_rx(0, tr_RSL_EST_REQ(dt.rsl_chan_nr, tr_RslLinkID_DCCH(3)));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* MS does not respond, so the link establishment timeout triggers SAPI N Reject */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_sleep(8.0); /* TODO: reduce this timeout somehow? */</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We expect to receive BSSMAP SAPI N Reject message from the BSC */</span><br><span style="color: hsl(120, 100%, 40%);">+ f_exp_sapi_n_reject(3, GSM0808_CAUSE_BSS_NOT_EQUIPPED);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Clean up the connection */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0));</span><br><span style="color: hsl(120, 100%, 40%);">+ f_expect_chan_rel(0, dt.rsl_chan_nr, expect_rll_rel_req := false);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ setverdict(pass);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> testcase TC_si_default() runs on test_CT {</span><br><span> f_init(0);</span><br><span> f_init_bts_and_check_sysinfo(0, expect_si := SystemInformationConfig_default);</span><br><span>@@ -6446,6 +6558,11 @@</span><br><span> execute( TC_rll_est_ind_inval_sapi3() );</span><br><span> execute( TC_rll_est_ind_inval_sacch() );</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* SAPI N Reject triggered by RLL establishment failures */</span><br><span style="color: hsl(120, 100%, 40%);">+ execute( TC_rll_rel_ind_sapi_n_reject() );</span><br><span style="color: hsl(120, 100%, 40%);">+ execute( TC_rll_err_ind_sapi_n_reject() );</span><br><span style="color: hsl(120, 100%, 40%);">+ execute( TC_rll_timeout_sapi_n_reject() );</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Paging related tests */</span><br><span> execute( TC_paging_imsi_nochan() );</span><br><span> execute( TC_paging_tmsi_nochan() );</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19874">change 19874</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19874"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I00489e2af3befe5780380f64b09fb01e726c8df5 </div>
<div style="display:none"> Gerrit-Change-Number: 19874 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>