Change in osmo-ttcn3-hacks[master]: bsc CBSP: TC_cbsp_write_bss: run a fixed series of payload lengths

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 Aug 13 05:40:42 UTC 2020


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

Change subject: bsc CBSP: TC_cbsp_write_bss: run a fixed series of payload lengths
......................................................................

bsc CBSP: TC_cbsp_write_bss: run a fixed series of payload lengths

Recently fixed errors in the last_block counting as well as encoding ask for a
proper test coverage of various lengths, which also verifies the expected
blocks count explicitly.

Implement this in TC_cbsp_write_bss():

Run f_tc_cbsp_write_bss() multiple times with differing fixed payload lengths,
at all block count transitions, plus some arbitrary lengths in-between.

Before this patch, TC_cbsp_write_bss() would pick a different random payload
length for every test run, which, until recently, then sporadically hit
last_block value errors. That's not good for reproducability.

Change-Id: I3cace19f9e5adc8ebab13ef2328a36dc150b2b31
---
M bsc/BSC_Tests_CBSP.ttcn
1 file changed, 33 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index 657d172..413ab5d 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -380,20 +380,46 @@
 }
 
 /* Write to entire BSS; three cells succeed; one fails (no CBCH) */
-testcase TC_cbsp_write_bss() runs on cbsp_test_CT {
-	var CBSP_IEs pages := {f_gen_page()};
+function f_tc_cbsp_write_bss(integer payload_len := -1, template (present) integer expect_blocks) runs on cbsp_test_CT {
+	var CBSP_IEs pages := {f_gen_page(payload_len := payload_len)};
 	var template (value) BSSMAP_FIELD_CellIdentificationList cell_list;
 	cell_list := ts_BSSMAP_CIL_BSS;
-	f_cbsp_init_server();
 	f_cbsp_write(1, 1001, cell_list, content:=pages,
 		     success_list:=tr_BSSMAP_CIL_CGI({?,?,?}), fail_list:={?});
 
-	var template RSL_Message tr := f_page2rsl(pages[0], 1, 1001);
+	var template RSL_Message tr := f_page2rsl(pages[0], 1, 1001, expect_blocks := expect_blocks);
+	log("RSL[0,1,2] EXPECTING ", tr_ASP_RSL_UD(tr));
 	interleave {
-	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr)) {}
-	[] IPA_RSL[1].receive(tr_ASP_RSL_UD(tr)) {}
-	[] IPA_RSL[2].receive(tr_ASP_RSL_UD(tr)) {}
+	[] IPA_RSL[0].receive(tr_ASP_RSL_UD(tr)) { log("Got SMSCB CMD on RSL[0]"); }
+	[] IPA_RSL[1].receive(tr_ASP_RSL_UD(tr)) { log("Got SMSCB CMD on RSL[1]"); }
+	[] IPA_RSL[2].receive(tr_ASP_RSL_UD(tr)) { log("Got SMSCB CMD on RSL[2]"); }
 	}
+	setverdict(pass);
+}
+testcase TC_cbsp_write_bss() runs on cbsp_test_CT {
+	f_cbsp_init_server(guard_timeout := 60.0);
+	/* In the SMSCB message, there is a head followed by payload,
+	 * and the resulting data is segmented in blocks of 22 octets (<= 4 blocks).
+	 *
+	 * [head][...payload....]|[....................]|[....................]|[....................]
+	 *       0               |16                    |38                    |60                   |82
+	 * 0    5                |22                    |44                    |66                   |88
+	 *
+	 *         blocks count:   1     | 2      | 3      | 4
+	 * payload octets count:   1..16 | 17..38 | 39..60 | 61..82
+	 */
+	f_tc_cbsp_write_bss(payload_len := 1, expect_blocks := 1);
+	f_tc_cbsp_write_bss(payload_len := 2, expect_blocks := 1);
+	f_tc_cbsp_write_bss(payload_len := 16, expect_blocks := 1);
+	f_tc_cbsp_write_bss(payload_len := 17, expect_blocks := 2);
+	f_tc_cbsp_write_bss(payload_len := 23, expect_blocks := 2);
+	f_tc_cbsp_write_bss(payload_len := 38, expect_blocks := 2);
+	f_tc_cbsp_write_bss(payload_len := 39, expect_blocks := 3);
+	f_tc_cbsp_write_bss(payload_len := 42, expect_blocks := 3);
+	f_tc_cbsp_write_bss(payload_len := 60, expect_blocks := 3);
+	f_tc_cbsp_write_bss(payload_len := 61, expect_blocks := 4);
+	f_tc_cbsp_write_bss(payload_len := 77, expect_blocks := 4);
+	f_tc_cbsp_write_bss(payload_len := 82, expect_blocks := 4);
 }
 
 /* Write to single BTS supporting CBCH: success */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19439
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: I3cace19f9e5adc8ebab13ef2328a36dc150b2b31
Gerrit-Change-Number: 19439
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20200813/d0dc937f/attachment.htm>


More information about the gerrit-log mailing list