summaryrefslogtreecommitdiffstats
path: root/msc/MSC_Tests.ttcn
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-07-26 08:29:45 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2018-07-26 12:35:26 +0200
commitaa14a3833d242d84f46b6b5947e4f45bd7889eca (patch)
treeeba709ae97a3a46f3fa6c9a815820752d7fa6ec5 /msc/MSC_Tests.ttcn
parentb85a62939500a96c1a92075c1d34acbd3f27af1b (diff)
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
Diffstat (limited to 'msc/MSC_Tests.ttcn')
-rw-r--r--msc/MSC_Tests.ttcn6
1 files changed, 5 insertions, 1 deletions
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 @@ testcase TC_cl3_no_payload() runs on MTC_CT {
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 */