ggsn: testenv: support running osmo-ggsn in QEMU (details)
testenv: podman: add deps for building kernels (details)
Commit
faa6fc2d3083e1d074a3a3e6ca8714c920a6d453
by laforge
library: add generic Mutex API for parallel components
In certain scenarios, it's required to ensure that only one of multiple parallel components executes a specific code block at any given time.
This, for example, is the case for the S1GW testsuite, where we want to simulate multiple eNBs establishing E-RABs. Each new E-RAB triggers the IUT (osmo-s1gw) to send a PFCP Session Establishment Request, and there is no way for the PFCPEM to correlate which session belongs to which eNB. This problem can be solved by ensuring that only one eNB is triggering the PFCP Session Establishment Request(s) at a time.
This patch implements a generic Mutex API, which can also be used by other testsuites that orchestrate multiple parallel components.
Commit
aaa88deeb3ef7f53f9867438ee7fcad9b7df8e11
by laforge
library/PFCP_Emulation: a better PDU routing concept
In recently merged 2962d170 I wrongly assumed, that SEID of outgoing PFCP PDUs can be used to correlate and route the incoming PDUs. In fact, the PFCP peers use two different SEID values, negotiating them using the F-SEID IE.
We could have implemented a logic to look for F-SEID in the outgoing PDUs, store and then use it for routing. However, a more flexible approach is to allow the the PFCP_ConnHdlr components to subscribe and unsubscribe to/from specific SEID values explicitly.
In this spirit, let's allow the PFCP_ConnHdlr components to subscribe and unsubscribe to/from broadcast PDUs (i.e. those, for which the PFCPEM component could not find a single recipient) explicitly.
Implicit routing using the SeqNr remains unchanged and will be performed by the PFCPEM component automatically like before.
Change-Id: I25802471519fa297ad4cb2b056adaa6748b00af2 Related: 2962d170 "library/PFCP_Emulation: fix routing of incoming PDUs"
Commit
19ef9f42928774f09248f907795c6cbf8c31cf84
by laforge
library: as_pfcp_ignore(): log SeqNr of received PDUs
Printing the PFCP PDU template ('?' by default) is not very informative when reading logs. Printing the message type of the received PDU is not informative either, because message types are defined as numbers in PFCP_Types.ttcn. Printing the whole PDU is way too verbose, and would be redundant given that the PFCPEM component already does print all received PDUs. Let's print the sequence number.
Commit
ff60a63c2aa656978cfdaf5958e21fadf8462ef5
by laforge
Revert "s1gw: cache PFCP Recovery Timestamp in ConnHdlr"
This reverts commit 7ad95e1cfb00d269069bd052c44a9cae9027f763.
A follow-up commit will remove the need for each ConnHdlr to call f_ConnHdlr_register_pfcp(), that among with handling the PFCP association retrieves a PFCP Recovery Timestamp from the PFCPEM.
Caching the PFCP Recovery Timestamp value is not really worth it, since it's rarely used and can always be retrieved on demand.
Commit
17f589464ba4063f12f3b03a9a958f492ad6d88f
by laforge
s1gw: move PFCP association handling into a dedicated ConnHdlr
Previously, the PFCP association request from the IUT was handled by the first ConnHdlr component (idx := 0). While this approach has worked, it fails when multiple ConnHdlr instances (idx > 0) are spawned.
The problem arises when other ConnHdlr (idx > 0) instances initiate PFCP procedures before the first ConnHdlr (idx := 0) has established the association, so we end up playing races.
This patch introduces a dedicated ConnHdlr component to handle the PFCP association independently. Once the association is established, the actual test ConnHdlr instances are spawned, ensuring a more reliable and orderly process.
Commit
2f6d76c9dd982fbf9c6660e875fb6d3aa3beced6
by laforge
s1gw: add multi-eNB variants of TC_e_rab_setup
The idea is to simulate multiple eNBs establishing one or more E-RAB(s) simultaneously. In order to achieve that, use the new Mutex API to ensure that only one ConnHdlr component is triggering PFCP session establishment at any given time.
The problem is that there is no way for the PFCPEM component to correlate which PFCP session belongs to which eNB when multiple ConnHdlr instances establish E-RAB(s) in parallel. This can be solved by making a part of the test scenario synchronous.
Commit
7108643171a3fc71a75e4ff7434b5252c7df5b2e
by Oliver Smith
testenv: podman: disable send_redirects
When starting podman, set the following sysctls to avoid ICMP redirects. ICMP redirects lead to test failures (TC_pdp4_clients_interact in the GGSN testsuite), and should not be sent in the test environment in general.
It is really needed to set both "all" and "default", or otherwise ICMP redirects still show up. I've seen setting both in this patch: https://patchwork.kernel.org/project/linux-kselftest/patch/1570719055-25110-4-git-send-email-yanhaishuang@cmss.chinamobile.com/
Commit
50dc468d7f8a16ae719c4c98b3395e2b6c784b46
by Oliver Smith
testenv: podman: remove mongodb-org.list
Remove mongodb-org.list at the end of building the podman image, as we only need to install mongodb once in the container but won't use the repository afterwards. This avoids checking the mongodb repository in "apt update".
Commit
7cd082e0604064711cbe73766a50561e426f29b5
by Oliver Smith
testenv: podman: don't install GUI packages
Install erlang-nox and use the pre-built rebar3 as linked from rebar3.org, instead of using the Debian package to avoid pulling in ~600 MB of GUI dependencies.
Commit
3c35cb2172eb00410107850343c7931d16b83956
by Oliver Smith
ggsn: osmo-ggsn.src.cfg: tweak log output
* Print log levels. * Don't print categories as hex. * Print the basename at the end of the line. * Remove "logging level lgtp debug", there already is "logging level lgtp info" further above, and this is a more sensible setting. With "debug" there are way too many log messages in e.g. TC_lots_of_concurrent_pdp_ctx.
Commit
cc43ae1edad06ff2ce4890f1ab15d41b8010d1f8
by Oliver Smith
ggsn: testenv: replace dummy netdev with bridge
Replace the dummy netdev that was used as network device reachable through the GTP tunnel that can answer ICMP, with a bridge device. The bridge device fulfils the same purpose, plus it can be used in a future patch to connect osmo-ggsn when it is running in QEMU with the testsuite.
Commit
7a51f69f3801bc39cc22ea42f3035c831cd0d808
by Oliver Smith
ggsn: testenv: run SUT on bridge instead of lo
Adjust configs to run the SUT on 172.18.3.202 (testenv0 bridge) instead of 127.0.0.2 (lo). Later on when we can use QEMU with osmo-ggsn, it will run on this IP as well. So with this change we can use the same IP for both the QEMU and the non-QEMU case.
Commit
e28aaf41dea7e2fbb62e009413b600d5a7cb5a83
by Oliver Smith
testenv: support running SUT in QEMU
Add two new arguments -C|--custom-kernel and -D|--debian-kernel. If any of these is set, pass an environment variable TESTENV_QEMU_KERNEL with the path to the kernel when running commands from testenv.cfg.
These commands can then source the new qemu_functions.sh and use it to build an initramfs with the SUT and depending libraries on the fly, and start up QEMU to boot right to starting the SUT. All of that takes about a ~1s on my system with kvm. Without kvm ~5s.
A follow-up patch will adjust the ggsn testenv configs to optionally run osmo-ggsn in QEMU for testing kernel GTP-U.
These scripts are based on scripts/kernel-tests from docker-playground.