Change in osmo-ttcn3-hacks[master]: gbproxy: Add tests for RADIO-STATUS with TMSI and IMSI instead of TLLI

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
Mon Jan 18 17:58:34 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22250 )

Change subject: gbproxy: Add tests for RADIO-STATUS with TMSI and IMSI instead of TLLI
......................................................................

gbproxy: Add tests for RADIO-STATUS with TMSI and IMSI instead of TLLI

Change-Id: Ib3b052a12227a8f55cf063e5168b56f97b9a8f9b
Related: OS#4954
Related: OS#4951
---
M gbproxy/GBProxy_Tests.ttcn
1 file changed, 79 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved



diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index f5248aa..38e695a 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -784,6 +784,44 @@
 	}
 }
 
+/* Send 'tx' from PCU; expect 'exp_rx' on _any_ SGSN */
+friend function f_pcu2any_sgsn(template (value) PDU_BSSGP tx, template (present) PDU_BSSGP exp_rx,
+			       integer pcu_idx := 0, boolean use_sig := false)
+runs on BSSGP_ConnHdlr return integer {
+	var integer rx_idx := -1;
+	var PDU_BSSGP rx;
+	timer T := 1.0;
+
+	if (use_sig) {
+		PCU_SIG[pcu_idx].send(tx);
+	} else {
+		PCU_PTP[pcu_idx].send(tx);
+	}
+
+	T.start;
+	alt {
+	[use_sig] any from SGSN_SIG.receive(exp_rx) -> @index value rx_idx {
+		setverdict(pass);
+		}
+	[not use_sig] any from SGSN_PTP.receive(exp_rx) -> @index value rx_idx {
+		setverdict(pass);
+		}
+	[] any from SGSN_PTP.receive(PDU_BSSGP:?) -> value rx @index value rx_idx {
+		setverdict(fail, "Unexpected BSSGP on SGSN[", rx_idx, "] side: ", rx);
+		mtc.stop;
+		}
+	[] any from SGSN_SIG.receive(PDU_BSSGP:?) -> value rx @index value rx_idx {
+		setverdict(fail, "Unexpected SIG BSSGP on SGSN[", rx_idx, "] side: ", rx);
+		mtc.stop;
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", exp_rx);
+		mtc.stop;
+		}
+	}
+	return rx_idx;
+}
+
 /* Send 'tx' on PTP-BVCI from SGSN; expect 'rx' on PCU */
 friend function f_sgsn2pcu(template (value) PDU_BSSGP tx, template (present) PDU_BSSGP exp_rx,
 			   integer pcu_idx := 0, boolean use_sig := false) runs on BSSGP_ConnHdlr {
@@ -1087,6 +1125,45 @@
 	f_cleanup();
 }
 
+private function f_TC_radio_status_tmsi(charstring id) runs on BSSGP_ConnHdlr {
+	var integer i;
+	var BssgpRadioCause cause := BSSGP_RADIO_CAUSE_CONTACT_LOST;
+	for (i := 0; i < 10; i := i+1) {
+		var integer tmsi_int := oct2int(g_pars.p_tmsi);
+		var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_RADIO_STATUS(omit, cause, tmsi_int);
+		/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
+		var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_RADIO_STATUS(omit, cause, tmsi_int);
+		f_pcu2sgsn(pdu_tx, pdu_rx);
+	}
+	setverdict(pass);
+}
+testcase TC_radio_status_tmsi() runs on test_CT
+{
+	f_init();
+	f_start_handlers(refers(f_TC_radio_status_tmsi), testcasename(), 5);
+	f_cleanup();
+}
+
+private function f_TC_radio_status_imsi(charstring id) runs on BSSGP_ConnHdlr {
+	var integer i;
+	var BssgpRadioCause cause := BSSGP_RADIO_CAUSE_CONTACT_LOST;
+	for (i := 0; i < 10; i := i+1) {
+		var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_RADIO_STATUS(omit, cause, imsi := g_pars.imsi);
+		/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
+		var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_RADIO_STATUS(omit, cause, imsi := g_pars.imsi);
+		f_pcu2any_sgsn(pdu_tx, pdu_rx);
+	}
+	setverdict(pass);
+}
+testcase TC_radio_status_imsi() runs on test_CT
+{
+	f_init();
+	f_start_handlers(refers(f_TC_radio_status_imsi), testcasename(), 5);
+	f_cleanup();
+}
+
+
+
 private function f_suspend_one(integer sgsn_idx, integer nri_idx, integer pcu_idx, integer bvc_idx,
 				integer suffix)
 runs on GlobalTest_CT
@@ -2909,6 +2986,8 @@
 	execute( TC_ra_capability() );
 	execute( TC_ra_capability_upd() );
 	execute( TC_radio_status() );
+	execute( TC_radio_status_tmsi() );
+	execute( TC_radio_status_imsi() );
 	execute( TC_suspend() );
 	execute( TC_resume() );
 	execute( TC_trace() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22250
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: Ib3b052a12227a8f55cf063e5168b56f97b9a8f9b
Gerrit-Change-Number: 22250
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210118/fab29bf4/attachment.htm>


More information about the gerrit-log mailing list