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
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a63d536..cda0687 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -3611,33 +3611,31 @@
 
 /* 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 {
diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn
index a51794f..b291b03 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -174,6 +174,14 @@
 	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)) {