Change in osmo-ttcn3-hacks[master]: gbproxy: Use BSSGP MGMT port to determine when all BVC are unblocked

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

daniel gerrit-no-reply at lists.osmocom.org
Mon Nov 16 19:15:52 UTC 2020


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

Change subject: gbproxy: Use BSSGP MGMT port to determine when all BVC are unblocked
......................................................................

gbproxy: Use BSSGP MGMT port to determine when all BVC are unblocked

Change-Id: I9c94aa4b4891e8a79bca62f4fd713e4ad50f9424
---
M gbproxy/GBProxy_Tests.ttcn
1 file changed, 65 insertions(+), 0 deletions(-)

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



diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn
index 64827aa..81c55b5 100644
--- a/gbproxy/GBProxy_Tests.ttcn
+++ b/gbproxy/GBProxy_Tests.ttcn
@@ -209,6 +209,9 @@
 
 	port BSSGP_CT_PROC_PT PROC;
 
+	port BSSGP_BVC_MGMT_PT SGSN_MGMT;
+	port BSSGP_BVC_MGMT_PT PCU_MGMT;
+
 	port TELNETasp_PT GBPVTY;
 
 	var boolean g_initialized := false;
@@ -284,6 +287,7 @@
 		connect(self:PROC, gb.vc_BSSGP:PROC);
 		gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC);
 		disconnect(self:PROC, gb.vc_BSSGP:PROC);
+		connect(self:PCU_MGMT, gb.vc_BSSGP_BVC[i]:MGMT);
 	}
 }
 
@@ -302,6 +306,7 @@
 		connect(self:PROC, gb.vc_BSSGP:PROC);
 		gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC);
 		disconnect(self:PROC, gb.vc_BSSGP:PROC);
+		connect(self:SGSN_MGMT, gb.vc_BSSGP_BVC[i]:MGMT);
 	}
 }
 
@@ -312,7 +317,20 @@
 	f_vty_transceive(GBPVTY, "enable");
 }
 
+type record of integer ro_integer;
+
+private function ro_integer_contains(ro_integer r, integer x) return boolean {
+	for (var integer j := 0; j < lengthof(r); j := j+1) {
+		if (r[j] == x) {
+			return true;
+		}
+	}
+	return false;
+}
+
 function f_init() runs on test_CT {
+	var ro_integer bvci_unblocked := {};
+	var BssgpStatusIndication bsi;
 	var integer i;
 
 	if (g_initialized == true) {
@@ -339,6 +357,53 @@
 	for (i := 0; i < lengthof(mp_nsconfig_pcu); i := i+1) {
 		f_init_gb_pcu(g_pcu[i], "GbProxy_Test", i);
 	}
+
+	/* wait until all BVC are unblocked on both sides */
+	timer T := 5.0;
+	T.start;
+	alt {
+	[] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> value bsi {
+		bvci_unblocked := bvci_unblocked & { bsi.bvci };
+		if (lengthof(bvci_unblocked) != lengthof(g_sgsn[0].cfg.bvc)) {
+			repeat;
+			}
+		}
+	[] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) {
+		repeat;
+		}
+	[] SGSN_MGMT.receive {
+		setverdict(fail, "Received unexpected message on SGSN_MGMT");
+		mtc.stop;
+		}
+
+	[] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, BVC_S_UNBLOCKED}) -> value bsi {
+		repeat;
+		}
+	[] PCU_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) {
+		repeat;
+		}
+	[] PCU_MGMT.receive(BssgpResetIndication:{0}) {
+		repeat;
+		}
+	[] PCU_MGMT.receive {
+		setverdict(fail, "Received unexpected message on PCU_MGMT");
+		mtc.stop;
+		}
+
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for unblock of all BVCs");
+		mtc.stop;
+		}
+	}
+
+	/* iterate over list and check all BVCI */
+	for (i := 0; i < lengthof(g_sgsn[0].cfg.bvc); i := i+1) {
+		var BssgpBvci bvci := g_sgsn[0].cfg.bvc[i].bvci;
+		if (not ro_integer_contains(bvci_unblocked, bvci)) {
+			setverdict(fail, "BVCI=", bvci, " was not unblocked during start-up");
+			mtc.stop;
+		}
+	}
 }
 
 function f_cleanup() runs on test_CT {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21170
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: I9c94aa4b4891e8a79bca62f4fd713e4ad50f9424
Gerrit-Change-Number: 21170
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
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/20201116/7d1b2a36/attachment.htm>


More information about the gerrit-log mailing list