Commit Graph

43 Commits

Author SHA1 Message Date
Pau Espin 95ad6a0112 SIP_Templates: Make tag collisions harder
It was spotted during some test runs that the same tag was assigned to 2
different components. Let's make this way more difficult by adding some
time to it. Asterisk uses longer strings for instance, since 32bits is
the minimum.

Change-Id: Iba26259fd48da1c2558451fe5f7014151d4935c8
2024-04-18 20:17:42 +02:00
Pau Espin 7011bf47c5 asterisk: Introduce test TC_internal_call_momt
Lots of infrastructure added to allow call establishment and hang up
between 2 users connected to Asterisk.

SIP_Tests is updated to accomodate for necessary changes in
SIP_Templates used by Asterisk_Templates.

Change-Id: Ic5827a3e94b06fbc57f6405bf0f0aa6598c5d1fe
Related: SYS#6782
2024-04-10 14:02:11 +02:00
Pau Espin e94a64834d {SIP,Asterisk}_Tests: Mark all components alive
This fixes some dynamic errors occuring due to messages arriving while
tests is being torn down.

Change-Id: I60642071758ad1203196eddd3bbacb84f4dcf9fb
2024-04-10 13:37:58 +02:00
Pau Espin 05eaa1a531 asterisk: Implement and test SIP Digest Authorization
Related: SYS#6782
Change-Id: Ib469f1906927a3f246876040086ff115fbf4c032
2024-04-08 17:36:18 +02:00
Pau Espin fb34d863c3 SIP_Templates: Rework templates to make them more extensible
The existing template system in SIP_Templates made it difficult to craft
specific templates, since it was usually skipping several layers of
fields when passing parameters.

This commit reworks some of those templates, adds news templates, and
cleans formatting for others, as a preparation for further work which
will be done when adding Asterisk_Tests testsuite.

Change-Id: Ifd14213e9c2b8f5061f828a63ef47844828d94ea
2024-04-02 08:22:08 +00:00
Pau Espin 6052a342fe SIP: generate seq_nr within allowed range
Change-Id: Iea5f4568af1bd795db57d2b77e82d976edc9e337
2024-04-02 08:22:08 +00:00
Pau Espin f371375798 sip: Get Rid of private copy of f_mgcp_addr2addrtype()
The function was copied from MGCP_Templates.ttcn since the logic is the
same for SDP, but copied in order to avoid depending on whole MGCP file.
Since now SDP logic has been moved to its own SDP_Templates and a new
f_sdp_addr2addrtype() was added, use that one.

Change-Id: I27ce46b6d23ba0f2704dd0cee290ed519dec278e
2024-03-22 11:28:54 +01:00
Pau Espin a16a6b667b Move f_addrstr2addr() to library/Misc_Helpers.ttcn
This function can easily be reused in other testsuites supporting both
IPv4 and IPv6 addresses.

Change-Id: I4243ec5551f128629b6504ccc59efeb456a6855d
2024-03-22 11:27:19 +01:00
Harald Welte 556e4d2dbc various: update expected-results.xml
Change-Id: I21052636bf892e5da86ef736d16035ec324aedbe
2024-03-04 19:09:58 +00:00
Neels Hofmeyr a0d015bacd sip: make mncc_with_sdp := true the default
A preceding patch has added mncc_with_sdp, defaulting to false.

So far just two new tests use mncc_with_sdp := true, but operation
without SDP is now merely the legacy compatibility mode, and I would
rather nudge new tests towards mncc_with_sdp := true.

So switch the default to mncc_with_sdp := true.

Change-Id: Ic9871917c57a9ab81b2fff0af7f569b09015910c
2023-09-24 17:47:43 +00:00
Neels Hofmeyr 2e3a0e2b70 sip: test SDP forwarding via MNCC
Add CallPars.mncc_with_sdp: when true, the call establishing functions
f_establish_{mo,mt} now send valid SDP via MNCC, and validate that the
SDP received on MNCC and SIP are as expected.

Keep all current tests unchanged with mncc_with_sdp := false: they will
continue to test the case without SDP (for legacy compatibility). These
tests will still pass on the 'latest' builds.

Add two new tests for mncc_with_sdp := true: TC_mt_with_sdp and
TC_mo_with_sdp. These new tests will fail on our 'latest' builds until
the SDP forwarding feature in osmo-sip-connector is released.

Related: osmo-sip-connector I3df5d06f38ee2d122706a9ebffde7db4f2bd6bae
Change-Id: Ib2ae8449e673f5027f01d428d3718c006f76d93e
2023-09-24 17:47:43 +00:00
Neels Hofmeyr fb7f43b8ad sip: pass CallPars into f_TC_*()
Move composition of CallPars out of all f_* functions into their TC_*
functions, so that future tests can reuse the f_* functions with
different CallPars.

An upcoming patch wants to call f_TC_mo_success_rel_sip() with different
CallPars.

Change-Id: Icdcaa7a8a0fadcd6f5715ad052e286b904ded570
2023-09-15 14:53:06 +00:00
Neels Hofmeyr c35b657916 sip: tweak failure reporting for SIP messages
Help developers by logging message matching failures in detail.

Change-Id: Id48016657ebb83953fe74f65332f318edf8f75e6
2023-09-15 14:53:06 +00:00
Neels Hofmeyr d3cca1dffc sip: drop unused var
Change-Id: Id09760238c0e46de2c06e2cc5e7cfd1ffe84cb64
2023-09-15 14:53:06 +00:00
Neels Hofmeyr baf0272d81 sip: tweak log msg
Change-Id: Icf8a88306bf08d6e0d2c62f6c09ce89b36a40254
2023-09-15 14:53:06 +00: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
Pau Espin c3344ea32e sip: Don't need to set default value of MNNC version
The module param default value is already v7, no need to set it.

Change-Id: Idb075f78e1de5a74a442f85dcf2c9e900e5511cb
Related: OS#5042
2021-02-26 13:21:33 +01:00
Alexander Couzens 7d8c0e3b35 update expected-results.xml
Change-Id: Ib4399aa488afd917e3eda5e79d56ea3797ef7c78
2021-01-14 21:40:30 +01:00
Pau Espin 9a5b8ffc5b CTRL: Introduce support to run osmocom CTRL server
Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
2021-01-07 15:06:39 +01:00
Pau Espin 37cf40843e sip: ACK on SIP failure message to avoid it being retransmitted
Otherwise the SIP message is retransmitted by osmo-sip-connector around
10-11 times, even when next test has started, making it fail since it's
not expected.

Change-Id: Icd0f7a7fac4be2aa97eb986c3d3d27dd70a49357
2020-09-28 10:38:07 +00:00
Pau Espin bdd874a2f9 sip: Set & validate IP addresses and ports
Change-Id: Ie382f31b8b414daf598220c2e1b325b821129a40
2020-09-16 10:36:44 +00:00
Pau Espin 563b3d013b mncc: Support IPv6 addresses (new version mncc 7)
Apparently commit 06b859ca31 forgot to
bump the MNCC_SOCK_VERSION field from 5 to 6.

Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
2020-09-16 10:36:44 +00:00
Neels Hofmeyr a4d2100431 update expected results
Change-Id: I37014274ee97f09985c31966e7cc9122fe11a856
2020-05-19 19:25:35 +00:00
Neels Hofmeyr 1c891f229f sip: bump MNCC version sent to sipcon to 6
Match commit Iaca9ed6611fc5ca8ca749bbbefc31f54bea5e925 in osmo-sip-connector.

Change-Id: I39d55432776926a385e1b85b21bcdea8180a8946
2019-11-28 20:57:10 +01:00
Neels Hofmeyr 5e3b5d9ab3 introduce MNCC_Emulation mp_mncc_version
Default the MNCC version to the current osmo-sip-connector's master branch MNCC
version.

As soon as the new version (6) is merged, we can bump it here to make tests for
master work again.

For 'latest' builds, we can adjust osmo-ttcn3-hacks to use version 5, and also
see those tests still passing.

Change-Id: I3eb6e0132dc99ebe41a98cc5c329ed4864b770d6
2019-11-28 20:47:33 +01:00
Oliver Smith e25773980b sip: add osmo-sip-connector.cfg
Add config that works with SIP_Tests.default.

Change-Id: I820a6573fafea9990eabcf40f1b7745558717cc7
2019-11-28 12:20:44 +01:00
Pau Espin 0361193a55 Update README.md of several TTCN3 test suites
Some stuff was wrong and some was missing after new features being
implemented in tests over time.

Change-Id: I7a279592a68ffc76408a8e728e76151534265cc0
2019-11-15 18:49:09 +00: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
Harald Welte ddf011ec4f sip: Add TC_mo_setup_disc_late_rtp for OS#3518
Related: OS#3518
Change-Id: I9d5752e01d6995eff67463c51deaacedc5dcabe7
2019-04-19 15:53:32 +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
Daniel Willmann afce86630c Stop tests after failures
Call mtc.stop after setverdict(fail), add reasons to most failures and
fail with verdict error for internal errors.

Change-Id: I9b618235939fa41160b9be6677b121963d3ec857
2018-07-24 14:19:42 +02:00
Pau Espin a4cecf5af7 Add README.md file for several suites
Content grabbed from [1] and converted to markdown as it's more probable
to have it displayed correctly on popular git repo hosting platforms.
Syntax for embedded graphviz taken from [2].

[1] http://git.gnumonks.org/laforge-slides/plain/2018/osmodevcon2018-ttcn3_test_suites/osmodevcon2018-ttcn3_test_suites.adoc
[2] https://github.com/stlehmann/markdown-graphviz

Change-Id: I9aad03e605569e9613665a7585d60bf308bcb54f
2018-06-14 18:55:36 +02:00
Alexander Couzens 02496257f6 *.default: change logging filemask from ERROR | WARNING to += PARALLEL | VERDICTOP
PARALLEL | VERDICTOP will log when the port is dying or when other
components will change to fail. This helped to find a timeout in the
SGSN tests where a function call message timed out.

Change-Id: I770ac964dc37e2752e7d35e493f707b091c739b0
2018-06-12 13:51:14 +02:00
Neels Hofmeyr fc0384a046 mask timestamps and source file nrs in expected-results.xml files
Prepare for upcoming updates with concise diffs.

Change-Id: Ic9f006aa8db1b477598605e0525faeb229b03641
2018-04-11 19:32:01 +02:00
Neels Hofmeyr 1fd6679d9d fix build: don't clean out expected-results.log: rename to *.xml
'make clean' as generated by ttcn3_makefilegen removes all *.log files, which
of course cleans out expected-results.log, which should not happen. Since this
is a junit XML file, rename the suffix to .xml.

Change-Id: Ic334f6b758eef865e3a497aa430691a3ae696d25
2018-04-11 19:29:18 +02:00
Neels Hofmeyr 3cf797d7a5 add compare-results.sh, call from start-testsuite.sh
Compare current test results to the expected results, and exit in error on
discrepancies.

Add compare-result.sh: (trivially) grep junit xml output to determine which
tests passed and which didn't, and compare against an expected-result.log,
another junit file from a previous run. Summarize and determine success.

Include an "xfail" feature: tests that are expected to fail are marked as
"xfail", unexpected failures as "FAIL".

In various subdirs, copy the current jenkins jobs' junit xml outputs as
expected-results.log, so that we will start getting useful output in both
jenkins runs and manual local runs.

In start-testsuite.sh, after running the tests, invoke the results comparison.

Due to the single-line parsing nature, the script so far does not distinguish
between error and failure. I doubt that we actually need to do that though.

Related: OS#3136
Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
2018-04-06 01:07:15 +02:00
Harald Welte b0d9360aac More progress on osmo-sip-connector tests
Change-Id: I34a5d7929264c7f5f21d3868a5f919874ffa106c
2018-03-26 23:11:51 +02:00
Harald Welte afec471557 sip: Add SIP_Emulation and first osmo-sip-connector test case
Change-Id: Ifd47b0d48c609b4a678ea47aa7f89f5c12e6c0d2
2018-03-22 21:16:42 +01:00