Commit Graph

106 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 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
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
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 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
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
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 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 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 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
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
Harald Welte 2ecbca8080 gbproxy: Don't pass global (component) variables as function arguments
The point of global (component) variables is that we don't have to pass
them around as extra function arguments everywhere.  So don't do it.

Change-Id: I0754d5db7e797a51be3a0b601b0533de80bc246d
2021-01-16 22:54:29 +01:00
Harald Welte 09a1ce4d23 gbproxy: Execute TC_load_sharing_dl() for each SGSN in pool
Change-Id: I4ad822d3bbf5eb6181f6811c3b2267a50bb533a4
Related: OS#4951
2021-01-16 22:54:23 +01:00
Harald Welte c5f486b97e gbproxy: Execute each ConnHdlr test on each NRI of each SGSN configured
This helps us to get proper test coverage for SGSN pool situations.

Change-Id: Ie22d3fd786ff8fefe919ecc3a96f974675057e29
Related: OS#4951
2021-01-16 22:50:58 +01:00
Harald Welte c5c3373a1d gbproxy: Test suspend + resume for each NRI on each SGSN
The test now tests with 10 TLLIs of each configured NRI of each configured SGSN.

Change-Id: Iccd649165acd99b3d2d1ecc8fba7015fa27f57ec
2021-01-16 22:50:58 +01:00
Harald Welte 99ed50731a gbproxy: Use correct NRI in suspend/resume
We cannot choose a random TLLI anymore, as this will obviously end up
at a random SGSN, and not the one we're targeting.

Change-Id: I665eda9e04cbf505f55abc9bcd414d6cbd6a36dd
2021-01-16 22:50:58 +01:00
Harald Welte 009637505f gbproxy: Refactor f_TC_{suspend,resume}
Move the entire body inside the loop to a separate function.  This
will be useful when adding pooling support next.

Change-Id: Ia0f9d9128754c2196ab026623f1b6a254a958d2f
2021-01-16 22:50:58 +01:00
Harald Welte 77218d0990 gbproxy: Start to allocate NRIs to SGSNs
We change the osmo-gbproxy.cfg to use NRI 3 for SGSN-0 (NSEI 101) and
NRI 4 for SGSN-1 (NSEI 102).

We also add the capability to GBProxy_Tests to allocate P-TMSI with
a specific NRI and default to the first NRI of SGSN-0 so all tests
written still for a single-SGSN-non-pool scenario pass without any

Related: OS#4472, SYS#5002
Change-Id: I15f78dca5ac31a1c71f086d3e92a70e900eae250
2021-01-16 22:50:57 +01:00
Harald Welte 5fb0174dbe gbproxy: Fix TC_fc_bvc() with more than one SGSN
The altstep was missing the "repeat" at the end, causing it to abort
early and reporting a test failure which actually didn't exist.

Change-Id: I0ec9aa06fa9ec25b2047c1e795e28eeefd6bc7d2
2021-01-16 22:50:21 +01:00
Harald Welte dbd5e677ce gbproxy: Move away from random TLLI
We used to generate a random TLLI for each ConnHldr.  Instead, use a
deterministic function to generate the P-TMSI (just like we do for the
IMSI) and derive a local TLLI from that P-TMSI.

Related: OS#4472, SYS#5002
Change-Id: Ic1eaa1d298fe998ca97432769953bfc5a5333ae4
2021-01-16 22:50:21 +01:00
Harald Welte b978ed6af5 gbproxy: Configure a Second SGSN
This adds the required code changes and minimal configuration to both
osmo-gbproxy.cfg and GBProxy_Tests to have osmo-gbproxy connect to two

No NRI mappings are configured and hence the second SGSN isn't really
used for anything except for bringing the NS-VCs and BVCs up.

Related: OS#4472, SYS#5002
Change-Id: Ib70f7c1a29f089957f882df0e9b05ee526224611
2021-01-16 22:50:09 +01:00
Daniel Willmann 491af2a33e Fix race during shutdown
To avoid a dynamic test case error we need to prevent messages arriving on
unconnected ports. Waiting some time before stopping components ensures that
any messages "in flight" will be delivered to the port before the component
is shutdown and disconnected.

It would be far nicer to mark a testresult "final" and ignore such
errors on shutdown, but I don't think it's possible in TTCN3.

This fixes TC_fc_bvc on my laptop which consistently failed with a DTE

Change-Id: I98928f24745125642225681d13bf2e78691e9747
Related: SYS#5115, OS#4518
2021-01-11 14:20:55 +00:00
Daniel Willmann ef7015f321 gbproxy: Fix TC_bvc_reset_sig_from_sgsn
The port receive operation only considers the first message in the
queue. We need to drain unrelated status/reset messages, such as those
from PTP BVCs, otherwise the test never completes and times out.

Change-Id: I1f2c76ae9bdc0267bfca60536e321fe88530803c
Related: SYS#5115 OS#4518
2021-01-11 02:41:20 +00:00
Daniel Willmann 4c534bbf18 Fix suspend/resume tests
Ensure that a suspend/resume was sent before sending the *_(N)ACK. In
reality these can only happen together and our TLLI cache removes
the entries after it sees the corresponding (N)ACK so it will not
forward the second message.

Change-Id: Ie0fd81edb748d3c638e42c4418ca514095c55861
Related: SYS#4865, OS#4472
2021-01-11 02:33:03 +00:00