osmo-bsc/tests/handover
Neels Hofmeyr 1a3eaeff2e handover_test: implement as VTY shell
Drop the string arrays, and move the 32 handover tests to separate
script files. Instead of the peculiar implementation and instead of
cryptic commands, implement the handover test scripts as a VTY.

handover_test.c now sets up a VTY with handover testing VTY commands. It
also features the complete and unabridged VTY configuration nodes of
osmo-bsc itself. That allows dropping various ho script commands.

Before:

  static char *test_case_14[] = {
      "Handover to congested cell, if RX level is below minimum\n\n"
      "The better neighbor cell is congested, so no handover is performed.\n"
      "If the RX level of the current cell drops below minimum acceptable\n"
      "level, the handover is performed.\n",

      "create-n-bts", "2",
      "create-ms", "0", "TCH/F", "AMR",
      "expect-ts-use", "0", "0", "*", "TCH/F", "-", "-", "-", "-", "-", "-",
      "set-min-free", "1", "TCH/F", "4",
      "set-min-free", "1", "TCH/H", "4",
      "meas-rep", "0","0","1","0", "10","0", "1","0","30",
      "expect-no-chan",
      "meas-rep", "0","0","1","0", "9","0", "1","0","30",
      "expect-chan", "1", "1",
      "ack-chan",
      "expect-ho", "0", "1",
      "ho-complete",
      "expect-ts-use", "0", "0", "*", "-", "-", "-", "-", "-", "-", "-",
      "expect-ts-use", "1", "0", "*", "TCH/F", "-", "-", "-", "-", "-", "-",
  }

After:

  # Handover to congested cell, if RX level is below minimum
  # The better neighbor cell is congested, so no handover is performed.
  # If the RX level of the current cell drops below minimum acceptable
  # level, the handover is performed.

  create-n-bts 2
  set-ts-use trx 0 0 states * TCH/F - - - - - -
  network
   bts 1
    handover2 min-free-slots tch/f 4
    handover2 min-free-slots tch/h 4
  meas-rep lchan 0 0 1 0 rxlev 10 rxqual 0 ta 0 neighbors 30
  expect-no-chan
  meas-rep lchan 0 0 1 0 rxlev 9 rxqual 0 ta 0 neighbors 30
  expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0
  expect-ts-use trx 0 0 states * - - - - - - -
  expect-ts-use trx 1 0 states * TCH/F - - - - - -

Note how osmo-bsc's stock vty config nodes seamlessly integrate in the
test steps: just enter a configuration node, modify some values, and
indenting trivially takes care of exiting nodes correctly.

Running a test manually:
	./handover_test test_0123.ho_vty

Instead of calling each test separately in testsuite.at, have a
handover_tests.sh script that picks up new tests just by presence of
files named test*.ho_vty.

Rationale:

It was considered to move handover tests to the TTCN suite, but there is
an advantage in having these C tests: they run super fast and catch bugs
even in the gerrit verification job, potentially saving a lot of time.

It is a reality that I need more of these tests, for dynamic timeslots
and TCH/F <-> TCH/H switches. The way the handover tests are written, as
arrays of strings containing cryptic fixed-argument script commands, has
been a pain to work with from the start, and now I am no longer willing
to endure that pain.

Change-Id: Ie238ebe41039d3fa44c9699937589e000883e052
2020-12-23 01:59:08 +00:00
..
Makefile.am handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
handover_test.c handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
handover_tests.ok handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
handover_tests.sh handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
neighbor_ident_test.c large refactoring: use FSMs for lchans; add inter-BSC HO 2018-07-28 12:18:23 +02:00
neighbor_ident_test.err inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells 2018-07-28 12:18:23 +02:00
neighbor_ident_test.ok inter-BSC HO: neighbor_ident API: drop 9bit BSIC 2018-07-28 12:18:23 +02:00
test0000.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0001.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0002.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0003.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0004.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0005.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0006.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0007.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0008.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0009.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0010.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0011.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0012.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0013.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0014.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0015.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0016.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0017.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0018.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0019.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0020.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0021.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0022.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0023.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0024.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0025.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0026.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0027.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0028.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0029.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0030.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0031.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00
test0032.ho_vty handover_test: implement as VTY shell 2020-12-23 01:59:08 +00:00