Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload

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

daniel gerrit-no-reply at lists.osmocom.org
Thu Jul 26 10:47:54 UTC 2018


daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10166 )

Change subject: msc: Fix random error of TC_cl3_rnd_payload
......................................................................

msc: Fix random error of TC_cl3_rnd_payload

The random length for that test could go out of bounds leading to a
Dynamic test case error when sending the message.
The limiting field here is the lengthIndicator of PDU_BSSAP which
includes the length of the PDU_BSSMAP mesageType, cellId as well as the
layer3 info IE and lenght indicator additionally to the l3info payload.
So maximum length for the payload can only be 240 bytes (if the cell ID
is encoded in the longest possible way as BSSMAP_FIELD_LAC_RNC_CI).

Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b
---
M msc/MSC_Tests.ttcn
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, approved



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 1427fd0..4a6b822 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1155,7 +1155,11 @@
 private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
 	f_init_handler(pars);
 
-	var integer len := float2int(rnd() * 256.0);
+	/* length is limited by PDU_BSSAP length field which includes some
+	 * other fields beside l3info payload. So payl can only be 240 bytes
+	 * Since rnd() returns values < 1 multiply with 241
+	 */
+	var integer len := float2int(rnd() * 241.0);
 	var octetstring payl := f_rnd_octstring(len);
 
 	/* Send Complete L3 Info with empty L3 frame */

-- 
To view, visit https://gerrit.osmocom.org/10166
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b
Gerrit-Change-Number: 10166
Gerrit-PatchSet: 4
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180726/e348dfd6/attachment.htm>


More information about the gerrit-log mailing list