Change in osmo-ttcn3-hacks[master]: bsc: replace TC_assignment_fr_a5_4 with TC_assignment_fr_a5_not_sup

neels gerrit-no-reply at lists.osmocom.org
Mon Jun 21 12:41:21 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24667 )

Change subject: bsc: replace TC_assignment_fr_a5_4 with TC_assignment_fr_a5_not_sup
......................................................................

bsc: replace TC_assignment_fr_a5_4 with TC_assignment_fr_a5_not_sup

reasons:

* TC_assignment_fr_a5_4() runs an unusual sequence of messages: it first
  fully assigns an lchan, and after that sends a Cipher Mode Command.
  Usually, the ciphering happens as part of attaching (Compl L3).
  The new test TC_assignment_fr_a5_not_sup() does the ciphering in the
  usual sequence, and properly expects a Cipher Mode Reject.

* TC_assignment_fr_a5_4 means to ask for an *unsupported* encryption
  algo. Since we are going to introduce A5/4 support shortly, we'll need
  to free up this name, for a successful A5/4 encryption test.

New test TC_assignment_fr_a5_not_sup() asks for A5/5 encryption, which
is not supported.

Related: SYS#5324
Change-Id: I83eca18d1b3d8d58177aa3750935ec5a3a985ca4
---
M bsc/BSC_Tests.ttcn
M bsc/expected-results.xml
2 files changed, 43 insertions(+), 15 deletions(-)

Approvals:
  neels: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 102a7f2..38e591c 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -3415,26 +3415,54 @@
 	f_shutdown_helper();
 }
 
-private function f_tc_assignment_fr_a5_4(charstring id) runs on MSC_ConnHdlr {
-	g_pars := f_gen_test_hdlr_pars();
-	var template PDU_BSSAP exp_compl := f_gen_exp_compl();
-	var PDU_BSSAP ass_cmd := f_gen_ass_req();
-	const OCT8 kc := '0001020304050607'O;
-	const OCT16 kc128 := kc & kc;
+private function f_TC_assignment_a5_not_sup(charstring id) runs on MSC_ConnHdlr {
+	var template PDU_BSSAP exp_ass_cpl := f_gen_exp_compl();
+	var PDU_BSSAP exp_ass_req := f_gen_ass_req();
 
-	ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
-	ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
-	f_establish_fully(ass_cmd, exp_compl);
-	f_cipher_mode('10'O, kc, kc128, true);
-	/* TODO: expect GSM0808_CAUSE_CIPHERING_ALGORITHM_NOT_SUPPORTED cause value */
+	exp_ass_req.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+	exp_ass_req.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+
+	/* this is like the beginning of f_establish_fully(), but only up to ciphering reject */
+
+	var BSSMAP_FIELD_CodecType codecType;
+	timer T := 10.0;
+
+	codecType := exp_ass_req.pdu.bssmap.assignmentRequest.codecList.codecElements[0].codecType;
+	f_MscConnHdlr_init(g_pars.media_nr, host_bts, host_mgw_mgcp, codecType);
+
+	f_create_chan_and_exp();
+	/* we should now have a COMPL_L3 at the MSC */
+
+	var template PDU_BSSAP exp_l3_compl;
+	exp_l3_compl := tr_BSSMAP_ComplL3()
+	if (g_pars.aoip == false) {
+		exp_l3_compl.pdu.bssmap.completeLayer3Information.codecList := omit;
+	} else {
+		exp_l3_compl.pdu.bssmap.completeLayer3Information.codecList := ?;
+	}
+	T.start;
+	alt {
+	[] BSSAP.receive(exp_l3_compl);
+	[] BSSAP.receive(tr_BSSMAP_ComplL3) {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Received non-matching COMPLETE LAYER 3 INFORMATION");
+		}
+	[] T.timeout {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Timeout waiting for COMPLETE LAYER 3 INFORMATION");
+		}
+	}
+
+	/* Start ciphering, expect Cipher Mode Reject */
+	f_cipher_mode(g_pars.encr.enc_alg, g_pars.encr.enc_key, exp_fail := true);
 }
-testcase TC_assignment_fr_a5_4() runs on test_CT {
+testcase TC_assignment_fr_a5_not_sup() runs on test_CT {
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
 	var MSC_ConnHdlr vc_conn;
 
 	f_init(1, true);
 	f_sleep(1.0);
 
-	vc_conn := f_start_handler(refers(f_tc_assignment_fr_a5_4));
+	pars.encr := valueof(t_EncrParams('20'O, f_rnd_octstring(8)));
+	vc_conn := f_start_handler(refers(f_TC_assignment_a5_not_sup), pars);
 	vc_conn.done;
 	f_shutdown_helper();
 }
@@ -8891,7 +8919,7 @@
 		execute( TC_assignment_fr_a5_1_codec_missing() );
 	}
 	execute( TC_assignment_fr_a5_3() );
-	execute( TC_assignment_fr_a5_4() );
+	execute( TC_assignment_fr_a5_not_sup() );
 	execute( TC_ciph_mode_a5_0() );
 	execute( TC_ciph_mode_a5_1() );
 	execute( TC_ciph_mode_a5_3() );
diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml
index c98d3c7..f91de19 100644
--- a/bsc/expected-results.xml
+++ b/bsc/expected-results.xml
@@ -47,7 +47,7 @@
   <testcase classname='BSC_Tests' name='TC_assignment_fr_a5_1' time='MASKED'/>
   <testcase classname='BSC_Tests' name='TC_assignment_fr_a5_1_codec_missing' time='MASKED'/>
   <testcase classname='BSC_Tests' name='TC_assignment_fr_a5_3' time='MASKED'/>
-  <testcase classname='BSC_Tests' name='TC_assignment_fr_a5_4' time='MASKED'/>
+  <testcase classname='BSC_Tests' name='TC_assignment_fr_a5_not_sup' time='MASKED'/>
   <testcase classname='BSC_Tests' name='TC_ciph_mode_a5_0' time='MASKED'/>
   <testcase classname='BSC_Tests' name='TC_ciph_mode_a5_1' time='MASKED'/>
   <testcase classname='BSC_Tests' name='TC_ciph_mode_a5_3' time='MASKED'/>

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24667
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I83eca18d1b3d8d58177aa3750935ec5a3a985ca4
Gerrit-Change-Number: 24667
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210621/d8e334f6/attachment.htm>


More information about the gerrit-log mailing list