[PATCH] osmo-ttcn3-hacks[master]: bts: low-level RSL ERROR REPORT Testing

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
Sun Feb 25 00:35:26 UTC 2018


Review at  https://gerrit.osmocom.org/6887

bts: low-level RSL ERROR REPORT Testing

Change-Id: If1cc6c672d5a0cf8eb8ef23b96eb1e80ceef30f1
---
M bts/BTS_Tests.ttcn
M library/RSL_Types.ttcn
2 files changed, 64 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/6887/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1548908..e683da0 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -948,6 +948,56 @@
 	/* negative test: ensure ERROR REPORT on unsupported types */
 }
 
+private function f_exp_err_rep(template RSL_Cause cause) runs on test_CT {
+	timer T := 5.0;
+	T.start;
+	alt {
+	[] RSL_CCHAN.receive(tr_RSL(tr_RSL_ERROR_REPORT(cause))) {
+		setverdict(pass);
+		}
+	[] RSL_CCHAN.receive(tr_RSL(tr_RSL_ERROR_REPORT(?))) {
+		setverdict(fail, "Wrong cause in RSL ERR REP");
+		}
+	[] RSL_CCHAN.receive {
+		repeat;
+		}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for RSL ERR REP");
+		}
+	}
+}
+
+/* Provoke a protocol error (message too short) and match on ERROR REPORT */
+testcase TC_rsl_protocol_error() runs on test_CT {
+	f_init(testcasename());
+	var RSL_Message rsl := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
+	rsl.ies := omit;
+	RSL_CCHAN.send(ts_RSL(rsl));
+
+	f_exp_err_rep(RSL_ERR_PROTO);
+}
+
+/* Provoke a mandatory IE error and match on ERROR REPORT */
+testcase TC_rsl_mand_ie_error() runs on test_CT {
+	f_init(testcasename());
+
+	var RSL_Message rsl := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
+	rsl.ies := { rsl.ies[0] };
+	RSL_CCHAN.send(ts_RSL(rsl));
+
+	f_exp_err_rep(RSL_ERR_MAND_IE_ERROR);
+}
+
+/* Provoke an IE content error and match on ERROR REPORT */
+testcase TC_rsl_ie_content_error() runs on test_CT {
+	f_init(testcasename());
+	var RSL_Message rsl := valueof(ts_RSL_BCCH_INFO(RSL_SYSTEM_INFO_1, ''O));
+	rsl.ies[1].body.sysinfo_type := RSL_SYSTEM_INFO_5;
+	RSL_CCHAN.send(ts_RSL(rsl));
+
+	f_exp_err_rep(RSL_ERR_IE_CONTENT);
+}
+
 
 /* TODO Areas:
 
@@ -978,8 +1028,6 @@
 ** type error
 ** sequence error
 ** IE duplicated?
-** IE missing
-** IE length error
 
 */
 
@@ -998,6 +1046,9 @@
 	execute( TC_paging_tmsi_80percent() );
 	execute( TC_paging_imsi_200percent() );
 	execute( TC_paging_tmsi_200percent() );
+	execute( TC_rsl_protocol_error() );
+	execute( TC_rsl_mand_ie_error() );
+	execute( TC_rsl_ie_content_error() );
 }
 
 
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index 5366b31..ba467c6 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1275,12 +1275,21 @@
 
 	/* 8.6.4 BTS -> BSC */
 	template RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
-		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
-		msg_type := RSL_MT_ERROR_IND,
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
+		msg_type := RSL_MT_ERROR_REPORT,
 		ies := {
 			t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
 		}
 	}
+	template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
+		msg_type := RSL_MT_ERROR_REPORT,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
+			*
+		}
+	}
+
 
 
 	/* Abis/IP specific messages */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1cc6c672d5a0cf8eb8ef23b96eb1e80ceef30f1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list