[PATCH] osmo-ttcn3-hacks[master]: bsc: New test cases for encryption without assignment

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu May 10 20:31:04 UTC 2018


Review at  https://gerrit.osmocom.org/8111

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
---
M bsc/BSC_Tests.ttcn
1 file changed, 47 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/11/8111/1

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 @@
 	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 @@
 	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() );

-- 
To view, visit https://gerrit.osmocom.org/8111
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I443cd8127e76f70fcaa7bf1638c2219524fa9381
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list