Commit Graph

24 Commits

Author SHA1 Message Date
Neels Hofmeyr 2a5670be4f 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
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 1a1f854ed2 add f_vty_config3(), to run N commands on a sub-node
f_vty_config2() makes it convenient to enter a specific vty node without
needing to send 'exit'/'end' explicitly. However, to pass multiple
commands on the same node, the VTY would enter and exit the node for
each call of f_vty_config2(). The new f_vty_config3() also allows
multiple commands to be run on that same node without intermediate
exiting.

Change-Id: If969ac645aa82e5a36245d974de2a251633de111
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 9ebabc8b0e vty: log failed vty command
Add a log label argument to f_vty_wait_for_prompt(), and feed the sent
command from f_vty_transceive*(), so that the failure verdict already
lists the vty command that caused the failure.

A common error is to issue insufficient 'exit' commands, so that I often
think the newly added VTY command failed, even though it is a subsequent
command causing the failure. I want to shorten the "time-to-aha" there.

Change-Id: Icfd739db150d86e9256a224f12dc979dcd77879f
2020-11-26 01:04:57 +00:00
Neels Hofmeyr 5c59a8f04a another fixup for "fix mscpool cleanup (fixes LCLS tests)"
During patch grooming of the previous fixup, one patch line went missing, which
breaks the ttcn3-bsc-test-latest completely. Add that change now.

Change-Id: I75295d638072df9f5213a7e74e4a960c009c2865
2020-08-12 11:19:23 +00:00
Neels Hofmeyr 345a15f213 log: for VTY Unknown Command, fix weird log message
In f_vty_wait_for_prompt(), this:

   testcase.stop(fail, "VTY: Unknown Command")

outputs:

   failVTY: Unknown Command

The first stop() argument 'fail' is not actually a test verdict, but gets
rolled into a log output string, becoming "failVTY".

Fix that by simply using the normal pattern of setverdict() followed by
mtc.stop().

Change-Id: Id09986444de02c10b4fba582d454d54568b6e8a2
2020-08-12 01:05:59 +00:00
Neels Hofmeyr e4b0a662ca fixup for "fix mscpool cleanup (fixes LCLS tests)"
For the VTY "Unknown Command" code path, we must actually call 'repeat', to
avoid racey VTY behavior from cruft stuck in the VTY pipe.

The missing 'repeat' caused massive random fallout in the 'latest' builds,
which often hits the 'Unknown Command' code path; fixed by this patch.

Change-Id: Ibd5adb359b3fb302e2c70700d911878aef605ff3
2020-08-12 01:05:48 +00:00
Neels Hofmeyr 2fe5ad171d f_vty_transceive: allow to ignore unknown vty commands
When a new test uses a VTY configuration that may not yet be available in the
'latest' build, it can be useful to ignore the "Unknown VTY Command" error.

To be used by f_init() for multiple MSCs, setting a default 'allow-attach' flag
per MSC implicitly -- such vty config is not yet supported in the latest build.

Change-Id: I284c42e10c0cb282c8410db87959b471867edef6
2020-08-10 20:16:09 +00:00
Pau Espin c675b6119c bsc: Introduce test TC_chan_rel_sccp_tiar_timeout
Verify SCCP T(iar) timeout triggers release of established channel.

Change-Id: Ic2724f62689b99c33e2e5c3a0c2fd022178a788c
2020-01-12 13:11:39 +00:00
Pau Espin 1a4d4e97b7 library: VTY: Allow hyphens in VTY prompt
Old versions of osmo-pcu print "Osmo-PCU" as VTY prompt. This commit
allows supporting this kind of prompt.

Change-Id: Ia5acbbe5828901726f7f15c4a99d596e94914c4b
2019-12-04 22:26:33 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Philipp Maier d0e64b07dd BSC_Tests: add testcases to verify S15-S0 handling
The handling of the AMR rate configuration bits S15-S0 is currently only
superficially checked. Lets add more some more elaborated testcases to
check through varios different situations. Also make sure that the
resulting mr configuration IE is verified

Change-Id: Ica323deb9836deea72982e093c9cb31deb5a216b
Related: SYS#4470
2019-03-19 13:29:31 +00:00
Stefan Sperling cff13563cf attempt to fix a race condition in BSC test's f_ts_dyn_mode_get
Add two helper functions which retry a VTY command until the
result matches a regular expression or a configurable timeout
expires.

Use these functions in BSC test's f_ts_dyn_mode_get, which has
seen sporadic failures due to a race condition during channel
reconfiguration, in order to hopefully close this race.

Change-Id: I308ddb06e440c165fe1e73fe2c1fb78be2e1d510
Related: OS#3690
2018-11-15 13:02:20 +00:00
Vadim Yanitskiy ea247d5ceb library/VTY: fix CONFIG prompt matching in f_vty_wait_for_prompt()
Matching the CONFIG prompt using implicit '\w+(*)' pattern is
a bad idea, because it can actually match almost anything:

  - 'OsmoBlaBla(config)# ',
  - 'OsmoBlaBla(config) ',
  - 'OsmoBlaBla> ',
  - 'Mahlzeit'!

One problem is that the parentheses are interpreted as a matching
operator (which is used to group an expression), so they should
have been escaped by '\'. Another problem is that this pattern
is not complete, because '\# ' is missing. Let's fix this!

Change-Id: I8a0e3fcfb0c4e5854b7b1e39296052e679c63c73
Related: OS#3675
2018-10-28 23:03:44 +07:00
Harald Welte a266325929 Osmocom_VTY_Functions: Generalize to handle multiple VTY ports
The existing Osmocom_VTY_Functions code was centered around a global
module parameter specifying the prompt prefix.  This prevented a
single test to use multiple VTY connections to different Osmocom
programs.

This patch generalize the code by widening the prompt matching
in f_vty_wait_for_prompt() and by allowing the caller to specify
the prompt prefix to override the modulepar.

Change-Id: I574b56c42fe95540af44a2c43d0fb469938c0e65
2018-09-16 12:41:11 +02:00
Stefan Sperling 23b45974ce detect VTY TELNET port connection failures (attempt #2)
Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to
the TELNET port by default. This allows tests to make progress
into an error handling path if they are started while the osmo-*
program they want to connect on VTY is not running.

Observed with osmo-ggsn tests, where if the one test runs
into a VTY connection failure the subsequent test would get
stuck forever in a map() call on the VTY TELNET port.

Teach the function f_vty_wait_for_prompt() about connection
reports by the TELNET module. We may now receive an integer which
represents the socket file descriptor for the telnet connection.
This case was not handled by the previous change made in
commit cb111b21ab. As a result,
BSC tests started failing with "VTY Timeout for prompt" because
the alt-statement in f_vty_wait_for_prompt() would not progress
past the integer sitting on the VTY port's receive queue.

Change-Id: I56925f93af6c55e93f3f417099db135744da6a40
Related: OS#3149
2018-07-27 17:20:38 +02:00
Daniel Willmann e4ff537f9b library: Ensure setverdict(fail) is followed by mtc.stop
This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Using testcase.stop instead for errors internal to our test
infrastructure to mark them as test errors instead of failed.

Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778
2018-07-24 09:54:18 +00:00
Alexander Couzens 1e6d990540 Osmocom_VTY_Functions: introduce f_vty_transceive_not_match()
fails when vty response match template.

Change-Id: I489d2a47cd4690dcfc3f1042c332014593d082a2
2018-06-12 13:51:14 +02:00
Alexander Couzens 98aa59e064 Osmocom_VTY_Functions: move f_vty_transceive_match from HLR to this library
f_vty_transceive_match will be used by future SGSN tests.

Change-Id: Ia69ab6d5639c2e10059f88c8cc97463820cb72e6
2018-06-12 13:51:14 +02:00
Harald Welte f640a01311 msc: Add SMPP tests for MO + MT SMS
Change-Id: I5349559c7c3096533fb07fcf53f0a44ff7f6567f
2018-04-14 21:58:16 +02:00
Harald Welte 930d0a70e3 bsc: Fix tons of TTCN3 compiler warnings
Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
2018-03-23 12:32:00 +00:00
Harald Welte 8734231093 Osmocom_VTY_Functions: Less logging verbosity
We don't need to print all prompts at start of every test case

Change-Id: I32d13b6f97f76ab6057cc213c1698c1eb97b9d90
2018-03-18 22:46:14 +01:00
Harald Welte 872ce17d35 move f_vty_config() from MSC_Tests to Osmocom_VTY_Functions
Change-Id: Ie7373c28b1d2b76f8d637ac6c86976fd341e3e2c
2018-02-18 10:23:41 +01:00
Harald Welte 553f655035 Osmocom_VTY_Functions: Make prompt configurable
We want to use this code also for OsmoMSC testing, so let's make the
prefix configurable as module parameter.

Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee
2018-01-24 18:53:32 +01:00
Harald Welte 8542cefb8e Move VTY utility functions to new Osmocom_VTY_Functions module
... so it can be reused from other Testsuites/modules
2017-07-19 20:06:26 +02:00