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

Change subject: bts: Verify PCU socket can disconnect + re-connect
......................................................................

bts: Verify PCU socket can disconnect + re-connect

Change-Id: Ic69c3f34405012d42319bd9752f875071aae2243
Related: OS#4023
---
M bts/BTS_Tests.ttcn
M library/PCUIF_CodecPort.ttcn
2 files 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 2885628..6786d68 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -3921,6 +3921,26 @@
        Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }

+/* Ensure that PCUIF socket can disconnect + reconnect */
+testcase TC_pcu_socket_reconnect() runs on test_CT {
+       /* this (among other things) establishes the first connection to the 
PCUIF socket */
+       f_init();
+
+       f_sleep(1.0);
+
+       f_pcuif_close(PCU, g_pcu_conn_id);
+       g_pcu_conn_id := -1;
+
+       f_sleep(1.0);
+
+       /* re-connect */
+       PCU.clear;
+       f_init_pcu(PCU, testcasename(), g_pcu_conn_id, g_pcu_last_info);
+       setverdict(pass);
+
+       Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
+}
+

 /***********************************************************************
  * Osmocom Style Dynamic Timeslot Support
@@ -5230,6 +5250,7 @@
                execute( TC_pcu_oml_alert() );
                execute( TC_pcu_rr_suspend() );
                execute( TC_pcu_socket_connect_multi() );
+               execute( TC_pcu_socket_reconnect() );
        } else {
                log("PCU socket path not available, skipping PCU tests");
        }
diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn
index 91f9bf9..3d6ceac 100644
--- a/library/PCUIF_CodecPort.ttcn
+++ b/library/PCUIF_CodecPort.ttcn
@@ -94,6 +94,11 @@
        return -23;
 }

+function f_pcuif_close(PCUIF_CODEC_PT pt, integer id)
+{
+       pt.send(UD_close:{id := id});
+}
+
 function f_pcuif_listen(PCUIF_CODEC_PT pt, charstring sock) return integer {
        var UD_listen_result res;
        var UD_connected udc;

--
To view, visit https://gerrit.osmocom.org/14209
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: Ic69c3f34405012d42319bd9752f875071aae2243
Gerrit-Change-Number: 14209
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)

Reply via email to