summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-09 17:24:47 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-04-09 17:24:47 +0000
commit36e6657f9767b6a187747b8c6ad7c5c43b01cc17 (patch)
tree9b45be91a588abc55b54057992c182e828c553a0
parent6c509bd014de8ca157fa945e5e549e031d0635a8 (diff)
vamos funeels/wip
-rw-r--r--bsc/BSC_Tests_VAMOS.ttcn143
1 files changed, 17 insertions, 126 deletions
diff --git a/bsc/BSC_Tests_VAMOS.ttcn b/bsc/BSC_Tests_VAMOS.ttcn
index e1111f6..88e41ff 100644
--- a/bsc/BSC_Tests_VAMOS.ttcn
+++ b/bsc/BSC_Tests_VAMOS.ttcn
@@ -1,4 +1,4 @@
-module BSC_Tests {
+module BSC_Tests_VAMOS {
/* Integration Tests for OsmoBSC
* (C) 2017-2018 by Harald Welte <laforge@gnumonks.org>
@@ -73,6 +73,9 @@ import from GSM_SystemInformation all;
import from GSM_RestOctets all;
import from TCCConversion_Functions all;
+import from RAN_Emulation all;
+import from MSC_ConnectionHandler all;
+
const integer NUM_BTS := 3;
const integer NUM_MSC := 3;
@@ -116,14 +119,14 @@ const SystemInformationConfig SystemInformationConfig_omit := {
si6 := omit
};
-/* tr_EUTRAN_CellDesc with defaults used in BSC_Tests.ttcn */
+/* tr_EUTRAN_CellDesc with defaults used in BSC_Tests_VAMOS.ttcn */
template EUTRAN_CellDesc tr_EUTRAN_CellDesc_default(template (present) uint16_t e_arfcn := ?,
template uint3_t meas_bw := 3)
:= tr_EUTRAN_CellDesc(e_arfcn := e_arfcn,
meas_bw_presence := '1'B,
meas_bw := meas_bw);
-/* tr_EUTRAN_NeighbourCells with defaults used in BSC_Tests.ttcn */
+/* tr_EUTRAN_NeighbourCells with defaults used in BSC_Tests_VAMOS.ttcn */
template EUTRAN_NeighbourCells tr_EUTRAN_NeighbourCells_default(template (present) EUTRAN_CellDescs cell_desc_list := { tr_EUTRAN_CellDesc_default },
template uint3_t prio := 3,
template (present) uint5_t thresh_high := 20,
@@ -602,129 +605,6 @@ modulepar {
uint8_t mp_exp_ms_power_level := 7;
}
-private function f_gen_test_hdlr_pars(integer bssap_idx := 0) return TestHdlrParams {
-
- var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
- if (mp_bssap_cfg[bssap_idx].transport == BSSAP_TRANSPORT_AoIP) {
- pars.aoip := true;
- } else {
- pars.aoip := false;
- }
- pars.exp_ms_power_level := mp_exp_ms_power_level;
- pars.mscpool.bssap_idx := bssap_idx;
-
- return pars;
-}
-
-/* Convenience functions for rate counters using g_ctr_msc. */
-
-private function f_ctrs_msc_init(integer mscs_count := NUM_MSC, CounterNameVals counternames := counternames_msc_mscpool) runs on test_CT {
- g_ctr_msc := f_counter_name_vals_get_n(IPA_CTRL, "msc", mscs_count, counternames);
- log("initial msc rate counters: ", g_ctr_msc);
-}
-
-private function f_ctrs_msc_add(integer msc_nr, charstring countername, integer val := 1) runs on test_CT {
- f_counter_name_vals_list_add(g_ctr_msc, msc_nr, countername, val);
-}
-
-/* f_ctrs_msc_init();
- * f_do_thing(on_msc := 0);
- * f_do_thing(on_msc := 0);
- * f_do_other(on_msc := 1);
- * f_ctrs_msc_add(0, "thing", 2);
- * f_ctrs_msc_add(1, "other");
- * f_ctrs_msc_verify();
- */
-private function f_ctrs_msc_verify() runs on test_CT {
- log("verifying msc rate counters: ", g_ctr_msc);
- f_counter_name_vals_expect_n(IPA_CTRL, "msc", g_ctr_msc);
-}
-
-/* convenience: f_ctrs_msc_add() and f_ctrs_msc_verify() in one call.
- * f_ctrs_msc_init();
- * f_do_thing(on_msc := 0);
- * f_do_thing(on_msc := 0);
- * f_do_thing(on_msc := 0);
- * f_ctrs_msc_expect(0, "thing", 3);
- */
-private function f_ctrs_msc_expect(integer msc_nr, charstring countername, integer val := 1) runs on test_CT {
- f_ctrs_msc_add(msc_nr, countername, val);
- f_ctrs_msc_verify();
-}
-
-/* Convenience functions for rate counters using g_ctr_bts, always also including g_ctr_bsc. */
-
-private function f_ctrs_bsc_and_bts_init(integer bts_count := NUM_BTS, CounterNameVals counternames := counternames_bsc_bts_handover) runs on test_CT {
- g_ctr_bts := f_counter_name_vals_get_n(IPA_CTRL, "bts", bts_count, counternames);
- log("initial bts rate counters: ", g_ctr_bts);
- f_ctrs_bsc_init(counternames);
-}
-
-private function f_ctrs_bsc_and_bts_add(integer bts_nr, charstring countername, integer val := 1) runs on test_CT {
- f_counter_name_vals_list_add(g_ctr_bts, bts_nr, countername, val);
- f_ctrs_bsc_add(countername, val);
-}
-
-/* f_ctrs_bsc_and_bts_init();
- * f_do_thing(on_bts := 0);
- * f_do_thing(on_bts := 0);
- * f_do_other(on_bts := 1);
- * f_ctrs_bsc_and_bts_add(0, "thing", 2);
- * f_ctrs_bsc_and_bts_add(1, "other");
- * f_ctrs_bsc_and_bts_verify();
- */
-private function f_ctrs_bsc_and_bts_verify() runs on test_CT {
- f_counter_name_vals_expect_n(IPA_CTRL, "bts", g_ctr_bts);
- f_ctrs_bsc_verify();
-}
-
-/* convenience: f_ctrs_bsc_and_bts_add() and f_ctrs_bsc_and_bts_verify() in one call.
- * f_ctrs_bsc_and_bts_init();
- * f_do_thing(on_bts := 0);
- * f_do_thing(on_bts := 0);
- * f_do_thing(on_bts := 0);
- * f_ctrs_bsc_and_bts_expect(0, "thing", 3);
- */
-private function f_ctrs_bsc_and_bts_expect(integer bts_nr, charstring countername, integer val := 1) runs on test_CT {
- f_ctrs_bsc_and_bts_add(bts_nr, countername, val);
- f_ctrs_bsc_and_bts_verify();
-}
-
-
-/* Convenience functions for rate counters using g_ctr_bsc. */
-
-private function f_ctrs_bsc_init(CounterNameVals counternames := counternames_bsc_bts_handover) runs on test_CT {
- g_ctr_bsc := f_counter_name_vals_get_n(IPA_CTRL, "bsc", 1, counternames);
- log("initial bsc rate counters: ", g_ctr_bsc);
-}
-
-private function f_ctrs_bsc_add(charstring countername, integer val := 1) runs on test_CT {
- f_counter_name_vals_list_add(g_ctr_bsc, 0, countername, val);
-}
-
-/* f_ctrs_bsc_init();
- * f_do_thing();
- * f_do_thing();
- * f_do_other();
- * f_ctrs_bsc_add("thing", 2);
- * f_ctrs_bsc_add("other");
- * f_ctrs_bsc_verify();
- */
-private function f_ctrs_bsc_verify() runs on test_CT {
- f_counter_name_vals_expect_n(IPA_CTRL, "bsc", g_ctr_bsc);
-}
-
-/* convenience: f_ctrs_bsc_add() and f_ctrs_bsc_verify() in one call.
- * f_ctrs_bsc_init();
- * f_do_thing();
- * f_ctrs_bsc_expect("thing", 1);
- */
-private function f_ctrs_bsc_expect(charstring countername, integer val := 1) runs on test_CT {
- f_ctrs_bsc_add(countername, val);
- f_ctrs_bsc_verify();
-}
-
-
private function f_shutdown_helper() runs on test_CT {
all component.stop;
setverdict(pass);
@@ -915,6 +795,17 @@ private function f_vty_allow_osmux(boolean allow) runs on test_CT {
g_osmux_enabled := allow;
}
+type record of charstring Commands;
+
+private function f_cs7_inst_0_cfg(TELNETasp_PT pt, Commands cmds := {})
+{
+ f_vty_enter_cfg_cs7_inst(pt, 0);
+ for (var integer i := 0; i < sizeof(cmds); i := i+1) {
+ f_vty_transceive(pt, cmds[i]);
+ }
+ f_vty_transceive(pt, "end");
+}
+
function f_init_vty(charstring id := "foo") runs on test_CT {
if (BSCVTY.checkstate("Mapped")) {
/* skip initialization if already executed once */