Commit Graph

139 Commits

Author SHA1 Message Date
Pau Espin 4b090c95d5 Split GTP_CodecPort/GTP_Templates into C and U variants
The Types are already split in the dependent modules in GTPC_Types and
GTPU_Types.
There's no point in keeping them together in the same file since those 2
protocols are mostly independent.
Furthermore, testsuites using GTPv2C + GTPv1U don't need GTPv1C.

Change-Id: Ic15c9a2e92828cbafb4dda7355ee534107051e2d
2024-03-01 10:28:22 +00:00
Daniel Willmann 09ed994961 gbproy/ns: Make components alive
Might help with random test failures on shutdown, see OS#6273 for
details.

Change-Id: I59578934c6406bea5eb8d55d3641737e555a2d85
Related: OS#6273
2023-12-05 15:47:05 +01:00
Daniel Willmann 172cd6ddb5 gbproxy: Reduce timeout to fix flaky test
The individual timeouts in TC_BVC_bringup_conflicting add up to almost
15.0s (the Tguard timeout) which causes the test to sometimes fail.
Decrease the time waiting for all BVCs to be unblocked from 10s to 5s,
in reality this should be plenty time.

Change-Id: I620ce90f9e6b54cc94b4d36ac123f43d8d809f47
2023-05-09 13:59:28 +00:00
Harald Welte d6c07e0b0e cosmetic: gbproxy: fix missing closing parenthesis in log line
Change-Id: I4f2b5ef048ccd03d5ac2f448ef14691ece3200d2
2023-04-15 02:41:56 +00:00
Pau Espin 4e43183151 Update UIT version expectancies after Osmocom CNI release 202302
Change-Id: Iec06390a1de9391ab573e66f9bd3421f4a627c6d
2023-02-08 12:49:37 +01:00
Vadim Yanitskiy 94e60c851c {sgsn,gbproxy}: do not link non-existent TCCConversion.hh
Change-Id: If1a3b0bac7438aa49faa905c8879d096248edfb7
2022-11-24 03:56:46 +07:00
Vadim Yanitskiy c6c194323b {ns,sgsn,gbproxy}: gen_links.sh: do not link unused modules
Change-Id: I8fddd010e2a3ce88c892887fc571ae54d84e931f
2022-10-21 10:35:10 +00:00
Neels Hofmeyr 13b83db5db update various expected-results.xml
Change-Id: I850b79526145307246bca40c70ed8e4d586d8c68
2022-08-12 02:31:23 +00:00
Harald Welte 7138913d66 Use alive-type components for "infrastructure" components
According to feedback received from TITAN developers in
https://www.eclipse.org/forums/index.php?t=msg&th=1106652&goto=1848616&#msg_1848616
the use of alive-type components has the following advantage:

> Also the DTE during the shutdown can be avoided to use alive type
> components.  The test ports of the alive components are not
> disconnected/unmapped when the component finished only when killed or
> the MTC terminated.

So the idea of this patch is to use alive-type components for all the
underlying infrastructure, such as the *_Emulation_CT starting from M3UA
to SCCP and further up the stack.  This way, only the MTC and the
highest level of components (such as ConnHdlr) remain as normal
components.

The hope is that using more alive-type components in the lower protocol
layer emulations will reduce the probability of DTE during shutdown if
some message is received during the component shutdown after the MTC
has completed.

Change-Id: I61d791d6d1bfe9226aabbe223baafc5f8f6d4f04
2021-12-15 20:20:30 +00:00
Daniel Willmann 116d8b5feb gbproxy: Test BVC bringup with conflicting BVCs
Different pcus try to establish the same BVC. Ensure that all the other
BVCs still remain functional.

Change-Id: I46eb0205b4c86b5f1bdc241ef0b2e12135c028e4
2021-12-08 07:47:29 +00:00
Daniel Willmann 65bddfc801 gbproxy: Update expected-results.xml
Change-Id: Id987d1c8e4a901ff9397f0e58072bc039de4e030
2021-11-30 09:26:36 +01:00
Daniel Willmann c7c8e32fef gbproxy: Add flush_ll test without new bvci
Depends: Ic33d08992ea84af006d133db6aec508a7b7c7f28 (osmo-ttcn3-hacks)
Change-Id: I9af6f0829bf10031b86e587529b86706fea3a413
Related: OS#5332
2021-11-30 09:24:07 +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
Daniel Willmann c5bbcc6279 gbproxy: Check SGSN-orignated BVC RESET if BSS BVC is gone
IF the BSS-BVC is gone gbproxy blocks the BVC towards the SGSN (this is
the only thing it can do since there is no BVC-REMOVE). If the SGSN ever
decides to reset that BVC the gbproxy should not ACK it, but instead
consider the BVCI unknown.

Change-Id: Ic57b39a77adf71abda99ef8af7da1592e2225a0d
Related: SYS#5628, OS#5236
2021-09-27 12:10:17 +00:00
Daniel Willmann d70d45ab71 gbproxy: Fix race condition checking for unblocked BVC
It sometimes happens that the ttcn3 test checks the BVC FSM state before
the gbproxy had time to process the BVC_RESET_ACK from the "SGSN". It
then reports the state WAIT_RESET_ACK which will fail the test.

Introduce a small wait to give the gbproxy some more time.

Change-Id: Ic31b2188195c5d76b2d5aac9fa1f0b4efa5ca8b2
2021-08-02 15:00:46 +00:00
Daniel Willmann 04918c054a Fix TC_ms_reg_enq
In the pooling case it is not clear where the message will be forwarded
to so allow reception on any SGSN.

Change-Id: I6669ed0b49e9f278f16a67dc05ae208884ee535e
Related: OS#4472
2021-07-06 14:01:49 +02:00
Neels Hofmeyr cb8d9894af update expected-results.xml files
Change-Id: Idcf764cd2d251210bb123d2a5ea782cda0d670b7
2021-07-05 13:11:14 +02:00
Alexander Couzens bd6e9a1da9 RAW_NS/NS_Provider_IPL4: allow to use the new NSVC interface
RAW_NS used previous a single TTCN3 port for a single UDP port
(source/listen side).
This has the limitation that only a single NSVC could be tested for a
local UDP port. However SNS tests require multiple NSVCs over a single UDP port.
NS_Provider_IPL4 already supports multiple NSVCs for the NS_Emulation.
Extend the support in NS_Provider_IPL4 to also allow RAW_NS to use
multiple NSVCs.

Related: OS#5036
Change-Id: Iafd9310e04066958914201da0cbdcd563bd5c976
2021-06-15 20:20:44 +00:00
Daniel Willmann 8d9fcf4461 gbproxy: Test routing if an SGSN in a pool is down
If an SGSN in a pool is down we expect the messages to instead be sent
to a different SGSN in the pool. That SGSN will not necessarily know
what to do with those messages, but it should )implicitly) detach that
UE so that it can reattach at the new SGSN. Otherwise UEs on a failed
SGSN would simply stop working as the messages would never be forwarded
anywhere.

This test also adjusts the NS timers so the failed NSVCs are detected
faster.

Change-Id: I46a6b8082441843f428a7681566228e5de375bcb
Related: OS#4952
2021-05-28 15:16:08 +02:00
Pau Espin 40778e8cd8 gbproxy: Introduce test TC_rim_from_eutran
Related: SYS#5314
Change-Id: Idd760ef9ede08a155752a5bee5b8d8f9dfa440da
2021-05-07 13:21:00 +02:00
Harald Welte d73ba5801c ns/gbproxy/sgsn: Update configs to use logging level lnssignal'
In libosmocore I34b8fde2955ecc010d1dcd9512e1bba9211e2c0d we introduced
a new log subsystem; enabel it in the related configs here

Change-Id: Ie3d178e68aa81d5636c87940074cb6582ac2f131
2021-04-21 07:17:38 +00:00
Harald Welte 7079ce89cb gbproxy: Update config for IP BSS to use SNS
This reflects the more realistic use cases: IP-SNS is used on the BSS
side, where osmo-gbproxy then behaves in SGSN role.

Change-Id: I90bd101096979b170c38fa2a80abb80d296c4d2e
2021-04-01 21:27:33 +02:00
Harald Welte b5688f26ed gbproxy: Verify BVC FSM state during bring-up
This adds IUT fsm state instrospection via the CTRL interface.

docker-playground will need to set "mp_gbproxy_ip" in its configs.

Change-Id: I272e43b9be8ba53d8a815e8ab099c939f63413a7
2021-04-01 18:25:31 +02:00
Harald Welte 572b0179ae Make f_{block,unblock}_ptp_bvc_from_pcu handle multiple SGSNs
Those tests predated SGSN pooling support and needed to update
their assumptions to also cover other SGSNs in the pool.

We could come up with more complex, auto-scaling mechanisms to handle
different numbers of SGSNs, but that would make the code quite
unreadable, as it means we cannot use interleave but have to dynamically
activate altsteps for counting.  I went for the simpler approach
instead.

Change-Id: I8c3ec4e00b78cff40ac72bc857161fa7abc352b0
Related: OS#4968
2021-03-30 13:25:29 +02:00
Harald Welte b1cc0b24d3 gbproxy: Generalize as_count_bvc_block() into as_count_bvc_sts()
... and while add it, add as_count_bvc_unblock() based on it.

Related: OS#4968
Change-Id: I33ceace527d6a0cd816fb4e042fdcffd8f0dd23f
2021-03-30 13:25:29 +02:00
Alexander Couzens 2efeb61139 gbproxy: update sns configuration to use ip-sns-bind
With libosmocore commit the SNS configuration requires a ip-sns-bind vty configuration
to define the binds which should be use.

Related: SYS#5354
Depends-on: I9ab8092bf286e7d90e92f5702a5404425e959c84 (libosmocore)
Change-Id: If86fe463199bc5089db80a0dcc01f9e94e23e9b9
2021-02-19 10:42:03 +00:00
Harald Welte e5d41540d9 gbproxy: Fix configuration (ip-sns syntax)
It's sad that this config file has again been forgotten.

Change-Id: Ic9184669f6459c44fbb81e05b54028eca1b54db5
Related: SYS#5354
2021-02-13 16:49:25 +01:00
Daniel Willmann c879f3416f gbproxy: Increase timeouts for dl/ul unitdata tests
These tests run quite some time and I had issues with timeouts locally.

Change-Id: Id99ffa14bf6bcb584688c410feb9163a4f0fb492
2021-02-11 15:17:14 +01:00
Daniel Willmann 325458ddf7 gbproxy: Fix TC_dl_unitdata test failure introduced by 6ee0126971
This commit used a send template (ts) to match a received BSSGP PDU which
doesn't work due to some differences in the length field.
Use tr_BSSGP_IMSI again and change the template restrictions so it
compiles.

Fixes: 6ee0126971
Change-Id: I85676e96f8d32a9d2c7deadc1d66707b6b8697d0
2021-02-11 15:16:57 +01:00
Philipp Maier 1bd60ce2b8 GBProxy_Tests: fix TC_rim_info_pcu2pcu
The testcase TC_rim_info_pcu2pcu calls a function f_TC_rim_info_pcu2pcu()
which doesn't use the templates from Osmocom_Gb_Types.ttcn as intended.
This eventually lets the altstep in f_rim_pcu2pcu() run into a timeout
since the templates never match.

Change-Id: I281dc53bb5dd7be86edc9db185618252ff1b9a21
Related: SYS#5103
2021-02-10 20:08:14 +01:00
Daniel Willmann 9fda2145e0 gbproxy: Fix ip-sns VTY config
Change-Id: Ia826ec4b5045360c1b37826f86f03bdccaf63360
Related: SYS#5354
Depends: Ida979f3b9daa5f7280a629441e4006a7635653b0 (libosmocore.git)
2021-02-10 13:53:48 +01:00
Pau Espin Pedrol 6ee0126971 Osmocom_Gb_Types: Fix tons of template restriction warnings
Change-Id: I3da153ce5e83b231501e74b958fcac9f10c00849
2021-02-08 12:32:07 +01:00
Harald Welte c52c258aea gbproxy: fix config files
It seems only docker config files were updated, while the local ones
have been forgotten in recent changes.  We have to find a proper
solution for this :/

Change-Id: I26e900617bb87983912d8440376a7449f318e737
2021-02-04 22:32:03 +01:00
Harald Welte aaa0dfdd3f Move "ro_integer" to Osmocom_Types
We don't need several re-definitions of a "record of integer" type,
plus associated helper functions.  Let's move that to the shared
Osmocom_Types.ttcn

Change-Id: I6a68ab8180a40b93c540db9cb80941c39c2fb549
2021-02-04 17:11:30 +01:00
Philipp Maier 14d3a8e7c3 GBProxy_Tests: fix TC_rim_* tests
The TC_rim tests do not use the RIM templates from Osmocom_Gb_Types as
intended.

Change-Id: Ie484f288aa0515ef4df4a3cf7f8a347a3f3cf587
Related: SYS#5103
2021-01-30 19:18:36 +00:00
Harald Welte 920c7c45ec fr + gbproxy: Start to use AF_PACKET ENOBUFS work-around
If send() on AF_PACKET returns ENOBUFS, usleep for 2ms and re-try
until it succeeds.

Change-Id: Id7bdd2c690eae3bec1df7634944cd73f0bf0b29a
Closes: OS#5343
2021-01-30 14:08:16 +00:00
Harald Welte d5b7e74403 gbproxy: Use Misc_Helpers.f_shutdown() whenever applicable
This should avoid some of the "known" races during shut-down

Change-Id: I4fdd47e9c5887597dca89580f856ddc6cd8f54f1
2021-01-29 08:59:27 +00:00
Harald Welte 14d23ef014 gbproxy: Increemnt many timeouts from 1s to 2s.
Sending a message [even over a real or simulated E1 line] should always
be less than 1s end-to-end.  But just to see if increasing the timeouts
to 2s will result in less test failures, let's change from 1s to 2s.

Change-Id: Iebb43283ad7c267c6ed7f49989ec453be38956a9
2021-01-26 15:47:07 +01:00
Daniel Willmann c38c85d474 gbproxy: Fix pooling expectations of TC_bvc_reset_*_from_bss
With pooling enabled these tests now need to verify that the reset/block
is propagated to all SGSNs in the pool.

Change-Id: I34ed4bffce564dbaf08f9388bd5247351dd0725e
Fixes: OS#4964
2021-01-21 18:11:12 +01:00
Harald Welte 388057da54 gbproxy: Use separate NS-VC for data / signalling on SGSN side
As we know, many production deployments have SGSN architectures with
clear control / user plane split.  In such situations, IP-SNS of the
SGSN informs us of two (classes of) IP endpoints:

    some that have control_weight > 0 and data_weight 0
    some that have control_weight 0 and data_weight > 0

Let's adjust the GBProxy_Tests.ttcn to use such a configuration for
each of the two simulated SGSNs.

Change-Id: If0e404bdf2c30a5e18748695608611be83f61109
Closes: OS#4953
2021-01-20 15:57:19 +01:00
Harald Welte be7afce974 NS_Emulation: Respect data_weight==0 or signalling_weight==0
* allow configuration of signalling + data weight for each NS-VC
* advertise per-NSVC signalling/data weight in SNS-CONFIG
* keep track of unblocked NS-VCS separately for data / signalling
* transmit BVCI=0 traffic only over signalling NS-VC
* transmit BVCI>0 traffic only over data NS-VC
* accept incoming BVCI=0 traffic only if signalling_weight > 0
* accept incoming BVCI>0 traffic only if data_weight > 0

Related: OS#4953
Change-Id: I9798e639b4bc8658482945970775b012b5840779
2021-01-20 15:56:31 +01:00
Harald Welte 86be7ed803 gbproxy: Change logging settings
Change-Id: Ib153cfdb337ea0d748aa18e2b8eb16db01d79edd
2021-01-18 19:55:03 +01:00
Harald Welte d05a4a99a4 gbproxy: Move different network elements to different IPs
* SGSN0: 127.0.0.10
* SGSN1: 127.0.0.11
* PCU0:  127.0.1.1
* PCU1:  127.0.2.1
* PCU3:  127.0.3.1

Change-Id: I1762bfc237e679ee21d0446596f2c4f56f735a9d
2021-01-18 19:55:03 +01:00
Daniel Willmann 2a33067570 gbproxy: Use g_parse.sgsn_idx for paging
The ConnHdlr test stores the sgsn_idx in g_pars. Use that in the paging
tests to the correct SGSN pages the MS.
This commit fixes what 4332044c missed and is required for the ptp paging
reject test to pass.

Change-Id: Id85ffa57af943ae98c0f022b261ec24d557c236d
Related: OS#4951
2021-01-18 18:01:25 +00:00
Harald Welte 04358655bf gbproxy: Add test cases for STATUS handling
We expect the uplink BSSGP status to be routed based in the
inner/contained downlink PDU - and vice-versa.

Change-Id: If2ddd158346a3da340f1c673354196f3872c4f67
Related: OS#4951
2021-01-17 18:16:04 +01:00
Harald Welte 3148a9618f gbproxy: Add tests for RADIO-STATUS with TMSI and IMSI instead of TLLI
Change-Id: Ib3b052a12227a8f55cf063e5168b56f97b9a8f9b
Related: OS#4954
Related: OS#4951
2021-01-17 17:39:29 +01:00
Harald Welte 25a04b1565 gbproxy: Print log line for every ConnHdlr we start
Change-Id: I43e0ffb1b8be4f85a55ab1ed24fcf9d3b60a4d60
2021-01-17 17:39:29 +01:00
Harald Welte f86f1859f9 gbproxy: Add suite of RIM tests
They all fail with current gbproxy master as it doesn't yet implement
routing of RIM messages.

Related: OS#4896
Change-Id: I0fec6fd4a5a6559f596b9006ae437323da6f05d7
2021-01-17 17:39:29 +01:00
Daniel Willmann 4332044c95 gbproxy: Use g_parse.sgsn_idx for paging
The ConnHdlr test stores the sgsn_idx in g_pars. Use that in the paging
tests to the correct SGSN pages the MS.
This is required for the paging reject test to pass.

Change-Id: I34cfc047b36cd6c139a78a7f171a9a99cc974a79
Related: OS#4951
2021-01-17 16:39:03 +00:00