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
This commit is contained in:
Neels Hofmeyr 2021-06-11 00:10:02 +02:00 committed by neels
parent 40bc162398
commit 04d6e6acb6
2 changed files with 43 additions and 15 deletions

View File

@ -3415,26 +3415,54 @@ testcase TC_assignment_fr_a5_1_codec_missing() runs on test_CT {
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 @@ control {
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() );

View File

@ -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'/>