summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-10-31 19:38:38 +0100
committerHarald Welte <laforge@gnumonks.org>2018-11-18 20:03:25 +0000
commitb1599b11e3611896f12bd7960ceda8268b06c71f (patch)
tree4a469e0489671df16580daa245355ea926beee6b /bsc
parent4b0f49633eeaf8df118da6d175e3b437bd911add (diff)
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
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests_LCLS.ttcn112
1 files changed, 52 insertions, 60 deletions
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 @@ testcase TC_lcls_gcr_only() runs on lcls_test_CT {
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 @@ private function f_tc_lcls_gcr_bway_connect(boolean hr) runs on lcls_test_CT {
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 @@ testcase TC_lcls_gcr_nomatch_bway_connect() runs on lcls_test_CT {
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 @@ testcase TC_lcls_gcr_bway_dont_connect() runs on lcls_test_CT {
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 @@ testcase TC_lcls_gcr_unsuppported_csc() runs on lcls_test_CT {
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 @@ testcase TC_lcls_gcr_bway_dont_connect_csc() runs on lcls_test_CT {
/* 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 @@ testcase TC_lcls_gcr_bway_dont_connect_csc() runs on lcls_test_CT {
/* 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 @@ testcase TC_lcls_connect_break() 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();
@@ -528,19 +545,8 @@ testcase TC_lcls_connect_break() runs on lcls_test_CT {
/* 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 @@ testcase TC_lcls_connect_break() runs on lcls_test_CT {
/* 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 @@ testcase TC_lcls_connect_clear() runs on lcls_test_CT {
/* 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;