Change in ...osmo-ttcn3-hacks[master]: bts: Add test csse for I frame with wrong C/R value
Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 ) Change subject: bts: Add test csse for I frame with wrong C/R value .. bts: Add test csse for I frame with wrong C/R value Implemented as BTS_Tests_LAPDm.TC_incorrect_cr() Related: OS#4032 Change-Id: I19e50049625bd31662a1e22b1394b69b2d249104 --- M bts/BTS_Tests_LAPDm.ttcn 1 file changed, 54 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn index bf359f2..12f24eb 100644 --- a/bts/BTS_Tests_LAPDm.ttcn +++ b/bts/BTS_Tests_LAPDm.ttcn @@ -999,6 +999,59 @@ f_testmatrix_each_chan(pars, refers(f_TC_rr_response_frame_loss)); } +/* Ensure BTS ignores I frames with wrong C/R bit; Inspired by TS 51.010-1 25.2.5.1 */ +private function f_TC_incorrect_cr(charstring id) runs on ConnHdlr { + var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0)); + var integer sapi := link_id.sapi; + var boolean is_sacch := false; + if (link_id.c == SACCH) { + is_sacch := true; + } + timer T := 3.0; + var default d; + + fp_common_init(); + + /* some common altstep for meas res and other background noise */ + d := activate(as_ignore_background(true)); + RSL.clear; + LAPDM.clear; + + f_establish_mo(link_id); + + var octetstring l3_mo := f_rnd_octstring(10); + /* Send an I frame to the BTS: SAPI = 0, C = 0, P = 1, M = 0, L = 3, N(S) = 0, N(R) = 0 */ + LAPDM.send(t_PH_DATA(0, is_sacch, ts_LAPDm_I(sapi, c_r:=cr_MO_RSP, p:=true, nr:=0, ns:=0, +l3:=l3_mo))); + T.start; + alt { + [] RSL.receive(tr_RSL_DATA_IND(g_chan_nr, link_id, l3_mo)) { + setverdict(fail, "BTS didn't ignore I frame with wrong C/R bit"); + } + [] RSL.receive(tr_RSL_ERROR_IND(g_chan_nr, link_id, '0C'O)) { + repeat; + } + /* ensure BTS still sends idle frames */ + [] as_lapdm_idle() { + setverdict(pass, "still sending idle frames"); + } + [] T.timeout {} + } + + /* Send RR command P=1 */ + LAPDM.send(t_PH_DATA(0, is_sacch, ts_LAPDm_RR(sapi, c_r:=cr_MO_CMD, p:=true, nr:=0))); + + /* The BTS shall respond with a RR response, F bit set to 1. */ + LAPDM.receive(t_PH_DATA(0, is_sacch, tr_LAPDm_RR(sapi, c_r:=cr_MT_RSP, p:=true, nr:=0))); + + deactivate(d); + + fp_common_fini(); +} +testcase TC_incorrect_cr() runs on test_CT { + var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN)); + f_testmatrix_each_chan(pars, refers(f_TC_incorrect_cr)); +} control { execute(TC_foo()); execute(TC_sabm_ua_dcch_sapi0()); @@ -1017,6 +1070,7 @@ execute(TC_segm_concat_sacch()); execute(TC_t200_n200()); execute(TC_rr_response_frame_loss()); + execute(TC_incorrect_cr()); } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 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: I19e50049625bd31662a1e22b1394b69b2d249104 Gerrit-Change-Number: 14350 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: merged
Change in ...osmo-ttcn3-hacks[master]: bts: Add test csse for I frame with wrong C/R value
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 ) Change subject: bts: Add test csse for I frame with wrong C/R value .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 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: I19e50049625bd31662a1e22b1394b69b2d249104 Gerrit-Change-Number: 14350 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 04 Jun 2019 21:30:04 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: bts: Add test csse for I frame with wrong C/R value
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 to look at the new patch set (#4). Change subject: bts: Add test csse for I frame with wrong C/R value .. bts: Add test csse for I frame with wrong C/R value Implemented as BTS_Tests_LAPDm.TC_incorrect_cr() Related: OS#4032 Change-Id: I19e50049625bd31662a1e22b1394b69b2d249104 --- M bts/BTS_Tests_LAPDm.ttcn 1 file changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/14350/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 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: I19e50049625bd31662a1e22b1394b69b2d249104 Gerrit-Change-Number: 14350 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
Change in ...osmo-ttcn3-hacks[master]: bts: Add test csse for I frame with wrong C/R value
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 ) Change subject: bts: Add test csse for I frame with wrong C/R value .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 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: I19e50049625bd31662a1e22b1394b69b2d249104 Gerrit-Change-Number: 14350 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 03 Jun 2019 15:10:50 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-ttcn3-hacks[master]: bts: Add test csse for I frame with wrong C/R value
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 to look at the new patch set (#2). Change subject: bts: Add test csse for I frame with wrong C/R value .. bts: Add test csse for I frame with wrong C/R value Implemented as BTS_Tests_LAPDm.TC_incorrect_cr() Change-Id: I19e50049625bd31662a1e22b1394b69b2d249104 --- M bts/BTS_Tests_LAPDm.ttcn 1 file changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/14350/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 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: I19e50049625bd31662a1e22b1394b69b2d249104 Gerrit-Change-Number: 14350 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
Change in ...osmo-ttcn3-hacks[master]: bts: Add test csse for I frame with wrong C/R value
Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 Change subject: bts: Add test csse for I frame with wrong C/R value .. bts: Add test csse for I frame with wrong C/R value Implemented as BTS_Tests_LAPDm.TC_incorrect_cr() Change-Id: I19e50049625bd31662a1e22b1394b69b2d249104 --- M bts/BTS_Tests_LAPDm.ttcn 1 file changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/14350/1 diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn index 218804e..f57b052 100644 --- a/bts/BTS_Tests_LAPDm.ttcn +++ b/bts/BTS_Tests_LAPDm.ttcn @@ -1001,6 +1001,59 @@ f_testmatrix_each_chan(pars, refers(f_TC_rr_response_frame_loss)); } +/* Ensure BTS ignores I frames with wrong C/R bit; Inspired by TS 51.010-1 25.2.5.1 */ +private function f_TC_incorrect_cr(charstring id) runs on ConnHdlr { + var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0)); + var integer sapi := link_id.sapi; + var boolean is_sacch := false; + if (link_id.c == SACCH) { + is_sacch := true; + } + timer T := 3.0; + var default d; + + fp_common_init(); + + /* some common altstep for meas res and other background noise */ + d := activate(as_ignore_background(true)); + RSL.clear; + LAPDM.clear; + + f_establish_mo(link_id); + + var octetstring l3_mo := f_rnd_octstring(10); + /* Send an I frame to the BTS: SAPI = 0, C = 0, P = 1, M = 0, L = 3, N(S) = 0, N(R) = 0 */ + LAPDM.send(t_PH_DATA(0, is_sacch, ts_LAPDm_I(sapi, c_r:=cr_MO_RSP, p:=true, nr:=0, ns:=0, +l3:=l3_mo))); + T.start; + alt { + [] RSL.receive(tr_RSL_DATA_IND(g_chan_nr, link_id, l3_mo)) { + setverdict(fail, "BTS didn't ignore I frame with wrong C/R bit"); + } + [] RSL.receive(tr_RSL_ERROR_IND(g_chan_nr, link_id, '0C'O)) { + repeat; + } + /* ensure BTS still sends idle frames */ + [] as_lapdm_idle() { + setverdict(pass, "still sending idle frames"); + } + [] T.timeout {} + } + + /* Send RR command P=1 */ + LAPDM.send(t_PH_DATA(0, is_sacch, ts_LAPDm_RR(sapi, c_r:=cr_MO_CMD, p:=true, nr:=0))); + + /* The BTS shall respond with a RR response, F bit set to 1. */ + LAPDM.receive(t_PH_DATA(0, is_sacch, tr_LAPDm_RR(sapi, c_r:=cr_MT_RSP, p:=true, nr:=0))); + + deactivate(d); + + fp_common_fini(); +} +testcase TC_incorrect_cr() runs on test_CT { + var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN)); + f_testmatrix_each_chan(pars, refers(f_TC_incorrect_cr)); +} control { execute(TC_foo()); execute(TC_sabm_ua_dcch_sapi0()); @@ -1019,6 +1072,7 @@ execute(TC_segm_concat_sacch()); execute(TC_t200_n200()); execute(TC_rr_response_frame_loss()); + execute(TC_incorrect_cr()); } } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14350 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: I19e50049625bd31662a1e22b1394b69b2d249104 Gerrit-Change-Number: 14350 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-MessageType: newchange