Commit Graph

2641 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy bc1e66a3f1 library/Osmocom_VTY_Functions: make VTY prompt timeout configurable
Change-Id: Iadec95446b98d9767d08a841fa1c28f8c71c5eea
2021-01-30 14:23:10 +01:00
Vadim Yanitskiy 26e30aa4e0 library/Osmocom_VTY_Functions: cosmetic: coding style changes
Change-Id: Idccdf6fcbda2d020d2263ea1440ea1c5d9ea0e45
2021-01-30 14:23:10 +01:00
Philipp Maier e00776c5db Osmocom_Gb_types: add minimum requred tr_ templates for RAN INF
When testing the serving BSS part of the RIM application in osmo-pcu, we
will need receiving templates that allow us to verify the response (RAN
INFORMATION) rim container.

Change-Id: I964d7504f3c4aeaa4ce537316b3140e8b893003d
Related: SYS#5103
2021-01-29 21:18:18 +00:00
Pau Espin 9df362a94f rlcmac: introduce initial support for NACC related messages
Change-Id: I4d2f123479c34e6afffe0bc8d91409e6b0529a62
2021-01-29 21:16:25 +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
Alexander Couzens 61c5532366 sgsn: change configuration to the new NS2
Change the whole vty configuration for NS to be more flexible
and support more setups. Old configurations are invalid.

For further information see:
https://osmocom.org/projects/libosmocore/wiki/Network_service_(NS)

Depends-on: If5bd6b86e130772e6c93d640b0c637985416136d (osmo-sgsn)
Change-Id: I37d010bc4ae553c30feb2ebd2be66d23b96bf42a
2021-01-28 21:29:01 +01:00
Harald Welte 92009302c9 fr-net: use 'hdlcnet1' as default netdev
The gbproxy tests and our scripts have started to use
hdlc0..7 paired with hdlcnet0..7.  Let's adjust fr-net to
also use 'hdlcnet1' as the pairing 'fr' test uses 'hdlc1'

Change-Id: If456a575cc2ae0ab2fc63730b329131dfcc70a47
2021-01-27 09:52:11 +00:00
Harald Welte 2dd230a63c fr-net: Fix regen_makefile.sh
regen-makefile.sh should not include generated c++ code.

Change-Id: I0fecfb0d3c33f8d87923d4843fee718916001978
2021-01-27 09:52:11 +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
Pau Espin 46e3604fc8 pcu: Ignore dummy rlcmac packets in f_ms_rx_pkt_ass_pacch
Allow ignoring for received dumy packets while waiting for a Pkt Ass on
PACCH. This fixes some tests failing sometimes due to race condition
where rlcmac packet is requested too quicky, after the PCU has received
the BSSGP packet we sent to it.

The function is splitted into an internal altestep + a wrap function
which is compatible with tests already using it.

Related: OS#4779
Change-Id: I0a10d3a7383d8534e9263864b4130a96392e6198
2021-01-26 12:46:56 +00:00
Alexander Couzens 20cd41ec89 Introduce NS test cases
Related: SYS#5208
Change-Id: Ic619a374b88879d3116f8f28afb14401c3e3192b
2021-01-25 14:14:47 +01:00
Harald Welte 3f82089977 NS_Emulation: Add CTRL port to administratively disable a NS-VC
This feature is useful in simulating intermittent or permanent transport network
outage by simply halting processing of all rx+tx in the specified NS-VC
until it is administratively re-enabled.

Change-Id: I742ecf01de15e3edbf0719371f0217a5739b7c8e
RelateD: OS#4521
2021-01-25 12:48:38 +00: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
Pau Espin efe66646aa pcu: Connect to RIM port from BSSGP_Emulation
It will be used in next commits to test RIM related topics (such as
NACC).

Change-Id: I8113d9ef5433ae0976227408133a53397aeae41a
2021-01-20 14:42:23 +00:00
Harald Welte 1308dbbd8f NS_Emulation: Move SNS handling from NS-VC to NS-VCG
We need to move the IP-SNS handling up one layer, as only the NS-VCG
knows all the other NS-VCs, and after the SNS-CONFIG-ACK, we must
mark all of our NS-VCs as alive and start the alive procedure.

Related: OS#4953
Change-Id: Ie0f4342a0346952d7c50ac36900148e311d4c782
2021-01-18 19:55:03 +01:00
Harald Welte 0b38da55c7 NS_Emulation: Dynamically compute list of v4/v6 endpoints in SNS-CONFIG
Don't hard-code the assumption that we only have a single IP[v4] endpoint.

Related: OS#4953
Change-Id: I43fe5810b95ebbc9f848856803ac2c71f80d74f3
2021-01-18 19:55:03 +01:00
Harald Welte 86be7ed803 gbproxy: Change logging settings
Change-Id: Ib153cfdb337ea0d748aa18e2b8eb16db01d79edd
2021-01-18 19:55:03 +01:00
Harald Welte 3f10c62331 Osmocom_Types: fix formatting of log line (missing ", ")
Change-Id: If4555cd2902e056b32e835daa741ee84b346b922
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 f536524b07 BSGSP_Emulation: Route STATUS to GLOBAL port for both SIG and PTP
Change-Id: I6573562c0e7638f153798ee178c7c69d07c26756
Related: OS#4951
2021-01-17 18:15:32 +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 112bc1469a Osmocom_Gb_Types: Extend RADIO-STATUS templates
RADIO-STATUS can occur with TLLI, but also with P-TMSI or IMSI.
Update our templates accordingly while keeping backwards compatibility.

Related: OS#4951
Change-Id: I1119e50e457b02d52e7c2c26a8b8039bf2118296
2021-01-17 17:39:29 +01:00
Harald Welte 650bd72849 BSSGP_Emulation: f_bssgp_get_tlli(): TLLI is optional in RADIO-STATUS
We must not dereference the TLLI IE unconditionally

Related: OS#4951
Change-Id: I463b25f5395127d155727d785eb7795ac0165fac
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
Alexander Couzens c316572db1 RAW_NS: rework NS connection to use NS_Provider
Previous RAW_NS only supported NS over UDP because
it handled the UDP connection on it's own.
Because of this there was no cleanup function for the tests
because no virtual component were started.
Using the new NS_Provider allows to use the same tests over
UDP and FR with no changes.

Change-Id: I8a3b6c72798a75f434f54229fdbfc802cd13967e
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 be9bf1e74d Osmocom_Gb_Types: Add templates for various BSSGP PDU types
Related: OS#4951
Change-Id: I89044bf8e736cc1997dff1a550b3e194f8ac1b9d
2021-01-16 22:54:29 +01:00
Harald Welte 14ac346b5d Osmocom_Gb_Types: Add 3GPP spec chapters; unify formatting
Change-Id: I9c3e5458ba7637a1e85f7bb3b32e16a90fad7bc5
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