Change in ...osmo-ttcn3-hacks[master]: bsc: Test that ETWS Primary Notification are sent via dedicated channels

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Sep 8 08:39:06 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15414 )

Change subject: bsc: Test that ETWS Primary Notification are sent via dedicated channels
......................................................................

bsc: Test that ETWS Primary Notification are sent via dedicated channels

When the BSC receives an ETWS PN via CBSP, it must send it through all
established dedicated channels of the matching BTSs.

Related: OS#4046

Change-Id: Ib057bd251604e9bae968e71de245b3bbf737a356
---
M bsc/BSC_Tests_CBSP.ttcn
M library/CBSP_Templates.ttcn
M library/L3_Templates.ttcn
3 files changed, 108 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index 3d6040e..792b771 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -25,6 +25,10 @@
 import from IPA_CodecPort all;
 import from IPA_Types all;
 
+import from MobileL3_Types all;
+import from MobileL3_RRM_Types all;
+import from L3_Templates all;
+
 import from RSL_Types all;
 import from RSL_Emulation all;
 
@@ -155,6 +159,35 @@
 }
 
 /* send a WRITE CBS to the BSC; expect either COMPLETE or FAILURE in response*/
+function f_cbsp_write_emerg(uint16_t msg_id, uint16_t ser_no,
+			template (value) BSSMAP_FIELD_CellIdentificationList cell_list := ts_BSSMAP_CIL_BSS,
+			template (value) uint8_t emerg_ind := 1,
+			template (value) uint16_t warn_type := oct2int('0780'O),
+			template (value) uint16_t warn_per := 5,
+			template BSSMAP_FIELD_CellIdentificationList success_list := ?,
+			template CBSP_FailureListItems fail_list := omit) runs on cbsp_test_CT {
+	var template (value) CBSP_PDU tx;
+	var template CBSP_PDU rx;
+	var CBSP_IEs pages := {f_gen_page()};
+
+	tx := ts_CBSP_WRITE_EMERG(msg_id, ser_no, cell_list, emerg_ind, warn_type, warn_per);
+	CBSP[0].send(ts_CBSP_Send(g_cbsp_conn_id[0], tx));
+	if (istemplatekind(fail_list, "omit")) {
+		rx := tr_CBSP_WRITE_CBS_COMPL(msg_id, ser_no, success_list, omit);
+	} else {
+		rx := tr_CBSP_WRITE_CBS_FAIL(msg_id, ser_no, fail_list, *, success_list, omit);
+	}
+	alt {
+	[] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], rx)) {
+		setverdict(pass);
+		}
+	[] CBSP[0].receive(tr_CBSP_Recv(g_cbsp_conn_id[0], ?)) {
+		setverdict(fail, "Received unexpected CBSP");
+		}
+	}
+}
+
+/* send a WRITE CBS to the BSC; expect either COMPLETE or FAILURE in response*/
 function f_cbsp_write(uint16_t msg_id, uint16_t ser_no,
 		      template (value) BSSMAP_FIELD_CellIdentificationList cell_list := ts_BSSMAP_CIL_BSS,
 		      template (value) CBSP_Category category := CBSP_CATEG_NORMAL,
@@ -478,6 +511,57 @@
 	f_cbsp_reset_bss(0);
 }
 
+private const octetstring c_ETWS_sec_default :=
+	'00000000000000000000000000000000000000000000000000'O &
+	'00000000000000000000000000000000000000000000000000'O;
+function f_gen_etws_pn(uint16_t ser_nr, uint16_t msg_id, OCT2 msg_type := '0780'O,
+			octetstring sec_inf := c_ETWS_sec_default) return octetstring {
+	return int2oct(ser_nr, 2) & int2oct(msg_id, 2) & msg_type & sec_inf;
+}
+
+/* Write ETWS PN to single BTS; verify it arrives on DCHAN */
+testcase TC_cbsp_emerg_write_bts_cgi_dchan() runs on cbsp_test_CT {
+	var CBSP_IEs pages := {f_gen_page()};
+	var template (value) BSSMAP_FIELD_CellIdentificationList cell_list;
+	var ASP_RSL_Unitdata rx_rsl_ud;
+
+	cell_list := ts_BSSMAP_CIL_CGI({bssmap_cgi(mp_cgi_bts0)});
+	f_cbsp_init_server();
+
+	/* first establish a dedicated channel */
+	var DchanTuple dt := f_est_dchan('23'O, 23, '00010203040506'O);
+
+	/* then send ETWS PN */
+	f_cbsp_write_emerg(15, 1015, cell_list);
+	var template (present) octetstring tr_apdu := f_gen_etws_pn(1015, 15);
+	timer T := 5.0;
+	T.start;
+	alt {
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_DATA_REQ(dt.rsl_chan_nr, ?, ?))) -> value rx_rsl_ud {
+		var RSL_IE_Body l3_ie;
+		if (f_rsl_find_ie(rx_rsl_ud.rsl, RSL_IE_L3_INFO, l3_ie) == false) {
+			setverdict(fail, "RSL DATA REQ without L3?");
+			mtc.stop;
+		}
+		var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(l3_ie.l3_info.payload);
+		var template (present) APDU_Flags_V tr_flags := {
+			lastSeg := '0'B,
+			firstSeg := '0'B,
+			cR := '0'B,
+			spare := '0'B
+		};
+		if (match(l3, tr_RR_APP_INFO('0001'B, tr_apdu, tr_flags))) {
+			setverdict(pass);
+			}
+		}
+	[] IPA_RSL[0].receive { repeat; }
+	[] T.timeout {
+		setverdict(fail, "Waiting for APP INFO");
+		}
+	}
+}
+
+
 control {
 	execute( TC_cbsp_bsc_server() );
 	execute( TC_cbsp_bsc_client() );
@@ -499,6 +583,8 @@
 	execute( TC_cbsp_kill_nonexist() );
 	execute( TC_cbsp_write_then_kill() );
 	execute( TC_cbsp_write_then_reset() );
+
+	execute( TC_cbsp_emerg_write_bts_cgi_dchan() );
 }
 
 
diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn
index 7c73d7c..57e87e2 100644
--- a/library/CBSP_Templates.ttcn
+++ b/library/CBSP_Templates.ttcn
@@ -283,7 +283,6 @@
 						template (value) BSSMAP_FIELD_CellIdentificationList cell_list,
 						template (value) uint8_t emerg_ind,
 						template (value) uint16_t warn_type,
-						template (value) uint16_t num_bcast_req,
 						template (value) uint8_t warn_per
 					    ) :=
 	ts_CBSP(CBSP_MSGT_WRITE_REPLACE, {
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index bc0e797..2fb86d0 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -523,6 +523,28 @@
 	}
 }
 
+template (present) PDU_ML3_NW_MS tr_RR_APP_INFO(template (present) BIT4 apdu_id,
+						template (present) octetstring data,
+						template (present) APDU_Flags_V flags := ?) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		rrm := {
+			applicationInformation := {
+				messageType := '00111000'B,
+				aPDU_ID := apdu_id,
+				aPDU_Flags := flags,
+				aPDU_Data := {
+					lengthIndicator := ?,
+					aPDU_DataValue := data
+				}
+			}
+		}
+	}
+}
+
 template (value) PDU_ML3_NW_MS ts_RR_HandoverCommand := {
 	discriminator := '0110'B,
 	tiOrSkip := {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15414
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib057bd251604e9bae968e71de245b3bbf737a356
Gerrit-Change-Number: 15414
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190908/67feb6a5/attachment.htm>


More information about the gerrit-log mailing list