pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42577?usp=email )


Change subject: msc: ASCI: Fix race condition in TC_assign_fail
......................................................................

msc: ASCI: Fix race condition in TC_assign_fail

The f_sleep(0.5) to delay the registration of the PC for the 2nd SCCP
connection sometimes fired too late and we received the VGCS/VBS
Assignment Request before the channel ConnHdlr was registered in
RAN_Emulation.
Implement proper synchronization points to make sure the order of
registers is accomplished while making sure the 2 ConnHdlrs are
registered before they need it.

Change-Id: Id80982b6b968bbe462aeac2b9be646ab50eace83
---
M msc/MSC_Tests_ASCI.ttcn
1 file changed, 10 insertions(+), 2 deletions(-)



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

diff --git a/msc/MSC_Tests_ASCI.ttcn b/msc/MSC_Tests_ASCI.ttcn
index 135edb1..31047a6 100644
--- a/msc/MSC_Tests_ASCI.ttcn
+++ b/msc/MSC_Tests_ASCI.ttcn
@@ -76,6 +76,7 @@
 const charstring COORD_BCC_TERMINATION_FAIL := "BCC_TERMINATION_FAIL";
 const charstring COORD_ASSIGNMENT := "ASSIGNMENT";
 const charstring COORD_CLEAR := "CLEAR";
+const charstring N_CONNECT_PC_REGISTERED := "N_CONNECT_PC_REGISTERED"

 template (value) DescriptiveGroupOrBroadcastCallReference_V
                         ts_BSSMAP_IE_GroupCallRef(integer cr,
@@ -255,6 +256,7 @@
        f_init_handler(pars);

        f_create_bssmap_exp_n_connect(193);
+       COORD.send(N_CONNECT_PC_REGISTERED);

        timer T := 7.0;
        T.start;
@@ -388,8 +390,9 @@

        f_init_handler(pars);

-       /* Wait some time before registering, because this has to be the second 
connection to be registered. */
-       f_sleep(0.5);
+       /* Wait for "control" to register first (VGCS/VBS Setup), because this 
has to be the second connection to be
+        * registered (VGCS/VBS Assignment Request). */
+       COORD.receive(N_CONNECT_PC_REGISTERED);
        f_create_bssmap_exp_n_connect(193);

        timer T := 7.0;
@@ -468,6 +471,11 @@
        COORD_control.send(test);
        COORD_channel.send(test);

+       /* We need to make sure control resgisters first to receive the first 
SCCP connection (VGCS/VBS Setup)
+        * and channel later to receive the follow-up (VGCS/VBS Assignment 
Request) */
+       COORD_control.receive(N_CONNECT_PC_REGISTERED);
+       COORD_channel.send(N_CONNECT_PC_REGISTERED);
+
        /* Receive the test events until all three connections are released or 
not established. */
        timer T := 7.0, Texit := 0.5;
        T.start;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42577?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id80982b6b968bbe462aeac2b9be646ab50eace83
Gerrit-Change-Number: 42577
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to