[PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_gsup_cancel testing GSUP Location Cancel

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
Sat Jan 27 18:00:19 UTC 2018


Review at  https://gerrit.osmocom.org/6137

msc: Add TC_gsup_cancel testing GSUP Location Cancel

Related: OS#2886
Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4
---
M library/GSUP_Types.ttcn
M msc_tests/MSC_Tests.ttcn
2 files changed, 69 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/6137/1

diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn
index 1e28ffe..fda9549 100644
--- a/library/GSUP_Types.ttcn
+++ b/library/GSUP_Types.ttcn
@@ -275,6 +275,29 @@
 template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) :=
 	tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi);
 
+template (value) GSUP_PDU ts_GSUP_CL_REQ(hexstring imsi, GSUP_CancelType ctype) :=
+	ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST, {
+		valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_CancelType(ctype)) });
+
+template GSUP_PDU tr_GSUP_CL_RES(template hexstring imsi) :=
+	tr_GSUP_IMSI(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, imsi);
+
+template GSUP_PDU tr_GSUP_CL_ERR(template hexstring imsi, template integer cause := ?) :=
+	tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, {
+			tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) });
+
+
+template (value) GSUP_IE ts_GSUP_IE_CancelType(GSUP_CancelType ctype) := {
+	tag := OSMO_GSUP_CANCEL_TYPE_IE,
+	len := 0, /* overwritten */
+	val := {
+		cancel_type := ctype
+	}
+}
+
+template GSUP_IE tr_GSUP_IE_CancelType(template GSUP_CancelType ctype) :=
+	tr_GSUP_IE(OSMO_GSUP_CANCEL_TYPE_IE, GSUP_IeValue:{cancel_type:=ctype});
+
 template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := {
 	tag := iei,
 	len := ?,
diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn
index 9ac715b..c8ac429 100644
--- a/msc_tests/MSC_Tests.ttcn
+++ b/msc_tests/MSC_Tests.ttcn
@@ -1375,6 +1375,51 @@
 	vc_conn.done;
 }
 
+/* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */
+private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	f_init_handler(pars);
+	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
+	cpars.bss_rtp_port := 1110;
+	cpars.mgcp_connection_id_bss := '22222'H;
+	cpars.mgcp_connection_id_mss := '33333'H;
+
+	/* Location Update to make subscriber known */
+	f_perform_lu(cpars.expect_auth, true, true);
+
+	/* First MO call should succeed */
+	f_mo_call(cpars);
+
+	/* Cancel the subscriber in the VLR */
+	GSUP.send(ts_GSUP_CL_REQ(g_pars.imsi, OSMO_GSUP_CANCEL_TYPE_WITHDRAW));
+	alt {
+	[] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { }
+	[] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) {
+		setverdict(fail, "Received GSUP Location Cancel Error");
+		self.stop;
+		}
+	}
+
+	/* Follow-up transactions should fail */
+	var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+	var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi));
+	f_bssap_compl_l3(l3_info);
+	alt {
+	[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { }
+	[] BSSAP.receive {
+		setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ");
+		self.stop;
+		}
+	}
+	setverdict(pass);
+}
+testcase TC_gsup_cancel() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+
+	vc_conn := f_start_handler(refers(f_tc_gsup_cancel), testcasename(), 31);
+	vc_conn.done;
+}
+
 
 
 /* TODO:
@@ -1423,6 +1468,7 @@
 	execute( TC_mo_crcx_ran_reject() );
 	execute( TC_mt_crcx_ran_reject() );
 	execute( TC_mt_t310() );
+	execute( TC_gsup_cancel() );
 }
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list