summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-07-29 00:57:27 +0200
committerlaforge <laforge@osmocom.org>2020-08-13 05:37:35 +0000
commita16afdc4c698cb190d6858e432743328ef4cccdd (patch)
tree7aca968e001bffb2f2a6467df1593e1e9d844ed3 /bsc
parent63e2e1886a238e10e8aaad82dd95c6d22add4f91 (diff)
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
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests_CBSP.ttcn40
1 files changed, 33 insertions, 7 deletions
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 @@ testcase TC_cbsp_write() runs on cbsp_test_CT {
}
/* 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 */