add f_vty_cfg_bts(), f_vty_cfg_msc()

These allow passing N vty configurations on the bts / msc node without
requiring subsequent 'exit'.

As an example, use f_vty_cfg_msc() in BSC_Tests.ttcn AMR config.

Change-Id: I9f3e485f692acb3d2a7620e9b454b372651be78e
changes/69/21369/3
Neels Hofmeyr 2 years ago committed by neels
parent 1a1f854ed2
commit 2a5670be4f
  1. 42
      bsc/BSC_Tests.ttcn
  2. 8
      library/Osmocom_VTY_Functions.ttcn

@ -3611,33 +3611,31 @@ testcase TC_assignment_codec_efr() runs on test_CT {
/* Allow 5,90k only (current default config) */
private function f_allow_amr_rate_5_90k() runs on test_CT {
f_vty_enter_cfg_msc(BSCVTY, 0);
f_vty_transceive(BSCVTY, "amr-config 12_2k forbidden");
f_vty_transceive(BSCVTY, "amr-config 10_2k forbidden");
f_vty_transceive(BSCVTY, "amr-config 7_95k forbidden");
f_vty_transceive(BSCVTY, "amr-config 7_40k forbidden");
f_vty_transceive(BSCVTY, "amr-config 6_70k forbidden");
f_vty_transceive(BSCVTY, "amr-config 5_90k allowed");
f_vty_transceive(BSCVTY, "amr-config 5_15k forbidden");
f_vty_transceive(BSCVTY, "amr-config 4_75k forbidden");
f_vty_transceive(BSCVTY, "exit");
f_vty_transceive(BSCVTY, "exit");
f_vty_cfg_msc(BSCVTY, 0, {
"amr-config 12_2k forbidden",
"amr-config 10_2k forbidden",
"amr-config 7_95k forbidden",
"amr-config 7_40k forbidden",
"amr-config 6_70k forbidden",
"amr-config 5_90k allowed",
"amr-config 5_15k forbidden",
"amr-config 4_75k forbidden"
});
}
/* Allow 4,75k, 5,90k, 4,70k and 12,2k, which are the most common rates
* ("Config-NB-Code = 1") */
private function f_allow_amr_rate_4_75k_5_90k_7_40k_12_20k() runs on test_CT {
f_vty_enter_cfg_msc(BSCVTY, 0);
f_vty_transceive(BSCVTY, "amr-config 12_2k allowed");
f_vty_transceive(BSCVTY, "amr-config 10_2k forbidden");
f_vty_transceive(BSCVTY, "amr-config 7_95k forbidden");
f_vty_transceive(BSCVTY, "amr-config 7_40k allowed");
f_vty_transceive(BSCVTY, "amr-config 6_70k forbidden");
f_vty_transceive(BSCVTY, "amr-config 5_90k allowed");
f_vty_transceive(BSCVTY, "amr-config 5_15k forbidden");
f_vty_transceive(BSCVTY, "amr-config 4_75k allowed");
f_vty_transceive(BSCVTY, "exit");
f_vty_transceive(BSCVTY, "exit");
f_vty_cfg_msc(BSCVTY, 0, {
"amr-config 12_2k allowed",
"amr-config 10_2k forbidden",
"amr-config 7_95k forbidden",
"amr-config 7_40k allowed",
"amr-config 6_70k forbidden",
"amr-config 5_90k allowed",
"amr-config 5_15k forbidden",
"amr-config 4_75k allowed"
});
}
testcase TC_assignment_codec_amr_f() runs on test_CT {

@ -174,6 +174,14 @@ function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
f_vty_config2(pt, {config_node}, cmd);
}
function f_vty_cfg_bts(TELNETasp_PT pt, BtsNr bts := 0, rof_charstring cmds) {
f_vty_config3(pt, {"network", "bts " & int2str(bts)}, cmds);
}
function f_vty_cfg_msc(TELNETasp_PT pt, MscNr msc := 0, rof_charstring cmds) {
f_vty_config3(pt, {"msc " & int2str(msc)}, cmds);
}
function f_vty_transceive_match(TELNETasp_PT pt, charstring cmd, template charstring exp_ret) {
var charstring ret := f_vty_transceive_ret(pt, cmd);
if (not match(ret, exp_ret)) {

Loading…
Cancel
Save