Commit Graph

113 Commits

Author SHA1 Message Date
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
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
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
modification.

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
SGSNs.

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
Alexander Couzens 7d8c0e3b35 update expected-results.xml
Change-Id: Ib4399aa488afd917e3eda5e79d56ea3797ef7c78
2021-01-14 21:40:30 +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
before.

Change-Id: I98928f24745125642225681d13bf2e78691e9747
Related: SYS#5115, OS#4518
2021-01-11 14:20:55 +00:00
Daniel Willmann c88df6de5a gbproxy: Enable IP-SNS towards SGSN
Change-Id: Ia9cb646d57cd3bf77aebf60318e5f76599d516a5
2021-01-11 13:11:04 +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
Alexander Couzens 0339df9178 gbproxy: osmo-gbproxy.cfg: support new sgsn syntax
osmo-gbproxy has a new syntax for sgsns to support pooling

Change-Id: I157dbbe42db4ed03861b914e91e49764b0b1a1bb
2021-01-04 16:28:12 +00:00
Alexander Couzens 4811484a0e gbproxy: change osmo-gbproxy.cfg to support ns2 vty2
All test case (except 3 which fails on jenkins as well) succeed.

Change-Id: I1c3fde35cec7fa0adf2bef7659dfc19bf301ffa9
2021-01-04 16:28:06 +00:00
Harald Welte 036c4dcb30 gbproxy: Remove redundant part from config file
If a given setting is identical to the GBProxy_Tests.ttcn compile-time
default, we don't need to repeat it in the config file.

Change-Id: I3359f632eaf53bc602b1d10bb51de357f0eb2b45
2020-12-12 16:28:30 +01:00