Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11555 )
Change subject: BSC LCLS: restructure tests ...................................................................... BSC LCLS: restructure tests Move duplicated code into separate functions to simplify adding test cases which do not use MGW MDCX methods for closing the loop. Change-Id: Idf9fc8e639b0ece662ab26c481899ef39fb7edfe Related: OS#3659 --- M bsc/BSC_Tests_LCLS.ttcn 1 file changed, 52 insertions(+), 60 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index 0151329..585059e 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -255,11 +255,28 @@ f_lcls_test_fini(); } +private function f_tc_lcls_recv_ls_exp_mgcp() runs on lcls_test_CT { + var MgcpCommand mgcp_cmd; + + interleave { + [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); + [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_locally_switched)); + [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { + CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); + } + /* not needed, as this MDCX is still handled within MSC_ConnectionHandler + [] CONN_B.receive(tr_MDCX) -> value mgcp_cmd { + CONN_B.send(f_build_mdcx_rsp(mgcp_cmd)); + } + */ + } +} + private function f_tc_lcls_gcr_bway_connect(boolean hr) runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); var TestHdlrParams pars_b; var MSC_ConnHdlr vc_conn; - var MgcpCommand mgcp_cmd; f_lcls_init(); @@ -281,14 +298,8 @@ f_lcls_test_init(pars_a, pars_b); CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - interleave { - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_locally_switched)); - [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { - CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); - } - } + + f_tc_lcls_recv_ls_exp_mgcp(); f_lcls_test_fini(); } @@ -366,6 +377,12 @@ f_lcls_test_fini(); } +/* check for the cases where LCLS is not possible due to some reason */ +private function f_lcls_not_yet_ls() runs on lcls_test_CT { + CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); +} /* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect no connect */ testcase TC_lcls_gcr_bway_dont_connect() runs on lcls_test_CT { @@ -387,9 +404,7 @@ pars_b.lcls.exp_sts := LCLS_STS_not_yet_ls; f_lcls_test_init(pars_a, pars_b); - CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); + f_lcls_not_yet_ls(); f_wait_fail_notify(); f_lcls_test_fini(); } @@ -435,12 +450,26 @@ pars_b.lcls.exp_sts := LCLS_STS_not_yet_ls; f_lcls_test_init(pars_a, pars_b); - CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); + f_lcls_not_yet_ls(); f_lcls_test_fini(); } +/* Expect given LCLS status alongside with corresponding MDCX commands */ +private function f_lcls_sts_mgcp(BIT4 expected_status) runs on lcls_test_CT { + var MgcpCommand mgcp_cmd; + + interleave { + [] CONN_B.receive(tr_BSSMAP_LclsConnCtrlAck(tr_BSSMAP_IE_LclsSts(expected_status))); + [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(expected_status)); + [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { + CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); + } + [] CONN_B.receive(tr_MDCX) -> value mgcp_cmd { + CONN_B.send(f_build_mdcx_rsp(mgcp_cmd)); + } + } +} + /* Send an ASSIGNMENT REQ with "do not connect" and enable later using LCLS CTRL */ testcase TC_lcls_gcr_bway_dont_connect_csc() runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); @@ -463,9 +492,7 @@ /* start call and expect it to be "not yet" LS */ f_lcls_test_init(pars_a, pars_b); - CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); + f_lcls_not_yet_ls(); f_sleep(2.0); /* send "connect" on A side, expect call to remain in "not yet" */ @@ -475,16 +502,7 @@ /* send "connect" on B side, expect call to go LS, with notify to A side */ CONN_B.send(ts_BSSMAP_LclsConnCtrl(omit, ts_BSSMAP_IE_LclsCsc(LCLS_CSC_connect))); - interleave { - [] CONN_B.receive(tr_BSSMAP_LclsConnCtrlAck(tr_BSSMAP_IE_LclsSts(LCLS_STS_locally_switched))); - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_locally_switched)); - [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { - CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); - } - [] CONN_B.receive(tr_MDCX) -> value mgcp_cmd { - CONN_B.send(f_build_mdcx_rsp(mgcp_cmd)); - } - } + f_lcls_sts_mgcp(LCLS_STS_locally_switched); f_wait_fail_notify(); f_lcls_test_fini(); } @@ -510,7 +528,6 @@ var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); var TestHdlrParams pars_b; var MSC_ConnHdlr vc_conn; - var MgcpCommand mgcp_cmd; f_lcls_init(); @@ -528,19 +545,8 @@ /* Expect LS to be established successfully */ f_lcls_test_init(pars_a, pars_b); CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - interleave { - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_locally_switched)); - [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { - CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); - } -/* not needed, as this MDCX is still handled within MSC_ConnectionHandler - [] CONN_B.receive(tr_MDCX) -> value mgcp_cmd { - CONN_B.send(f_build_mdcx_rsp(mgcp_cmd)); - } -*/ - } + + f_tc_lcls_recv_ls_exp_mgcp() /* request LS release on "A" side; call continues to be locally switched */ CONN_A.send(ts_BSSMAP_LclsConnCtrl(omit, ts_BSSMAP_IE_LclsCsc(LCLS_CSC_release_lcls))); @@ -549,16 +555,8 @@ /* request LS release on "B" side; call LS is released */ CONN_B.send(ts_BSSMAP_LclsConnCtrl(omit, ts_BSSMAP_IE_LclsCsc(LCLS_CSC_release_lcls))); - interleave { - [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { - CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); - } - [] CONN_B.receive(tr_MDCX) -> value mgcp_cmd { - CONN_B.send(f_build_mdcx_rsp(mgcp_cmd)); - } - [] CONN_B.receive(tr_BSSMAP_LclsConnCtrlAck(tr_BSSMAP_IE_LclsSts(LCLS_STS_no_longer_ls))); - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_no_longer_ls)); - } + + f_lcls_sts_mgcp(LCLS_STS_no_longer_ls) f_lcls_test_fini(); } @@ -587,14 +585,8 @@ /* Expect LS to be established successfully */ f_lcls_test_init(pars_a, pars_b); CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - interleave { - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); - [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_locally_switched)); - [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); - [] CONN_A.receive(tr_MDCX) -> value mgcp_cmd { - CONN_A.send(f_build_mdcx_rsp(mgcp_cmd)); - } - } + + f_tc_lcls_recv_ls_exp_mgcp(); /* Perform hard BSSMAP Clear on "A" side, expect no LS on "B" side */ var myBSSMAP_Cause cause_val := GSM0808_CAUSE_CALL_CONTROL; -- To view, visit https://gerrit.osmocom.org/11555 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idf9fc8e639b0ece662ab26c481899ef39fb7edfe Gerrit-Change-Number: 11555 Gerrit-PatchSet: 6 Gerrit-Owner: Max <msur...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder (1000002) Gerrit-Reviewer: daniel <dwillm...@sysmocom.de>