|Age||Commit message (Collapse)||Author||Files||Lines|
We used to do that once after ofono startup for all iface
(modem-netns-setup.py), but then if a modem crashes the interface is
re-created on the default netns, and tests fail until manual re-run of
This way now we always make sure the iface is moved to the expected
netns before it is used.
NetNSProcess are run in the following process tree:
osmo-gsm-tester -> sudo -> bash (osmo-gsm-tester_netns_exec.sh) ->
Lots of osmo-gsm-tester_netns_exec.sh scripts with tcpdump child process
were spotted in prod setup of osmo-gsm-tester. Apparently that happens
because sometimes tcpdump doesn't get killed in time with SIGTERM and
SIGINT, and as a result SIGKILL is sent by osmo-gsm-tester as usual
termination procedure. When SIGKILL is sent, the parent sudo process is
instantly killed without possibility to forward the signal to its
children, leaving the bash script and tcpdump alive.
In order to fix it, catch SIGKILL for this process class and send
instead SIGUSR1. Then, modify the script under sudo to handle SIGUSR1 as
if it was a SIGKILL towards its children to make sure child process in
the netns terminates.
Since the modem iface and the GGSN iface are on the same host/netns,
it's really difficult to conveniently test data plane without getting
routing loops. As a result, either GGSN or modem iface must be moved to
a different namespace. The decision after a few discussions was finally
to move modem interfaces to a different netns.
* ofono is patched to avoid removing modem if it detects
through udev that its net iface was removed (due to for instance, net
iface being moved to another netns and thus not being reachable anymore
by systemd-udev process running in root netns).
* After ofono is started (and successfully configured all the modems and
detected its net ifaces through syfs/udev), script "modem-netns-setup.py
start" which creates a netns for each modem, naming it after its usb
path ID. net ifaces for that modem are moved into its netns.
* Modem is configured to use 802-3 data format, and as a result the net
iface is configured through DHCP (DHCP req only replied AFTER pdp ctx is
* Since osmo-gsm-tester knowns the modem USB path ID (available in
resources.conf), it can run required steps (ifup, DHCP) to configure the
interface. The interface name is provided by ofono to osmo-gsm-tester.
* As a result, any process willing to transmit data through the modem
must be in the modem netns.
This scripts were already being used by osmo-gsm-tester for a while, but
were not avaialable in this repository. Let's put them here to easy find
them and have all this kind of helper scripts together with code using
Used to quickly set modem net interfaces into their own net namespace
(named after modem USB ID path).
The idea is that since osmo-gsm-tester ofono modem.py knowns the USB
path from a modem (path yml attr), it can infer the netns from it and
run a ping process inside it.
This is a small script written by Alexander Couzens that is useful to
list modems and its properties in a quick and easy way in