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
diff --git a/tests/testsuite.at b/tests/testsuite.at
index afff9c5..17153cc 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -51,200 +51,8 @@
 AT_CHECK([$abs_top_builddir/tests/handover/neighbor_ident_test], [], [expout], [experr])
 AT_CLEANUP
 
-AT_SETUP([handover test 0])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 1])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 2])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 3])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 4])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 5])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 6])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 7])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 8])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 9])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 10])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 11])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 12])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 13])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 14])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 15])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 16])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 17])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 18])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 19])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 20])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 21])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 22])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 23])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 24])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 25])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 26])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 27])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 28])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 29])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 29], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 30])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 30], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 31])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 31], [], [expout], [ignore])
-AT_CLEANUP
-
-AT_SETUP([handover test 32])
-AT_KEYWORDS([handover])
-cat $abs_srcdir/handover/handover_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/handover/handover_test 32], [], [expout], [ignore])
+AT_SETUP([handover_tests])
+AT_KEYWORDS([handover_tests])
+cat $abs_srcdir/handover/handover_tests.ok > expout
+AT_CHECK([$abs_srcdir/handover/handover_tests.sh $abs_srcdir/handover $abs_builddir/handover], [], [expout], [ignore])
 AT_CLEANUP