From 26a3db7d707fe6a2673825dde408d9be8f473bf3 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 9 Jul 2021 13:51:29 +0200 Subject: [PATCH] bsc: change encryption a5 via VTY where needed Do not assume that osmo-bsc.cfg contains "0 1 3 4" for master and "0 1 3" for latest anymore. An upcoming test will need to change the value as the test runs and needs a defined value to reset to. Assume that osmo-bsc.cfg contains "0 1 3" and change it to "0 1 3 4" only for TC_ciph_mode_a5_4. Related: OS#4975 Related: docker-playground I55135ca00ef51de5cf6eaec75cfc20c21beef665 Change-Id: I3cf36c6ef86a0db050507f3737f4b0c10dcd52ed --- bsc/BSC_Tests.ttcn | 15 +++++++++++++++ bsc/osmo-bsc.cfg | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b85aa6305..6bea49e33 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -3304,6 +3304,19 @@ runs on MSC_ConnHdlr { fn.apply(id); } +private function f_vty_encryption_a5(charstring options) runs on test_CT { + f_vty_transceive(BSCVTY, "configure terminal"); + f_vty_transceive(BSCVTY, "network"); + f_vty_transceive(BSCVTY, "encryption a5 " & options); + f_vty_transceive(BSCVTY, "exit"); + f_vty_transceive(BSCVTY, "exit"); +} + +private function f_vty_encryption_a5_reset() runs on test_CT { + /* keep in sync with docker-playground.git ttcn3-bsc-test/osmo-bsc.cfg */ + f_vty_encryption_a5("0 1 3"); +} + /* 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 := f_gen_exp_compl(); @@ -3356,9 +3369,11 @@ testcase TC_ciph_mode_a5_4() runs on test_CT { pars.encr := valueof(t_EncrParams('10'O, f_rnd_octstring(8), f_rnd_octstring(16))); f_init(1, true); + f_vty_encryption_a5("0 1 3 4"); f_sleep(1.0); vc_conn := f_start_handler(refers(f_tc_ciph_mode_a5), pars); vc_conn.done; + f_vty_encryption_a5_reset(); f_shutdown_helper(); } /* establish initial channel, enable ciphering followed by assignment to ciphered channel */ diff --git a/bsc/osmo-bsc.cfg b/bsc/osmo-bsc.cfg index 7b0fa2abe..b64a63df3 100644 --- a/bsc/osmo-bsc.cfg +++ b/bsc/osmo-bsc.cfg @@ -69,7 +69,7 @@ cs7 instance 0 network network country code 1 mobile network code 1 - encryption a5 0 1 3 4 + encryption a5 0 1 3 neci 1 paging any use tch 0 handover 1