Change in osmo-ttcn3-hacks[master]: bts: Add test ensuring only one connection to PCU interface accepted

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
Mon May 27 21:31:57 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/14208 )

Change subject: bts: Add test ensuring only one connection to PCU interface accepted
......................................................................

bts: Add test ensuring only one connection to PCU interface accepted

This adds TC_pcu_socket_connect_multi, which verifies that a second
connection to the PCU Intrerface socket is denied while the first
connection is still established.

Change-Id: Ib484a0a39e719cb2ce00a9464fc1207357ec9e93
Related: OS#4023
---
M bts/BTS_Tests.ttcn
1 file changed, 26 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 47c16c2..2885628 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -50,6 +50,7 @@
 
 import from PCUIF_Types all;
 import from PCUIF_CodecPort all;
+import from UD_Types all;
 
 import from MobileL3_CommonIE_Types all;
 import from MobileL3_RRM_Types all;
@@ -3896,6 +3897,30 @@
 	vc_conn.done;
 }
 
+/* Ensure that PCUIF socket can accept only a single connection */
+testcase TC_pcu_socket_connect_multi() runs on test_CT {
+	timer T := 5.0;
+
+	/* this (among other things) establishes the first connection to the PCUIF socket */
+	f_init();
+
+	/* try to establish a second connection, expect it to fail */
+	PCU.send(UD_connect:{mp_pcu_socket, -1});
+	T.start;
+	alt {
+	[] PCU.receive(UD_connect_result:{id := ?, result := { result_code := ERROR, err := ? }}) {
+		setverdict(pass);
+		}
+	[] PCU.receive(UD_connect_result:?) {
+		setverdict(fail, "Unexpected unix domain connect result");
+		}
+	[] T.timeout {
+		setverdict(pass);
+		}
+	}
+	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+
 
 /***********************************************************************
  * Osmocom Style Dynamic Timeslot Support
@@ -5204,6 +5229,7 @@
 		execute( TC_pcu_rts_req() );
 		execute( TC_pcu_oml_alert() );
 		execute( TC_pcu_rr_suspend() );
+		execute( TC_pcu_socket_connect_multi() );
 	} else {
 		log("PCU socket path not available, skipping PCU tests");
 	}

-- 
To view, visit https://gerrit.osmocom.org/14208
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib484a0a39e719cb2ce00a9464fc1207357ec9e93
Gerrit-Change-Number: 14208
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190527/5d5dc450/attachment.htm>


More information about the gerrit-log mailing list