Commit Graph

22 Commits

Author SHA1 Message Date
Harald Welte 4038d4c4bd sccp: Add TC_process_rx_xudt, verifying reception of SCCP XUDT
Test if a XUDT SCCP message is processed by libosmo-sigtran.  We
assume any XUDT is received (and echoed back) just like normal UDT.

Related: OS#5281, SYS#5674
Change-Id: Idbf6db7a684e51858129618b2fcffcbe55b1b70f
2021-10-26 14:43:33 +02:00
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Harald Welte aed9f94db4 sccp: Add TC_callingparty_ssn_only()
This test verifies that libosmo-sccp will properly respond to SCCP
traffic that only has a SSN in the CallingPartyAddress.  That situation
poses the unique challenge of how to route a response, as we lack
a GT and a PC to do the routing.

In order to support this, libosm-sccp now adds the PC into the
CallingPartyAddr when passing such messages from M3UA to SCCP. This
way the recipient can simply respond back to that address and it will
be routed on PC.

Change-Id: Ided599a922fb7f6dbbfe90f817c5419ab793f293
Related: OS#5146
2021-05-13 21:58:33 +02:00
Harald Welte 24f921baea sccp: Add Tests for SCMG SST procedure
The SST procedure can be used by any SCCP node to test the availability
of a remote SSN.  If the specified remote SSN is available at the
specified PC, a SCMG SSA is returned.  If not, there's a timeout.

Test for SSN=1 (SCMG), another non-SCMG SSN that exists, and for one
SSN that doesn't exist.

Change-Id: If3f5f3144c0ed83d0bda5953522a9d73287c8ba2
2021-02-11 12:00:29 +00:00
Pau Espin e30d543576 sccp: Introduce test TC_it_avoids_tiar
Related: OS#4343
Change-Id: I3a970a9b7ed7fb178095760025dd83c570dcff5e
2020-01-21 14:22:20 +01:00
Pau Espin 1269b1b4c6 sccp: verify inactivity timers are not started in TC_udt_without_cr_cc
Related: OS#4343
Change-Id: I2cc5e41e33aac300d33887caed1cc3fbdffcbb17
2020-01-21 14:22:15 +01:00
Pau Espin 392eaf32fe sccp: Don't use hardcoded SCCP local references
as tests are added or order is changed, local references used by the system under test may
change, so let's take and use the one notified instead of harcoding
values.

Change-Id: I2b52cc637c20d5644f413030edd9040a6e6bfe2f
2020-01-21 13:18:41 +01:00
Pau Espin f7ba234acf sccp: Introduce TC_udt_without_cr_cc
Change-Id: I752af1ae4a34d8d72472e716fe721198f1ba46b1
2020-01-20 20:24:10 +01:00
Pau Espin a2473da683 sccp: Introduce test TC_tiar_timeout
Existing templates are moved to SCPP_Templates.ttcn and new ones
required for the test are added there.

Related: OS#4343
Change-Id: I7b56fe77ac3b350d722c74b043e6ecabc48dcf31
2020-01-20 20:15:26 +01:00
Pau Espin 94b7a68f76 sccp: Stop test on rx unexpected sccp msg
Change-Id: I3889d7f275d3461fb51209d28c101a5570aca9b3
2020-01-20 19:31:46 +01:00
Pau Espin e187091e16 sccp: Rename module param sccp_cfg to mp_sccp_cfg
Change-Id: Ied9fbfb9bd35a99205ca13db033dd9ea03d51238
2020-01-17 17:34:23 +01:00
Harald Welte 9adf57b5ac Add SCCP_Tests_RAW for testing the actual SCCP implementation
Using SCCP_Tests_RAW.ttcn we can trasnceive decoded MTP3 primitives
containing decoded SCCP messages against a remote SCCP implementation.

Related: OS#4343
Change-Id: I07c43cfac9cdbdeccf102cd08309ca9ec64968cc
2020-01-17 17:34:23 +01:00
Pau Espin c64d7269b2 sccp: Modify SCCP_tests to be run against sccp_demo_user in srv mode
It's easier to handle several tests if they are the ones connecting to
the program under tests.
Forthcoming SCCP_Tests_RAW require use of this mode too.

Take the chance to tweak other values which were wrong, in order to have
CR answered correctly with a CC later on.

Related: OS#4343
Change-Id: Ibf99b1546411b9a9b4375b82f1003d93d3c1645d
2020-01-17 17:25:46 +01:00
Harald Welte 29adc89e60 SCCP_Tests.default: Use "SccpDemoUser" as VTY prompt
It seems that our TTCN3 VTY/Telnet module no longer supports '-'
inside prompt.  However, older sccp_demu_user programs in
libosmo-sccp.git before Change-Id
I4b6d7dd6fdf7521a4a9071e50ac1dcb2993c74bb use this.

Let's adjust our expectation here to the new dash-less variant.

Change-Id: Ib00f1f89bf1484d8a8e07be8c0a1fc849bcf03a0
2020-01-12 11:48:58 +01:00
Pau Espin acc5119bac lib/IPA_Emulation: Build IPA_CTRL conditionally based on define
Change-Id: I4d1eca6b0008a395b7f7449e6ea3f9b6d41133c7
2019-06-13 16:33:49 +02: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
Daniel Willmann d93047434b Add Misc_Helpers.ttcn to centralize TTCN3 shutdown handling
This function can now be called from anywhere to try and safely shutdown
a testcase. It is not optimal as we can't call "all component.stop" from
outside the mtc, but without any proper and orderly shutdown handling of
all our emulation components I believe this is the best we can do.

To use it:

import from Misc_Helpers all;

in your module and then call

Misc_Helpers.f_shutdown(__BFILE__, __LINE__);

You can also pass the function a verdict and a message and it will take care
of calling setverdict, but beware of the following:

While setverdict would accept any number of arguments as log message
and convert them to a log string f_shutdown expects one charstring.
It's possible to use the log2str function to use the log arguments in
setverdict for f_shutdown, for example

setverdict(fail, "Template didn't match: ", tmpl_foo);
would become
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Template didn't match: ", tmpl_foo));

Change-Id: I84d1aa6732f6b748d2bfdeac8f6309023717f267
2018-10-24 15:10:13 +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
Neels Hofmeyr bf3cf5c8bc Revert "detect VTY TELNET port connection failures in TTCN3 tests"
With this patch, I see all ttcn3-bsc-tests failing with
"Verdict: fail reason: VTY Timeout for prompt"

This reverts commit cb111b21ab.

Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140
2018-07-27 13:01:26 +00:00
Stefan Sperling cb111b21ab detect VTY TELNET port connection failures in TTCN3 tests
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.

Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1
Related: OS#3149
2018-07-27 07:40:10 +00:00
Stefan Sperling c307e689b4 introduce a TTCN3 test suite for SCCP
This test suite acts as an SCCP server on top of M3UA.

SCCP tests are run against the sccp_demo_user program which
can be found in libosmo-sccp/examples. This program must be
started in client mode: sccp_demo_user -c
The SCCP test suite should then work out of the box with
the provided SCCP_Tests.cfg file and this additional change
to sccp_demo_user default point codes:
https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/

There is currently only one test, for the libosmo-sccp crash
reported as issue OS#2666. The implementation of this test
is currently using an ugly workaround due to shortcomings of
the M3UA Emulation layer (see source code comments). Whether
a better solution is feasible is still to be determined.

The test requires a patch to the SCCP Protocol Emulation which
has been submitted upstream: https://git.eclipse.org/r/#/c/124552/

Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8
Related: OS#2666
2018-07-24 19:05:10 +00:00