Change in osmo-ttcn3-hacks[master]: gbproxy: Port TC_suspend to new GLOBAL port

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
Tue Nov 24 18:06:44 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21325 )


Change subject: gbproxy: Port TC_suspend to new GLOBAL port
......................................................................

gbproxy: Port TC_suspend to new GLOBAL port

With the previous commit, we change the processing of the SUSPEND/RESUME
related PDUs and handle them now via a new per-NSE "GLOBAL" port.

Change-Id: I805372f3024a0ec2491a24422e02c0bc6dc669d2
---
M gbproxy/GBProxy_Tests.ttcn
1 file changed, 75 insertions(+), 16 deletions(-)



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

diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 2ce85a4..e7468aa 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -788,42 +788,101 @@
 	f_cleanup();
 }
 
-private function f_TC_suspend(charstring id) runs on BSSGP_ConnHdlr {
+private function f_TC_suspend(charstring id) runs on GlobalTest_CT {
 	var integer i;
 
 	/* TODO: Generate RA ID for each ConnHdlr */
-	var RoutingAreaIdentification	ra_id := g_pars.pcu[0].cfg.bvc[0].cell_id.ra_id;
+	var RoutingAreaIdentification	ra_id := g_pcu[0].cfg.bvc[0].cell_id.ra_id;
 	for (i := 0; i < 10; i := i+1) {
-
-		var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_SUSPEND(g_pars.tlli, ra_id);
+		var OCT4 tlli := f_gprs_tlli_random();
+		var template (value) PDU_BSSGP pdu_tx := ts_BSSGP_SUSPEND(tlli, ra_id);
 		/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
-		var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_SUSPEND(g_pars.tlli, ra_id);
+		var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_SUSPEND(tlli, ra_id);
 
-		f_pcu2sgsn(pdu_tx, pdu_rx);
+		f_global_pcu2sgsn(pdu_tx, pdu_rx);
 
-		pdu_tx := ts_BSSGP_SUSPEND_ACK(g_pars.tlli, ra_id, int2oct(i, 1));
+		pdu_tx := ts_BSSGP_SUSPEND_ACK(tlli, ra_id, int2oct(i, 1));
 		/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
-		pdu_rx := tr_BSSGP_SUSPEND_ACK(g_pars.tlli, ra_id, int2oct(i, 1));
+		pdu_rx := tr_BSSGP_SUSPEND_ACK(tlli, ra_id, int2oct(i, 1));
 
-		f_sgsn2pcu(pdu_tx, pdu_rx);
+		f_global_sgsn2pcu(pdu_tx, pdu_rx);
 
 		/* These messages are simple passed through so just also test sending NACK */
-		pdu_tx := ts_BSSGP_SUSPEND_NACK(g_pars.tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS);
+		pdu_tx := ts_BSSGP_SUSPEND_NACK(tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS);
 		/* we cannot use pdu_tx as there are some subtle differences in the length field :/ */
-		pdu_rx := tr_BSSGP_SUSPEND_NACK(g_pars.tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS);
+		pdu_rx := tr_BSSGP_SUSPEND_NACK(tlli, ra_id, BSSGP_CAUSE_UNKNOWN_MS);
 
-		f_sgsn2pcu(pdu_tx, pdu_rx);
+		f_global_sgsn2pcu(pdu_tx, pdu_rx);
 	}
 	setverdict(pass);
 }
-testcase TC_suspend() runs on test_CT
+
+type component GlobalTest_CT extends test_CT {
+	port BSSGP_PT G_PCU[NUM_PCU];
+	port BSSGP_PT G_SGSN[NUM_SGSN];
+};
+
+/* Send 'tx' on PTP-BVCI from PCU; expect 'rx' on SGSN */
+friend function f_global_pcu2sgsn(template (value) PDU_BSSGP tx, template (present) PDU_BSSGP exp_rx,
+				  integer pcu_idx := 0, integer sgsn_idx := 0) runs on GlobalTest_CT {
+	var PDU_BSSGP rx;
+	timer T := 1.0;
+
+	G_PCU[pcu_idx].send(tx);
+	T.start;
+	alt {
+	[] G_SGSN[sgsn_idx].receive(exp_rx) {
+		setverdict(pass);
+		}
+	[] G_SGSN[sgsn_idx].receive(PDU_BSSGP:?) -> value rx {
+		setverdict(fail, "Unexpected BSSGP on SGSN side: ", rx);
+		mtc.stop;
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for BSSGP on SGSN side: ", rx);
+		mtc.stop;
+		}
+	}
+}
+
+/* Send 'tx' on PTP-BVCI from SGSN; expect 'rx' on PCU */
+friend function f_global_sgsn2pcu(template (value) PDU_BSSGP tx, template (present) PDU_BSSGP exp_rx,
+				  integer sgsn_idx := 0, integer pcu_idx := 0) runs on GlobalTest_CT {
+	var PDU_BSSGP rx;
+	timer T := 1.0;
+
+	G_SGSN[sgsn_idx].send(tx);
+	T.start;
+	alt {
+	[] G_PCU[pcu_idx].receive(exp_rx) {
+		setverdict(pass);
+		}
+	[] G_PCU[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
+		setverdict(fail, "Unexpected BSSGP on PCU side: ", rx);
+		mtc.stop;
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for BSSGP on PCU side: ", rx);
+		mtc.stop;
+		}
+	}
+}
+
+testcase TC_suspend() runs on GlobalTest_CT
 {
 	var BSSGP_ConnHdlr vc_conn;
+	var integer i;
+
 	f_init();
 
-	vc_conn := f_start_handler(refers(f_TC_suspend), testcasename(), g_pcu, g_sgsn, 6);
-	vc_conn.done;
-	/* TODO: start multiple handlers (UEs) on various cells on same and other NSEs */
+	for (i := 0; i < lengthof(g_sgsn); i := i+1) {
+		connect(self:G_SGSN[i], g_sgsn[i].vc_BSSGP:GLOBAL);
+	}
+	for (i := 0; i < lengthof(g_pcu); i := i+1) {
+		connect(self:G_PCU[i], g_pcu[i].vc_BSSGP:GLOBAL);
+	}
+
+	f_TC_suspend(testcasename())
 
 	f_cleanup();
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21325
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: I805372f3024a0ec2491a24422e02c0bc6dc669d2
Gerrit-Change-Number: 21325
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201124/82844904/attachment.htm>


More information about the gerrit-log mailing list