Change in osmo-ttcn3-hacks[master]: BTS_Tests: extend rach content tests with emergency call

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/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Jul 9 12:40:26 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19198 )

Change subject: BTS_Tests: extend rach content tests with emergency call
......................................................................

BTS_Tests: extend rach content tests with emergency call

The testcase tests if a CHANNEL REQUEST on the RACH leads to the correct
CHANNEL REQUIRED message on RSL level. When a MS is sending a CHANNEL
REQUEST to establish an emergency call, it uses a slightly different
layout for the request reference (RA). Lets add another similar testcase
(TC_rach_content_emerg) to cover the emergency call situation as well.

Change-Id: Ie5b7af3e93efaa6d0b412d3b1c77bc9514424f52
Related: OS#4549
---
M bts/BTS_Tests.ttcn
1 file changed, 35 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1ff0c61..587e14a 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -1296,6 +1296,14 @@
 	return false;
 }
 
+private function ra_is_emerg(OCT1 ra) return boolean {
+	/* See also: 3GPP TS 04.08, Table 9.9, ra=101xxxxx */
+	if ((ra and4b 'E0'O == 'A0'O) and (ra and4b '1F'O != '1F'O)) {
+		return true;
+	}
+	return false;
+}
+
 /* generate a random RACH for circuit-switched */
 private function f_rnd_ra_cs() return OCT1 {
 	var OCT1 ra;
@@ -1305,6 +1313,15 @@
 	return ra;
 }
 
+/* generate a random RACH for emergency */
+private function f_rnd_ra_emerg() return OCT1 {
+	var OCT1 ra;
+	do {
+		ra := f_rnd_octstring(1);
+	} while (not ra_is_emerg(ra));
+	return ra;
+}
+
 /* generate a random RACH for packet-switched */
 private function f_rnd_ra_ps() return OCT1 {
 	var OCT1 ra;
@@ -1321,7 +1338,7 @@
 }
 
 /* Send 1000 RACH requests and check their RA+FN on the RSL side */
-testcase TC_rach_content() runs on test_CT {
+private function f_TC_rach_content(boolean emerg) runs on test_CT {
 	f_init();
 	f_init_l1ctl();
 	f_l1_tune(L1CTL);
@@ -1329,7 +1346,12 @@
 	var GsmFrameNumber fn_last := 0;
 	var boolean test_failed := false;
 	for (var integer i := 0; i < 1000; i := i+1) {
-		var OCT1 ra := f_rnd_ra_cs();
+		var OCT1 ra := f_rnd_ra_emerg();
+		if (emerg == true) {
+			ra := f_rnd_ra_emerg();
+		} else {
+			ra := f_rnd_ra_cs();
+		}
 		var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra));
 		if (fn == fn_last) {
 			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Two RACH in same FN?!?");
@@ -1359,6 +1381,16 @@
 	Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
 }
 
+/* Normal variant */
+testcase TC_rach_content() runs on test_CT {
+	 f_TC_rach_content(emerg := false);
+}
+
+/* Emergency call variant */
+testcase TC_rach_content_emerg() runs on test_CT {
+	 f_TC_rach_content(emerg := true);
+}
+
 /* Send 1000 RACH Requests (flood ~ 89/s) and count if count(Abis) == count(Um) */
 testcase TC_rach_count() runs on test_CT {
 	f_init();
@@ -6683,6 +6715,7 @@
 	execute( TC_sacch_chan_act_ho_async() );
 	execute( TC_sacch_chan_act_ho_sync() );
 	execute( TC_rach_content() );
+	execute( TC_rach_content_emerg() );
 	execute( TC_rach_count() );
 	execute( TC_rach_max_ta() );
 	execute( TC_ho_rach() );

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie5b7af3e93efaa6d0b412d3b1c77bc9514424f52
Gerrit-Change-Number: 19198
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200709/bcff80b3/attachment.htm>


More information about the gerrit-log mailing list