Change in osmo-ttcn3-hacks[master]: bsc CBSP: f_gen_page(): allow passing explicit payload len

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

neels gerrit-no-reply at lists.osmocom.org
Tue Jul 28 23:49:02 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19438 )


Change subject: bsc CBSP: f_gen_page(): allow passing explicit payload len
......................................................................

bsc CBSP: f_gen_page(): allow passing explicit payload len

Keep the default of using a random payload length, but also allow picking one
specifically. TC_cbsp_write_bss() will use this in a subsequent patch.

Change-Id: I259da42cbcbfdfe930aabb45c9de8a2b67c69629
---
M bsc/BSC_Tests_CBSP.ttcn
1 file changed, 8 insertions(+), 4 deletions(-)



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

diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index dd57954..f1f0240 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -134,10 +134,14 @@
 	}
 }
 
-function f_gen_page() return CBSP_IE {
-	var integer len := f_rnd_int(82);
-	var octetstring payload := f_rnd_octstring(len);
-	return valueof(ts_CbspMsgContent(payload, len));
+function f_gen_page(integer payload_len := -1) return CBSP_IE {
+	if (payload_len < 1) {
+		/* No payload len of zero please */
+		payload_len := 1 + f_rnd_int(81);
+	}
+	log("Generating CBSP payload: ", payload_len, " octets");
+	var octetstring payload := f_rnd_octstring(payload_len);
+	return valueof(ts_CbspMsgContent(payload, payload_len));
 }
 
 function f_cbsp_reset_bss(integer idx) runs on CBSP_Adapter_CT {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19438
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: I259da42cbcbfdfe930aabb45c9de8a2b67c69629
Gerrit-Change-Number: 19438
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200728/9396651c/attachment.htm>


More information about the gerrit-log mailing list