Commit Graph

48 Commits

Author SHA1 Message Date
Vadim Yanitskiy 7b541af164 stp: fix -latest: add missing f_osmo_repo_is() checks
Change-Id: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Related: SYS#5424
2024-03-07 12:09:22 +00:00
Vadim Yanitskiy f587812cd4 stp: cosmetic: use m3cfg variable in f_M3UA_listen()
Change-Id: Ic5550f17e8925c292df5b3b27cf5898edf10fd23
Related: SYS#5424
2024-03-07 12:09:22 +00:00
Vadim Yanitskiy 88f429db69 stp: add testcases for M3UA-over-TCP
Change-Id: I1e2a887aa22f317783b3207494fd707d7b426439
Related: docker-playground.git I210b7d62845075dcfe147f2f77603625cc1e64f9
Related: SYS#5424
2024-03-06 23:48:47 +07:00
Vadim Yanitskiy 36b7b5d3e6 stp: prepare for testing M3UA-over-TCP
* rename various fields and templates to be transport neutral
* extend mp_m3ua_configs[]: add one client and one server ASPs
* f_M3UA_connect(): split onto f_M3UA_connect_{tcp,sctp}()
* f[_no]_quirk(): properly handle ASPs using TCP transport
* add osmo-stp-tcp.confmerge [*]

We cannot add new M3UA-over-TCP ASPs to osmo-stp.cfg because that
would break the job testing latest osmo-stp version.  Instead, add
a confmerge file to be applied by jenkins.sh (for nightly only).

Change-Id: I5d0b05aa434c057ad379125ac293f5fc9a240b6f
Related: docker-playground.git I210b7d62845075dcfe147f2f77603625cc1e64f9
Related: SYS#5424
2024-03-06 03:28:51 +07:00
Vadim Yanitskiy 84ec42bbc2 stp: add and use f_m3ua_{cli,srv}_config() helpers
Using this API reduces the risk of using the wrong half of the
mp_m3ua_configs[] array and improves the code readability a bit.

Change-Id: I9788f52c20574f4f9d015d2de11b5e42bb03d15f
Related: SYS#5424
2024-03-06 03:28:34 +07:00
Vadim Yanitskiy 03b2fa9ecb stp: check-in expected-results.xml from Jenkins
Change-Id: Id4081af9e9d5b0a95dc2fe7d137778747dc27bd0
2024-03-04 19:09:03 +00:00
Vadim Yanitskiy 020a8fc281 stp/osmo-stp.cfg: tune the logging formatting
Change-Id: Ieafa0599246f40958be6333512b7c41379b38a20
2024-03-01 11:57:00 +00:00
Harald Welte 5b2ce618b1 stp: Don't expect a fixed SLS in IPA -> M3UA case
We are about to introduce a feature for SLS "randomization" in osmo-stp,
so let's modifiy our STP tests to permit any SLS in the M3UA messages
after IPA -> M3UA conversion.

Change-Id: Ib70322b80a72e3e7dc3155bca9e67b03efb413e0
Related: SYS#6543
2023-09-01 08:29:01 +00:00
Pau Espin 578fa193ae */osmo-stp.cfg: Explicitly define role & sctp-role
It was recently decided it's a good practice to always specify the role
 and sctp-role for all ASPs configured in the VTY, since it's an
 important configuration providing feedback on the network setup
 expectancies.

Change-Id: If48ca06f2cc3c0986daa5f6264d80138d468332a
2023-07-11 11:48:41 +00:00
Harald Welte 6baf5e7767 stp: Add tests for setups with multiple "routing context 0" ASPs
These two test cases verify that
* libosmo-sigtran doesn't include a routing context IE even in ASP
  role when using a ASP with a single routing context 0 configured
* osmo-stp can route between a single SG-role ASP with routing context
  to two ASP-role ASPs which both have routing context 0 (i.e. no
  routing context IE in use)

The tests do not pass with current libosmo-sigtran until OS#6003 is
fixed, presumably by Change-Id I5ce89b393a3b950ab7fd1eace9038718c9efcc51

Change-Id: I81052ece7d1cc8b43da6155356ed1c4d9620acdc
Related: OS#6003
2023-04-20 04:51:39 +00:00
Harald Welte 3e5f05ef59 stp: Discard any ASP-UP retransmissions
In some cases, there's some time between accepting the SCTP connection
and the execution of f_M3UA_CLNT_asp_up().  This may cause the
client sending re-transmitted ASP-UP messages.  Let's simply flush
and ignore those, rather than failing the test case.

Change-Id: Iea39e9543535977a3004b150e222ce8c7f4d821a
2023-04-20 04:51:39 +00:00
Pau Espin 74d5dadc8a stp: Fix sporadic failure in TC_ipa_to_m3ua_ni
It was spotted that from time to time the test set NI international
instead of national. This is presumable due to a race condition between
VTY and messages being received and forwarded.
Let's delay resetting the VTY config after the message is recieved, to
avoid the race conditions between them.

Change-Id: I3ef08447d2e36b6948d3db4ec9d1459beebc9384
2022-05-26 12:52:07 +00:00
Harald Welte 67881aef23 Avoid generating zero-length packets
I used the construct like f_rnd_octstring(f_rnd_int(100)) in a number
of places to generate random-length packets with randomized length.

The problem I didn't realize is that f_rnd_int() of course can also
return '0', which would generate zero-length packets.  This may be
permitted in some protocols, but it leads to problems e.g. when trying
to send a UDP packet of zero length (which the kernel will not do).

So let's introduce
* f_rnd_int_nonzero() for returning non-zero randomized integers
* f_rnd_octstring_rnd_len() for returning a random-length random payload
  octet string
* replace all f_rnd_octstring(f_rnd_int()) call sites with the new
  function.

Change-Id: I818a113ff8d2a2f7cab2ec7d9c8661607c6331d6
Closes: OS#5528
2022-04-12 22:52:47 +02:00
Pau Espin 6b1b0ff2b6 stp: Drop mp_osmo_stp_newer_than_1_4_0
osmo-stp 1.5.0 has been released, so we can drop this.

Change-Id: I9a24b44be77d5ab615b833dda418748fb162fc3d
2021-11-16 19:24:55 +01: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
Oliver Smith 5af90d11d5 stp: TC_rkm_unreg_never_registered: !latest
Disable test TC_rkm_unreg_never_registered for current latest version of
osmo-stp (1.4.0), as it does not clean up properly and now causes other
tests to fail.

With this patch, test results for -latest are restored to how it was
before I7d2f9eb298778a8e60c7e73f314bc73528e85406 and
I31fcba85d23a8767eb0ceb513ff5b440558a475b were merged.

Related: OS#4239
Change-Id: Ice8fe9597a0a12eb4ec26172982a0f5cd01a148b
2021-08-15 17:17:58 +00:00
Oliver Smith 5a3f99c01c stp: rename mp_stp_has_asp_quirk
Rename the option to mp_osmo_stp_newer_than_1_4_0, because I'm going to
use the variable in the next patch for something unrelated to the asp
quirk and so we can avoid introducing another variable.

Related: docker-playground I6a32398242b53c827a94cf65e4a35900a7c4171a
Related: OS#4239
Change-Id: I43b1aa2c029c88c88320d40f60df46a5eb6c4c24
2021-08-15 17:17:58 +00:00
Oliver Smith ee02223e28 stp: fix TC_rkm_unreg_active
Create the routing key dynamically, before trying to unregister it, so
osmo-stp doesn't answer with ERR_NOT_REG instead of the expected
ERR_ASP_ACTIVE. While at it, add missing clean up logic.

Related: OS#4239
Change-Id: I31fcba85d23a8767eb0ceb513ff5b440558a475b
2021-07-27 07:26:21 +00:00
Oliver Smith 326d78ed84 stp: fix TC_rkm_unreg_registered
Create the routing key dynamically, before trying to unregister it. The
previous version tried to unregister a statically configured routing
key, as in TC_rkm_unreg_never_registered, but expected success instead
of the proper ERR_NOT_REG.

So after fixing osmo-stp to make TC_rkm_unreg_never_registered pass,
this test failed.

Related: OS#4239
Change-Id: I7d2f9eb298778a8e60c7e73f314bc73528e85406
2021-07-27 07:26:21 +00:00
Harald Welte 261aea72a6 stp: Add tests for snm_inactive quirk
Change-Id: Ic2a41e450a44794c8cf1c5a29871655f2cca4f6b
Related: OS#5148
2021-05-13 21:30:04 +02:00
Harald Welte 5ef25533cf stp: Add tests for "daud_in_asp" quirk.
Change-Id: Ie7e817dc92da4b9103fa50bd3a8240fbe20ddc68
Related: OS#5147
2021-05-13 21:30:04 +02:00
Harald Welte 30cb40037d stp: Add TC_clnt_no_notify_asp_act() for testing the no_notify quirk
Related: OS#5145
Change-Id: Id74972f2ca0b0101fb4666549ce14ba6fa472daf
2021-05-13 21:30:04 +02:00
Harald Welte 95e3d9906c stp: Add TC_ipa_to_m3ua_ni()
This tests sets a non-zero default network-indicator in the ss7 instance
and then performs an IPA -> M3UA translation while checking if the M3UA
side now uses the specified default network-indicator (NATIONAL).

Change-Id: Id4f9d0ff67e114a119ab032d44ac0dfd34f5c402
Related: SYS#5421
2021-04-25 14:28:53 +02:00
Harald Welte 27cfb7a230 stp: Introduce M3UA SSNM tests
Tests for M3UA SSNM behavior.  This is just being introduced in
osmo-stp, so all tests will fail on 'latest', and some will still fail
until SSNM processing inside osmo-stp is becoming more complete.

Change-Id: I5074dccde9940956439235e8d02e6a722b8da5f5
Related: OS#2623
2021-02-08 17:22:26 +00:00
Harald Welte 1c4e984765 stp: Less magic numbers; centralize M3UA configuration
We shouldn't be having magic numbers for point codes etc. in each
test case.

Change-Id: Id8a6241657e1f02f15d6722934eb040fc98beab1
2021-02-08 17:22:08 +00:00
Harald Welte 308125957a stp: Time out after 5s if expected M3UA doesn't arrive
No need to wait for the global timeout here.

Change-Id: I279aacf2215ccd63a6e52c6a71cda3b500a3795c
2021-02-08 17:21:58 +00:00
Harald Welte 42bcc44153 stp: Ignore M3UA SSNM messages in tests
The tests were written without considering the arrival of such messages;
however, it is well within the M3UA spec that such messages appear at
any time indicating remote point code availability etc.

In libosmo-sccp.git Id92be4691b0fd77598a6edb642c028bbd8c5b623 we start
generating those messages in osmo-stp.

Let's ignore them in the tests to avoid unexpected failures.

Later on, we likely will introduce / adapt tests to actually expect
those messages whenever appropriate.

Change-Id: I85ce8fd4f26db184833cf348293f0255bb5eaac3
Related: OS#2623
2021-02-08 17:15:15 +00:00
Pau Espin 8c0f2fc0b0 stp: wait until IPA handshake is done in f_connect_ipa
Otherwise when trying to send stuff to an IPA ASP in some test, it may
fail because the ASP is till not active in the STP (because IPA
handshake was yet not finished, race condition).

Change-Id: I8ea11fe331baf2b65ce0b7b3c1a2b480332faa2a
2020-10-03 08:16:56 +00:00
Pau Espin b51c0879e1 stp: Support testing multi-home SCTP features with IPv4+IPv6
The IP addr module parameter is split now, IPA module has its own set
of configurable addresses, and M3UA its own. Moreover, in M3UA the
single address is transformed to be an array of addresses, to support
multi-homing with both IPv4 and IPv6 addresses.

Related: SYS#4915
Change-Id: Ib1925ed1df5cea3fa66f28b5625532d454a2c338
2020-08-27 08:13:44 +00:00
Pau Espin 9a1aa59023 stp: Bind to free SCTP port instead of hardcoded 9999
TTCN3 transforms -1 internally to 9999. We don't care about the src port
here since we are a client, so let's simple take a randomly free one.

Change-Id: I6665e628c5f1db31731d092f58d0bd2520f65ee6
2020-08-21 14:03:51 +02:00
Pau Espin 4d91578e4a stp: Fix ttcn3 parser error on some Titan versions
It is a known bug that some verisons of titan don't support having
several alt cases without any separator. This is already fixed in
master, but it doesn't hurt adding them to have them compile on other
versions.

Change-Id: I999d4cc5c1c26b8bbdf8b30ad8dfdc8f55ca433b
2020-08-21 11:54:48 +00:00
Harald Welte c097755992 stp/STP_Test.cfg: Add M3UA and IPA tests
Change-Id: Ib8a874d842854cd919edbc1929352fcc3fc1ad97
2020-08-06 16:48:38 +00:00
Harald Welte 15a8501232 Add test whether we accept DATA without Routing Context IE
There are some M3UA implementations out there who use a routing context
during the ASPAC procedure, but who then don't use it in subsequent DATA
transmission.  Let's add a test case for that.

Change-Id: Iaf95f8eafa53cff94910d89584eef95f1b474c7f
Related: OS#4594
2020-06-13 16:35:45 +02:00
Pau Espin 6cd16469ff stp: Remove unneded copy of ConvertASPAddressToEncodedAddress_itu()
Since commit d0575c2fd8, we are using a
forked version of titan.ProtocolEmulations.SCCP with a change to allow
us to run those function directly from its module, no need to copy them
anymore.

Change-Id: I5fe700bd751e1f8f432d052ae6a2f013c5b89580
2020-01-20 18:18:45 +01:00
Harald Welte 53050cdac4 stp: Add TC_clnt_asp_act_tmt_loadshare()
This test case checks if the traffic-mode is communicated to the SG if
we operate in ASP mode.

Change-Id: If7d84b73b36a91fb697daf6263ec93b8672cbdc2
Related: OS#4285
2019-12-01 20:51:12 +01:00
Harald Welte dfbca117e3 stp: M3UA client-side tests: Expect routing context IE in ASPAC
Change-Id: I7011480fed2492add28bbd64a27c0ad71609cb32
Related: OS#4285
2019-12-01 20:50:46 +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 7021cfd167 stp: Introduce traffic mode type tests with unknwon dynamic ASPs
Change-Id: Ib142b021bb6d268831479723ad629be9ed378f81
2019-11-12 13:06:24 +01:00
Pau Espin 9f51483da1 stp: Move logic to create unknwon dynamic ASP to f_connect_ipa()
This type of scenario is used in several tests and will be used in more
tests in the future, so let's move there for easiness.

Change-Id: Ic65ff2ff9dc3cc82ae3fefcf3caf406279cd6b97
2019-11-12 13:06:24 +01:00
Pau Espin b72928d854 stp: Introduce TC_tmt_override
Change-Id: Id99ec3eaa431512114817d2a2af77013762ab2b9
2019-11-12 13:06:24 +01:00
Pau Espin 01ec0bf209 stp: Refactor STP_Tests_IPA tests and introduce new TC_tmt_loadshare
Infrastructure in STP_Tests_IPA changed to be more similar to what is
done in STP_Tests_M3UA, which already contain more advanced tests.

Array of AS names mp_ipa_as_names is added in order to let TTCN3 port
which AS is configured in STP for each src port.

Change-Id: Iae213c58598cc0207503fd10f09d2d57aab941fe
2019-11-12 13:06:22 +01:00
Pau Espin 872cd74cf5 stp: osmo-stp.cfg: Fix missing ASP relation in AS
Change-Id: Idcfbff548076abc17f0f6c9b13a820c8ef3033e1
2019-11-12 13:05:46 +01:00
Pau Espin 05726dd2e9 stp: Make sure all AS are shutdown when test finishes
This way traffic modes set dynamically by peers are cleared and can be
reset by next tests easily.

Change-Id: I177441b2d43298b3836ccf78fe11267333e80665
2019-11-12 13:05:46 +01:00
Harald Welte 829dac4358 stp: Add tests for running STP in M3UA ASP role
Change-Id: Ifec443858256ad79fbe29e26c609322809dd07b1
Related: OS#2005
2019-11-12 13:05:46 +01:00
Harald Welte b9f7bbbc19 STP_Tests_M3UA.TC_tmt_loadshare: Clarify log message in failure case
Change-Id: I28a86f0ea0f8df28d8d22732a8647a07a936c100
2019-11-12 13:05:46 +01:00
Harald Welte cf41d4cf4c STP_Tests_M3UA.TC_tmt_{loadshare,override}: Fix double-ASPUP
Change-Id: I3acf1ce18d1a232c9ce457a19a6d36be380c42dd
2019-11-12 13:05:46 +01:00
Harald Welte 0db4413ff6 stp: Introduce STP_Tests*.ttcn for testing OsmoSTP
In the past, we were automatically running [large parts of] the nplab
M3UA and SUA test suites, but those implement only a fraction of the
functionality.  Particularly, they don't cover the non-standard IPA
behavior, and they don't cover RKM (routing key management).

Let's introduce an initial set of STP tests with this patch.  We try
to not duplicate nplab here, and implement bits not covered there.

Change-Id: I628a87385cac0dfe708a0d74a5088fbd5a4790cd
2019-11-12 13:05:41 +01:00