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

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon May 27 16:25:25 UTC 2019


Harald Welte has uploaded this change for review. ( 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(-)



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

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: newchange
Gerrit-Change-Id: Ib484a0a39e719cb2ce00a9464fc1207357ec9e93
Gerrit-Change-Number: 14208
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190527/4daf9719/attachment.html>


More information about the gerrit-log mailing list