Change in osmo-ttcn3-hacks[master]: gbproxy: Add test case for PAGING-PS-REJECT

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
Sat Jan 16 22:07:43 UTC 2021


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

Change subject: gbproxy: Add test case for PAGING-PS-REJECT
......................................................................

gbproxy: Add test case for PAGING-PS-REJECT

The test fail with current osmo-gbproxy master, as the related
implementation is missing.

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

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



diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 0513c02..0767331 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -1468,6 +1468,26 @@
 	f_cleanup();
 }
 
+/* Rejected PS-PAGING on PTP-BVC for BVCI (one cell) */
+testcase TC_paging_ps_reject_ptp_bvci() runs on test_CT {
+	f_init();
+	f_start_handlers(refers(f_TC_paging_ps_reject_ptp_bvci), testcasename(), 16);
+	f_cleanup();
+}
+
+/* Rejected PS-PAGING on PTP-BVC for BVCI (one cell) using IMSI only (no P-TMSI allocated) */
+private function f_TC_paging_ps_reject_ptp_bvci(charstring id) runs on BSSGP_ConnHdlr
+{
+	/* first send the PS-PAGING from SGSN -> PCU */
+	f_send_paging_ps_exp_one_bss(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, false, 0);
+	/* then simulate the PS-PAGING-REJECT from the PCU */
+	f_send_paging_ps_rej(use_sig:=false);
+}
+testcase TC_paging_ps_reject_ptp_bvci_imsi() runs on test_CT {
+	f_init();
+	f_start_handlers(refers(f_TC_paging_ps_reject_ptp_bvci), testcasename(), 16, have_ptmsi:=false);
+	f_cleanup();
+}
 
 /* PS-PAGING on PTP-BVC for unknown BVCI */
 private function f_TC_paging_ps_ptp_bvci_unknown(charstring id) runs on BSSGP_ConnHdlr
@@ -1536,6 +1556,53 @@
 	setverdict(pass);
 }
 
+/* Send PAGING-PS-REJECT on SIG BVC, expect it to arrive on the "right" SGSN */
+private function f_send_paging_ps_rej(boolean use_sig := true, integer pcu_idx := 0) runs on BSSGP_ConnHdlr
+{
+	var template (value) PDU_BSSGP pdu_tx;
+	var template (present) PDU_BSSGP exp_rx;
+	var PDU_BSSGP pdu_rx;
+	timer T := 5.0;
+	var template (omit) GsmTmsi tmsi_int := omit;
+
+	if (ispresent(g_pars.p_tmsi)) {
+		tmsi_int := oct2int(g_pars.p_tmsi);
+	}
+
+	pdu_tx := ts_BSSGP_PAGING_PS_REJ(g_pars.imsi, 23, 42, tmsi_int);
+	exp_rx := tr_BSSGP_PAGING_PS_REJ(g_pars.imsi, 23, 42, tmsi_int);
+
+	if (use_sig) {
+		PCU_SIG[pcu_idx].send(pdu_tx);
+	} else {
+		PCU_PTP[pcu_idx].send(pdu_tx);
+	}
+	T.start;
+	alt {
+	[use_sig] SGSN_SIG[g_pars.sgsn_idx].receive(exp_rx) -> value pdu_rx {
+		setverdict(pass);
+		}
+	[use_sig] SGSN_SIG[g_pars.sgsn_idx].receive {
+		setverdict(fail, "Unexpected PDU on SGSN");
+		}
+	[use_sig] any from SGSN_SIG.receive(exp_rx) -> value pdu_rx {
+		setverdict(fail, "PAGING-PS-REJECT arrived on wrong SGSN");
+		}
+	[not use_sig] SGSN_PTP[g_pars.sgsn_idx].receive(exp_rx) -> value pdu_rx {
+		setverdict(pass);
+		}
+	[not use_sig] SGSN_PTP[g_pars.sgsn_idx].receive {
+		setverdict(fail, "Unexpected PDU on SGSN");
+		}
+	[not use_sig] any from SGSN_PTP.receive(exp_rx) -> value pdu_rx {
+		setverdict(fail, "PAGING-PS-REJECT arrived on wrong SGSN");
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for PAGING-PS-REJECT");
+		}
+	}
+}
+
 /* PS-PAGING on SIG-BVC for BSS Area */
 private function f_TC_paging_ps_sig_bss(charstring id) runs on BSSGP_ConnHdlr
 {
@@ -1635,6 +1702,28 @@
 	f_cleanup();
 }
 
+/* Rejected PS-PAGING on SIG-BVC for BVCI (one cell) */
+private function f_TC_paging_ps_reject_sig_bvci(charstring id) runs on BSSGP_ConnHdlr
+{
+	/* first send the PS-PAGING from SGSN -> PCU */
+	f_send_paging_ps_exp_multi(ts_BssgpP4Bvci(pcu_bvc_cfg[0].bvci), 0, {0});
+	/* then simulate the PS-PAGING-REJECT from the PCU */
+	f_send_paging_ps_rej(use_sig:=true);
+
+}
+testcase TC_paging_ps_reject_sig_bvci() runs on test_CT {
+	f_init();
+	f_start_handlers(refers(f_TC_paging_ps_reject_sig_bvci), testcasename(), 16);
+	f_cleanup();
+}
+
+/* Rejected PS-PAGING on SIG-BVC for BVCI (one cell) using IMSI only (no P-TMSI allocated) */
+testcase TC_paging_ps_reject_sig_bvci_imsi() runs on test_CT {
+	f_init();
+	f_start_handlers(refers(f_TC_paging_ps_reject_sig_bvci), testcasename(), 16, have_ptmsi:=false);
+	f_cleanup();
+}
+
 /* PS-PAGING on SIG-BVC for unknown BVCI */
 private function f_TC_paging_ps_sig_bvci_unknown(charstring id) runs on BSSGP_ConnHdlr
 {
@@ -2482,6 +2571,8 @@
 	execute( TC_paging_ps_ptp_bvci() );
 	execute( TC_paging_ps_ptp_bvci_imsi() );
 	execute( TC_paging_ps_ptp_bvci_unknown() );
+	execute( TC_paging_ps_reject_ptp_bvci() );
+	execute( TC_paging_ps_reject_ptp_bvci_imsi() );
 
 	/* PAGING-PS over SIG BVC */
 	execute( TC_paging_ps_sig_bss() );
@@ -2492,6 +2583,8 @@
 	execute( TC_paging_ps_sig_bvci() );
 	execute( TC_paging_ps_sig_bvci_imsi() );
 	execute( TC_paging_ps_sig_bvci_unknown() );
+	execute( TC_paging_ps_reject_sig_bvci() );
+	execute( TC_paging_ps_reject_sig_bvci_imsi() );
 
 	/* PAGING-CS over PTP BVC */
 	execute( TC_paging_cs_ptp_bss() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/22243
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: I19a36dfef8f33f278a54b938a5daccce08de6fe0
Gerrit-Change-Number: 22243
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/20210116/353ef4ed/attachment.htm>


More information about the gerrit-log mailing list