path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2019-04-04modem: Move modem iface to its netns before using itPau Espin Pedrol1-0/+22
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 modem-netns-setup.py. This way now we always make sure the iface is moved to the expected netns before it is used. Related: OS#3881 Change-Id: I506309c424aa46684c4516a1a0217343ecbf32c6
2019-04-03process: Prevent NetNSProcess alive forever after SIGKILLPau Espin Pedrol1-1/+37
NetNSProcess are run in the following process tree: osmo-gsm-tester -> sudo -> bash (osmo-gsm-tester_netns_exec.sh) -> tcpdump. 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. Change-Id: I2bf389c47bbbd75f46af413e7ba897be5be386e1
2018-10-31Add support to test gprs IPv4 data planePau Espin Pedrol1-0/+5
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. Expected setup: * 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 activated!). * 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. Related: OS#2308 Change-Id: Icb06bdfcdd37c797be95ab5addb28da2d9f6681c
2018-10-31utils: Add osmo-gsm-tester_setcap_net_*.sh scriptsPau Espin Pedrol2-0/+5
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 it. Change-Id: Ib88a1b7818155fc608cc6ff763300fbd0e03a07a
2018-10-31utils: Introduce modem-netns-setup.pyPau Espin Pedrol1-0/+87
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. Related: OS#2308 Change-Id: Iadb2df2974e132044fba1f1bc2db8b559912e4e1
2018-10-31utils: Introduce show_usb_device.pyAlexander Couzens1-0/+97
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 osmo-gsm-tester setup. Change-Id: Iec049e2d56d61ecd50b65b64d95d69641fa0f8be