summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-01-08 13:41:39 +0100
committerHarald Welte <laforge@gnumonks.org>2019-01-29 12:49:47 +0000
commitac09bfc4cef471a1e7a35eb00570aaece9020695 (patch)
tree58f6543c481a8d93218aa7bd17e6cf9460cd6a3b /bsc
parent2caf3497524c509994920a65ca450db34ad329a4 (diff)
BSC_Tests: Add tests to check channel allocator
When a channel is assigned via the assignment request throught the A interface, the MSC may offer either FR, HR or both. When FR and HR are permitted, a preference is set on one of the two. At the moment we do not check how the bsc is reacting to those preferences and its also not checked how the behavior is when the preferred rate is not available because all lchan of that type are already in use. Lets add a set of tests to verify this. Change-Id: I109d986dd7ece1a56422a669ca64353ed46f7ed6 Depends: osmo-bsc I397e68e26d6a1727890353fa34f4897b54795866 Related: OS#3503
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests.ttcn294
-rw-r--r--bsc/expected-results.xml10
2 files changed, 304 insertions, 0 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 77da306..a6f9f7d 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2053,6 +2053,289 @@ testcase TC_assignment_codec_amr_h() runs on test_CT {
vc_conn.done;
}
+private function f_disable_all_tch_f() runs on test_CT {
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 1 sub-slot 0 disable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 2 sub-slot 0 disable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 3 sub-slot 0 disable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 4 sub-slot 0 disable");
+}
+
+private function f_disable_all_tch_h() runs on test_CT {
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 0 disable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 1 disable");
+}
+
+private function f_enable_all_tch() runs on test_CT {
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 1 sub-slot 0 enable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 2 sub-slot 0 enable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 3 sub-slot 0 enable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 4 sub-slot 0 enable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 0 enable");
+ f_vty_transceive(BSCVTY, "bts 0 trx 0 timeslot 5 sub-slot 1 enable");
+}
+
+/* Allow HR only */
+private function f_TC_assignment_codec_xr_exhausted_req_hr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '09'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '05'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR}));
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow FR only */
+private function f_TC_assignment_codec_xr_exhausted_req_fr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '08'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '01'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow HR only (expect assignment failure) */
+private function f_TC_assignment_codec_xr_exhausted_req_hr_fail(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '09'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '05'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR}));
+ f_establish_fully(ass_cmd, exp_fail);
+}
+
+/* Allow FR only (expect assignment failure) */
+private function f_TC_assignment_codec_xr_exhausted_req_fr_fail(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '08'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '01'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+ f_establish_fully(ass_cmd, exp_fail);
+}
+
+/* Allow FR and HR, but prefer FR */
+private function f_TC_assignment_codec_fr_exhausted_req_fr_hr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '0A'O; /* Prefer FR */
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '8105'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR, ts_CodecHR}));
+ exp_compl.pdu.bssmap.assignmentComplete.speechVersion.speechVersionIdentifier := '0000101'B; /* Expect HR */
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow FR and HR, but prefer HR */
+private function f_TC_assignment_codec_fr_exhausted_req_hr_fr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '0B'O; /* Prefer HR */
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '8501'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR, ts_CodecFR}));
+ exp_compl.pdu.bssmap.assignmentComplete.speechVersion.speechVersionIdentifier := '0000101'B; /* Expect HR */
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow FR and HR, but prefer FR */
+private function f_TC_assignment_codec_hr_exhausted_req_fr_hr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '0A'O; /* Prefer FR */
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '8105'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR, ts_CodecHR}));
+ exp_compl.pdu.bssmap.assignmentComplete.speechVersion.speechVersionIdentifier := '0000001'B; /* Expect FR */
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow FR and HR, but prefer HR */
+private function f_TC_assignment_codec_hr_exhausted_req_hr_fr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '0B'O; /* Prefer HR */
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '8501'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR, ts_CodecFR}));
+ exp_compl.pdu.bssmap.assignmentComplete.speechVersion.speechVersionIdentifier := '0000001'B; /* Expect FR */
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Request a HR channel while all FR channels are exhausted, this is expected
+ * to work without conflicts */
+testcase TC_assignment_codec_fr_exhausted_req_hr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_f();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_xr_exhausted_req_hr));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a FR channel while all FR channels are exhausted, this is expected
+ * to fail. */
+testcase TC_assignment_codec_fr_exhausted_req_fr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_f();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_xr_exhausted_req_fr_fail));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a FR (prefered) or alternatively a HR channel while all FR channels
+ * are exhausted, this is expected to be resolved by selecting a HR channel. */
+testcase TC_assignment_codec_fr_exhausted_req_fr_hr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_f();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_fr_exhausted_req_fr_hr));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a HR (prefered) or alternatively a FR channel while all FR channels
+ * are exhausted, this is expected to work without conflicts. */
+testcase TC_assignment_codec_fr_exhausted_req_hr_fr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_f();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_fr_exhausted_req_hr_fr));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a FR channel while all HR channels are exhausted, this is expected
+ * to work without conflicts */
+testcase TC_assignment_codec_hr_exhausted_req_fr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_h();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_xr_exhausted_req_fr));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a HR channel while all HR channels are exhausted, this is expected
+ * to fail. */
+testcase TC_assignment_codec_hr_exhausted_req_hr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_h();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_xr_exhausted_req_hr_fail));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a HR (prefered) or alternatively a FR channel while all HR channels
+ * are exhausted, this is expected to be resolved by selecting a FR channel. */
+testcase TC_assignment_codec_hr_exhausted_req_hr_fr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_h();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_hr_exhausted_req_hr_fr));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Request a FR (prefered) or alternatively a HR channel while all HR channels
+ * are exhausted, this is expected to work without conflicts. */
+testcase TC_assignment_codec_hr_exhausted_req_fr_hr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ f_disable_all_tch_h();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_hr_exhausted_req_fr_hr));
+ vc_conn.done;
+ f_enable_all_tch();
+ setverdict(pass);
+}
+
+/* Allow FR and HR, but prefer HR */
+private function f_TC_assignment_codec_req_hr_fr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '0B'O; /* Prefer HR */
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '8501'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR, ts_CodecFR}));
+ exp_compl.pdu.bssmap.assignmentComplete.speechVersion.speechVersionIdentifier := '0000101'B; /* Expect HR */
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Allow FR and HR, but prefer FR */
+private function f_TC_assignment_codec_req_fr_hr(charstring id) runs on MSC_ConnHdlr {
+ g_pars := f_gen_test_hdlr_pars();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.channelRateAndType := '0A'O; /* Prefer FR */
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechId_DataIndicator := '8105'O;
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR, ts_CodecHR}));
+ exp_compl.pdu.bssmap.assignmentComplete.speechVersion.speechVersionIdentifier := '0000001'B; /* Expect FR */
+ f_establish_fully(ass_cmd, exp_compl);
+}
+
+/* Request a HR (prefered) or alternatively a FR channel, it is expected that
+ * HR, which is the prefered type, is selected. */
+testcase TC_assignment_codec_req_hr_fr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_req_hr_fr));
+ vc_conn.done;
+ setverdict(pass);
+}
+
+/* Request a FR (prefered) or alternatively a HR channel, it is expected that
+ * FR, which is the prefered type, is selected. */
+testcase TC_assignment_codec_req_fr_hr() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ f_init(1, true);
+ f_sleep(1.0);
+ f_enable_all_tch();
+ vc_conn := f_start_handler(refers(f_TC_assignment_codec_req_fr_hr));
+ vc_conn.done;
+ setverdict(pass);
+}
+
/* test the procedure of the MSC requesting a Classmark Update:
* a) BSSMAP Classmark Request should result in RR CLASSMARK ENQUIRY,
* b) L3 RR CLASSMARK CHANGE should result in BSSMAP CLASSMARK UPDATE */
@@ -3444,6 +3727,17 @@ control {
execute( TC_assignment_codec_amr_f() );
execute( TC_assignment_codec_amr_h() );
+ execute( TC_assignment_codec_fr_exhausted_req_hr() );
+ execute( TC_assignment_codec_fr_exhausted_req_fr() );
+ execute( TC_assignment_codec_fr_exhausted_req_fr_hr() );
+ execute( TC_assignment_codec_fr_exhausted_req_hr_fr() );
+ execute( TC_assignment_codec_hr_exhausted_req_fr() );
+ execute( TC_assignment_codec_hr_exhausted_req_hr() );
+ execute( TC_assignment_codec_hr_exhausted_req_hr_fr() );
+ execute( TC_assignment_codec_hr_exhausted_req_fr_hr() );
+ execute( TC_assignment_codec_req_hr_fr() );
+ execute( TC_assignment_codec_req_fr_hr() );
+
/* RLL Establish Indication on inactive DCHAN / SAPI */
execute( TC_rll_est_ind_inact_lchan() );
execute( TC_rll_est_ind_inval_sapi1() );
diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml
index ccd2928..dadb349 100644
--- a/bsc/expected-results.xml
+++ b/bsc/expected-results.xml
@@ -35,6 +35,16 @@
<testcase classname='BSC_Tests' name='TC_assignment_codec_efr' time='MASKED'/>
<testcase classname='BSC_Tests' name='TC_assignment_codec_amr_f' time='MASKED'/>
<testcase classname='BSC_Tests' name='TC_assignment_codec_amr_h' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_fr_exhausted_req_hr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_fr_exhausted_req_fr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_fr_exhausted_req_fr_hr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_fr_exhausted_req_hr_fr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_hr_exhausted_req_fr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_hr_exhausted_req_hr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_hr_exhausted_req_hr_fr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_hr_exhausted_req_fr_hr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_req_hr_fr' time='MASKED'/>
+ <testcase classname='BSC_Tests' name='TC_assignment_codec_req_fr_hr' time='MASKED'/>
<testcase classname='BSC_Tests' name='TC_rll_est_ind_inact_lchan' time='MASKED'/>
<testcase classname='BSC_Tests' name='TC_rll_est_ind_inval_sapi1' time='MASKED'/>
<testcase classname='BSC_Tests' name='TC_rll_est_ind_inval_sapi3' time='MASKED'/>