summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-10 22:28:05 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-10 22:28:05 +0200
commit3c86ea036d09eb830725940e0e3217eb1294de82 (patch)
tree0932f18759400e5a09e7ac908da2980101a1fd4c
parent7a14fd5c43cf5dfc0d20f8f476c94694b5718e8a (diff)
bsc: New test cases for encryption without assignment
The existing encryption related test cases are all testing a case involving the assignment procedure. This patch adds some new testcases that test encryption without any assignment, like e.g. in a typical LU. Change-Id: I443cd8127e76f70fcaa7bf1638c2219524fa9381 Closes: OS#3183
-rw-r--r--bsc/BSC_Tests.ttcn47
1 files changed, 47 insertions, 0 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 14f3724..762b5a2 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1434,6 +1434,50 @@ runs on MSC_ConnHdlr {
fn.apply(id);
}
+/* Establish signalling channel (non-assignment case) followed by cipher mode */
+private function f_tc_ciph_mode_a5(charstring id) runs on MSC_ConnHdlr {
+ var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
+ var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
+ var template PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL);
+
+ // Disable generation of ASSIGNMENT CMD, as OsmoBSC currently performs MODE MODFIY sign->sign (OS#2936)
+ //f_establish_fully(ass_cmd, exp_compl);
+ f_establish_fully(omit, exp_compl);
+}
+testcase TC_ciph_mode_a5_0() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+ pars.encr := valueof(t_EncrParams('01'O, f_rnd_octstring(8)));
+
+ f_init(1, true);
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars);
+ vc_conn.done;
+}
+testcase TC_ciph_mode_a5_1() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+ pars.encr := valueof(t_EncrParams('02'O, f_rnd_octstring(8)));
+
+ f_init(1, true);
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars);
+ vc_conn.done;
+}
+testcase TC_ciph_mode_a5_3() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+ pars.encr := valueof(t_EncrParams('08'O, f_rnd_octstring(8)));
+
+ f_init(1, true);
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars);
+ vc_conn.done;
+}
+
+
+/* establish initial channel, enable ciphering followed by assignment to ciphered channel */
private function f_tc_assignment_fr_a5(charstring id) runs on MSC_ConnHdlr {
var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
@@ -2392,6 +2436,9 @@ control {
execute( TC_assignment_fr_a5_1_codec_missing() );
execute( TC_assignment_fr_a5_3() );
execute( TC_assignment_fr_a5_4() );
+ execute( TC_ciph_mode_a5_0() );
+ execute( TC_ciph_mode_a5_1() );
+ execute( TC_ciph_mode_a5_3() );
execute( TC_assignment_codec_fr() );
execute( TC_assignment_codec_hr() );