From 0886215539b8f25c4d3e3a47c6bab8ce1d9a54dd Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Tue, 22 Feb 2022 13:21:49 +0100 Subject: [PATCH] msc: Avoid race condition when setting osmux options via VTY If the RAN_Emulation is started before the VTY reconfiguration we could get a BSSMAP Reset/ResetAck with Osmux support advertised even though the test expects it to be disabled (or vice versa). Do the VTY configuration before starting the RAN_Emulation. Fixes sporadic/load-related TTCN3 failures with message "BSSMAP: Timeout waiting for RESET-ACK after sending RESET" (e.g. TC_iu_and_mt_call_osmux, TC_iu_and_mo_sms in run +1567) Change-Id: Ife23f70c6523034f3c3c53b6c1c81428566fd43e --- msc/MSC_Tests.ttcn | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index db96d608c..dd31dafc4 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -304,6 +304,25 @@ function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := tr testcase.stop("excess number of BSC instances requested"); } + f_ipa_ctrl_start_client(mp_msc_ip, mp_msc_ctrl_port); + + map(self:MSCVTY, system:MSCVTY); + f_vty_set_prompts(MSCVTY); + f_vty_transceive(MSCVTY, "enable"); + + /* set some defaults */ + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + f_vty_config(MSCVTY, "msc", "check-imei-rqd 0"); + f_vty_config(MSCVTY, "network", "encryption a5 0"); + f_vty_config(MSCVTY, "cs7 instance 0", "sccp-timer ias " & int2str(g_msc_sccp_timer_ias)); + f_vty_config(MSCVTY, "cs7 instance 0", "sccp-timer iar " & int2str(g_msc_sccp_timer_iar)); + if (osmux) { + f_vty_config(MSCVTY, "msc", "osmux on"); + } else { + f_vty_config(MSCVTY, "msc", "osmux off"); + } + for (var integer i := 0; i < num_bsc; i := i + 1) { if (isbound(mp_bssap_cfg[i])) { var RanOps ranops := BSC_RanOps; @@ -315,7 +334,6 @@ function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := tr } } - f_ipa_ctrl_start_client(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); f_init_mgcp("MSC_Test"); @@ -328,22 +346,6 @@ function f_init(integer num_bsc := 1, boolean sgsap := false, boolean gsup := tr f_init_sgsap("MSC_Test"); } - map(self:MSCVTY, system:MSCVTY); - f_vty_set_prompts(MSCVTY); - f_vty_transceive(MSCVTY, "enable"); - - /* set some defaults */ - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); - f_vty_config(MSCVTY, "msc", "check-imei-rqd 0"); - f_vty_config(MSCVTY, "network", "encryption a5 0"); - f_vty_config(MSCVTY, "cs7 instance 0", "sccp-timer ias " & int2str(g_msc_sccp_timer_ias)); - f_vty_config(MSCVTY, "cs7 instance 0", "sccp-timer iar " & int2str(g_msc_sccp_timer_iar)); - if (osmux) { - f_vty_config(MSCVTY, "msc", "osmux on"); - } else { - f_vty_config(MSCVTY, "msc", "osmux off"); - } } /* Initialize for a direct connection to BSSAP. This function is an alternative