Commit Graph

131 Commits

Author SHA1 Message Date
Harald Welte 7138913d66 Use alive-type components for "infrastructure" components
According to feedback received from TITAN developers in
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

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 set executable name explicitly
Set the executable name in each 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 files/flags in separate lines
Make all 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

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

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

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

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

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

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:
* SGSN1:
* PCU0:
* PCU1:
* PCU3:

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
Daniel Willmann 193e1a091a gbproxy: Use provided sgsn_idx in f_send_paging_ps_exp_multi()
Change-Id: I89ca4232e71d98936adfc521312b92cba7ef867f
Related: OS#4951
2021-01-17 16:39:03 +00:00
Alexander Couzens c796da8711 remove unused NS_CodecPort.ttcn/NS_CodecPort_CtrlFunct
Change-Id: If885353ec8947309fc7d3ad780448cfc7402e1a4
2021-01-17 15:59:26 +00:00
Harald Welte d6f8981401 gbproxy: Add testcase for MS-REGISTRATION ENQUIRY
The test case fails with current master, as osmo-gbproxy doesn't handle
this yet.

Change-Id: I158dfa729315a9678a7fbb33ed465b73dfc9ec4b
2021-01-16 22:54:29 +01:00
Harald Welte 7595d5682b gbproxy: Test cases for DUMMY-PAGING-PS
The test case fails with current master, as osmo-gbproxy doesn't handle
this yet.

Change-Id: Ie67f36502d18e9a62373973b09e758a7d0d0f3a5
2021-01-16 22:54:29 +01:00
Harald Welte cf20007b26 gbproxy: Add test case for PAGING-PS-REJECT
The test fail with current osmo-gbproxy master, as the related
implementation is missing.

Related: OS#4951
Change-Id: I19a36dfef8f33f278a54b938a5daccce08de6fe0
2021-01-16 22:54:29 +01:00
Harald Welte b5a04aae64 gbproxy: Test PS-PAGING by IMSI (without P-TMSI)
Related: OS#4951
Change-Id: I1bdc09712790d4b69df147ed9c7bea15c48e8dea
2021-01-16 22:54:29 +01:00
Harald Welte 207166c28c gbproxy: Allow creating ConnHdlr without a P-TMSI
This will be useful for testing paging cases where no P-TMSI is allocated.

Change-Id: Icd780c750c77e723e545ed5a5b52ef26e442b4f2
2021-01-16 22:54:29 +01:00
Harald Welte b33fb59b49 gbproxy: Unregister IMSI from BSSGP before termination of ConnHdlr
Otherwise we may run into problems where the BSSGP_Emulation still
has references to longer existing components in its ClientTable.

Change-Id: Iee54e93e6ae1b3e40f502d5ba2499e9eb03bf203
2021-01-16 22:54:29 +01:00