[MERGED] osmo-ttcn3-hacks[master]: msc: Add tests for HLR SAI timeout and HLR SAI error

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Jan 24 21:59:48 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: msc: Add tests for HLR SAI timeout and HLR SAI error
......................................................................


msc: Add tests for HLR SAI timeout and HLR SAI error

Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367
---
M library/GSUP_Types.ttcn
M msc_tests/MSC_Tests.ttcn
2 files changed, 75 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn
index bc54510..15560c7 100644
--- a/library/GSUP_Types.ttcn
+++ b/library/GSUP_Types.ttcn
@@ -192,9 +192,14 @@
 		valueof(ts_GSUP_IE_IMSI(imsi)), auth_tuple });
 
 template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) :=
-	tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, {
+	tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, {
 			tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) });
 
+template GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) :=
+	tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, {
+			ts_GSUP_IE_IMSI(imsi), ts_GSUP_IE_Cause(cause) });
+
+
 template GSUP_PDU tr_GSUP_SAI_RES(template hexstring imsi) :=
 	tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, {
 			tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * });
diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn
index 15ffc20..9f8dd69 100644
--- a/msc_tests/MSC_Tests.ttcn
+++ b/msc_tests/MSC_Tests.ttcn
@@ -518,7 +518,73 @@
 	var BSC_ConnHdlr vc_conn;
 	f_init();
 
-	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 1);
+	vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6);
+	vc_conn.done;
+}
+
+/* Test LU (with authentication enabled), where HLR times out sending SAI response */
+private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	g_pars := pars;
+
+	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
+	var PDU_DTAP_MT dtap_mt;
+
+	/* tell GSUP dispatcher to send this IMSI to us */
+	f_create_gsup_expect(hex2str(g_pars.imsi));
+
+	/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
+	f_bssap_compl_l3(l3_lu);
+
+	/* Send Early Classmark, just for the fun of it */
+	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+
+	GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi));
+	/* The HLR would normally return an auth vector here, but we fail to do so. */
+
+	BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej));
+	BSSAP.receive(tr_BSSMAP_ClearCommand);
+	BSSAP.send(ts_BSSMAP_ClearComplete);
+	BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND);
+	setverdict(pass);
+}
+testcase TC_lu_auth_sai_timeout() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+
+	vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7);
+	vc_conn.done;
+}
+
+/* Test LU (with authentication enabled), where HLR rejects sending SAI error */
+private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	g_pars := pars;
+
+	var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi)
+	var PDU_DTAP_MT dtap_mt;
+
+	/* tell GSUP dispatcher to send this IMSI to us */
+	f_create_gsup_expect(hex2str(g_pars.imsi));
+
+	/* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */
+	f_bssap_compl_l3(l3_lu);
+
+	/* Send Early Classmark, just for the fun of it */
+	BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3));
+
+	GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi));
+	GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13));
+
+	BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej));
+	BSSAP.receive(tr_BSSMAP_ClearCommand);
+	BSSAP.send(ts_BSSMAP_ClearComplete);
+	BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND);
+	setverdict(pass);
+}
+testcase TC_lu_auth_sai_err() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+
+	vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8);
 	vc_conn.done;
 }
 
@@ -531,6 +597,8 @@
 	execute( TC_lu_imsi_reject() );
 	execute( TC_lu_imsi_timeout_gsup() );
 	execute( TC_lu_and_mo_call() );
+	execute( TC_lu_auth_sai_timeout() );
+	execute( TC_lu_auth_sai_err() );
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/6026
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list