pespin has submitted this change. ( 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.
Then in turn we need to delay call establishment until the channel is
ready.
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, 22 insertions(+), 3 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
jolly: Looks good to me, but someone else must approve
diff --git a/msc/MSC_Tests_ASCI.ttcn b/msc/MSC_Tests_ASCI.ttcn
index 135edb1..9abcc28 100644
--- a/msc/MSC_Tests_ASCI.ttcn
+++ b/msc/MSC_Tests_ASCI.ttcn
@@ -76,6 +76,8 @@
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"
+const charstring N_CALL_ESTABLISH := "N_CALL_ESTABLISH"
template (value) DescriptiveGroupOrBroadcastCallReference_V
ts_BSSMAP_IE_GroupCallRef(integer cr,
@@ -143,6 +145,9 @@
var default mdcx := activate(as_optional_mgcp_mdcx(cpars.mgw_conn_2.mgw_rtp_ip, cpars.mgw_conn_2.mgw_rtp_port));
var default dlcx := activate(as_optional_mgcp_dlcx(cpars));
+ /* Wait for other components to be prepared for the call: */
+ COORD.receive(N_CALL_ESTABLISH);
+
/* Establish connection using the service type, defined by the test. */
if (test == COORD_TEST_COMPLETE_VBS) {
f_establish_fully(EST_TYPE_VBS);
@@ -255,6 +260,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,9 +394,12 @@
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);
+ /* informwe applied the expect and we are ready: */
+ COORD.send(N_CONNECT_PC_REGISTERED);
timer T := 7.0;
T.start;
@@ -464,9 +473,19 @@
connect(self:COORD_control, vc_conn_control:COORD);
connect(self:COORD_channel, vc_conn_channel:COORD);
+ COORD_channel.send(test);
COORD_call.send(test);
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);
+ /* channel confirms it is also applied on its side: */
+ COORD_channel.receive(N_CONNECT_PC_REGISTERED);
+
+ /* Inform we we can start the call: */
+ COORD_call.send(N_CALL_ESTABLISH);
/* Receive the test events until all three connections are released or not established. */
timer T := 7.0, Texit := 0.5;
--
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: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id80982b6b968bbe462aeac2b9be646ab50eace83
Gerrit-Change-Number: 42577
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, osmith, pespin.
Hello Jenkins Builder, fixeria, jolly, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42577?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by osmith, Verified+1 by Jenkins Builder
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.
Then in turn we need to delay call establishment until the channel is
ready.
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, 22 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/77/42577/2
--
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: newpatchset
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id80982b6b968bbe462aeac2b9be646ab50eace83
Gerrit-Change-Number: 42577
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42578?usp=email )
Change subject: msc: Fix race condition in TC_reset_two(_1iu)
......................................................................
msc: Fix race condition in TC_reset_two(_1iu)
The test failed sporadically with:
"RAN_Emulation.ttcnpp:600 Dynamic test case error: Sending data on the
connection of port BSSAP to 659:SCCP_SP_PORT failed. (Broken pipe)"
That's because it was simply waiting for a fixed amount of time while
letting the underlaying RAN_Emulation do the RESET procedure.
Sometimes it started tearing down the test before the procedure was
fully completed, and RAN_Emulation failed passing the Reset (ACK) up the
stack because the component was already unmapped.
Fix the issue by making sure the RAN_Emulation finished the RESET
procedure before stopping the testThe test.
Change-Id: I27afd7a47e6c6cf0f70e1ecc9e26dd2c220e72ab
---
M msc/MSC_Tests.ttcn
1 file changed, 17 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
jolly: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index e9acddc..6d5b5ba 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -2407,10 +2407,20 @@
}
/* Two BSSMAP resets from two different BSCs */
+private function f_tc_reset_two(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+ f_init_handler(pars);
+ /* BSSAP Reset is performed by RAN_Emulation during its startup (main()).
+ * Simply do some query on RAN_Emulation to make sure it finished properly and hence it's
+ * listening to events: */
+ f_ran_register_imsi(g_pars.imsi, g_pars.tmsi);
+}
testcase TC_reset_two() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
f_init(2);
- f_sleep(2.0);
+ vc_conn := f_start_handler(refers(f_tc_reset_two), 420, ran_idx := 0);
+ vc_conn.done;
+ vc_conn := f_start_handler(refers(f_tc_reset_two), 420, ran_idx := 1);
+ vc_conn.done;
setverdict(pass);
}
@@ -2418,7 +2428,12 @@
testcase TC_reset_two_1iu() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
f_init(3);
- f_sleep(2.0);
+ vc_conn := f_start_handler(refers(f_tc_reset_two), 421, ran_idx := 0);
+ vc_conn.done;
+ vc_conn := f_start_handler(refers(f_tc_reset_two), 421, ran_idx := 1);
+ vc_conn.done;
+ vc_conn := f_start_handler(refers(f_tc_reset_two), 421, ran_idx := 2);
+ vc_conn.done;
setverdict(pass);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42578?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I27afd7a47e6c6cf0f70e1ecc9e26dd2c220e72ab
Gerrit-Change-Number: 42578
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>