diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-05-27 18:12:53 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-05-27 21:31:56 +0000 |
commit | a2e0e9445752a637f04bbba986515a8b1019a6d3 (patch) | |
tree | ffdfc2a397271fc22495d65350510abc4defba7c | |
parent | 6b86b3471f964d35611d7a2a0f5849026f9fd0a6 (diff) |
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
-rw-r--r-- | bts/BTS_Tests.ttcn | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 47c16c22..2885628d 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -50,6 +50,7 @@ import from TRXC_CodecPort_CtrlFunct all; 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 @@ testcase TC_pcu_rr_suspend() runs on test_CT { 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 @@ control { 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"); } |