[MERGED] osmo-ttcn3-hacks[master]: BSC_Tests: try to avoid race condition

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Feb 28 09:45:33 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: BSC_Tests: try to avoid race condition
......................................................................


BSC_Tests: try to avoid race condition

When the test component ends and the underlaying
components are shut down. Messages from the system
under test may still be picked up and forwared. When
a message is handed from one component to one that
is already shut down, the testcase is flagged as
errornous setverdict(error).

An idea to fix thisis to stop all test ports using
all port.stop. However, this does not solve the
problem entirely. We still observing errors.

- add f_shutdown_helper() and call it from the
  end of each testcase

- perform an all port.stop; in f_shutdown_helper()
  to freeze all communications between the ports
  of the different components.

Change-Id: Id3bc840c0428d08dfbeedacc408b3dd1cd0fa7ec
---
M bsc/BSC_Tests.ttcn
1 file changed, 27 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index d94faad..8d397f7 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -107,6 +107,11 @@
 	};
 }
 
+private function f_shutdown_helper() runs on test_CT {
+	all port.stop;
+	setverdict(pass);
+}
+
 private function f_legacy_bssap_reset() runs on test_CT {
 	var BSSAP_N_UNITDATA_ind ud_ind;
 	timer T := 5.0;
@@ -1011,6 +1016,7 @@
 	var BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := valueof(ts_BSSMAP_CIL_noCell);
 	f_pageing_helper('001010100000001'H, cid_list, c_BtsId_all, omit, omit);
+	f_shutdown_helper();
 }
 
 /* PAGING by IMSI + TMSI */
@@ -1018,6 +1024,7 @@
 	var BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := valueof(ts_BSSMAP_CIL_noCell);
 	f_pageing_helper('001010100000001'H, cid_list, c_BtsId_all, omit, 'A1B2C301'O);
+	f_shutdown_helper();
 }
 
 /* Paging with different "channel needed' values */
@@ -1025,21 +1032,25 @@
 	var BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := valueof(ts_BSSMAP_CIL_noCell);
 	f_pageing_helper('001010100000002'H, cid_list, c_BtsId_all, RSL_CHANNEED_ANY, 'A1B2C302'O);
+	f_shutdown_helper();
 }
 testcase TC_paging_tmsi_sdcch() runs on test_CT {
 	var BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := valueof(ts_BSSMAP_CIL_noCell);
 	f_pageing_helper('001010100000003'H, cid_list, c_BtsId_all, RSL_CHANNEED_SDCCH, 'A1B2C303'O);
+	f_shutdown_helper();
 }
 testcase TC_paging_tmsi_tch_f() runs on test_CT {
 	var BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := valueof(ts_BSSMAP_CIL_noCell);
 	f_pageing_helper('001010000000004'H, cid_list, c_BtsId_all, RSL_CHANNEED_TCH_F, 'A1B2C304'O);
+	f_shutdown_helper();
 }
 testcase TC_paging_tmsi_tch_hf() runs on test_CT {
 	var BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := valueof(ts_BSSMAP_CIL_noCell);
 	f_pageing_helper('001010000000005'H, cid_list, c_BtsId_all, RSL_CHANNEED_TCH_ForH, 'A1B2C305'O);
+	f_shutdown_helper();
 }
 
 /* Paging by CGI */
@@ -1047,6 +1058,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_CGI := { ts_BSSMAP_CI_CGI(cid.mcc, cid.mnc, cid.lac, cid.ci) } };
 	f_pageing_helper('001010000000006'H, cid_list, { 0 });
+	f_shutdown_helper();
 }
 
 /* Paging by LAC+CI */
@@ -1054,6 +1066,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_LAC_CI := { ts_BSSMAP_CI_LAC_CI(cid.lac, cid.ci) } };
 	f_pageing_helper('001010000000007'H, cid_list, { 0 });
+	f_shutdown_helper();
 }
 
 /* Paging by CI */
@@ -1061,6 +1074,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_CI := { ts_BSSMAP_CI_CI(cid.ci) } };
 	f_pageing_helper('001010000000008'H, cid_list, { 0 });
+	f_shutdown_helper();
 }
 
 /* Paging by LAI */
@@ -1068,6 +1082,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_LAI := { ts_BSSMAP_CI_LAI(cid.mcc, cid.mnc, cid.lac) } };
 	f_pageing_helper('001010000000009'H, cid_list, c_BtsId_LAC1);
+	f_shutdown_helper();
 }
 
 /* Paging by LAC */
@@ -1075,6 +1090,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(cid.lac) } };
 	f_pageing_helper('001010000000010'H, cid_list, c_BtsId_LAC1);
+	f_shutdown_helper();
 }
 
 /* Paging by "all in BSS" */
@@ -1082,6 +1098,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_allInBSS := ''O };
 	f_pageing_helper('001010000000011'H, cid_list, c_BtsId_all);
+	f_shutdown_helper();
 }
 
 /* Paging by PLMN+LAC+RNC */
@@ -1089,6 +1106,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } };
 	f_pageing_helper('001010000000012'H, cid_list, c_BtsId_all);
+	f_shutdown_helper();
 }
 
 /* Paging by RNC */
@@ -1096,6 +1114,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_RNC := { int2oct(13, 2) } };
 	f_pageing_helper('001010000000013'H, cid_list, c_BtsId_all);
+	f_shutdown_helper();
 }
 
 /* Paging by LAC+RNC */
@@ -1103,6 +1122,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } };
 	f_pageing_helper('001010000000014'H, cid_list, c_BtsId_all);
+	f_shutdown_helper();
 }
 
 /* Paging on multiple cells (multiple entries in list): Verify all of them page */
@@ -1110,6 +1130,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(1), ts_BSSMAP_CI_LAC(2) } };
 	f_pageing_helper('001010000000015'H, cid_list, c_BtsId_all);
+	f_shutdown_helper();
 }
 
 /* Paging on empty list: Verify none of them page */
@@ -1117,6 +1138,7 @@
 	var template BSSMAP_FIELD_CellIdentificationList cid_list;
 	cid_list := { cIl_LAC := { } };
 	f_pageing_helper('001010000000016'H, cid_list, c_BtsId_none);
+	f_shutdown_helper();
 }
 
 /* Verify paging retransmission interval + count */
@@ -1145,6 +1167,8 @@
 		setverdict(pass);
 		}
 	}
+
+	f_shutdown_helper();
 }
 
 /* Verify Paging Counter */
@@ -1181,8 +1205,8 @@
 		f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", i, "paging:expired",
 						paging_expired_bts[i]+1);
 	}
-	setverdict(pass);
 
+	f_shutdown_helper();
 }
 
 
@@ -1224,6 +1248,8 @@
 		setverdict(pass);
 		}
 	}
+
+	f_shutdown_helper();
 }
 
 /* Test RSL link drop causes counter increment */

-- 
To view, visit https://gerrit.osmocom.org/6968
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id3bc840c0428d08dfbeedacc408b3dd1cd0fa7ec
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list