pespin has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/78/42578/1
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index e9acddc..07e9b52 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 + * istening 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); }