Commit Graph

15 Commits

Author SHA1 Message Date
Pau Espin 69a6f668b9 Get rid of install top directory
Some content there is out of date, or should be mvoed to utils/ with the
rest of installable stuff.

Change-Id: I17ee94b175deb88faff71e7788c482093693f8a8
2020-04-10 17:29:10 +02:00
Pau Espin 23e60e5b37 amarisoft_ue: Implement data plane
Use the ifup script to set up the netns + configure the tun device
created by lteue. Use it also as a hook to know when the UE is attached.
Since tun setup is done by arch-optimized lte-avx(2) binaries, we also
need to give capabilitites to them (instead of allowing inheritance of
caps in general in the setcap script).

Change-Id: I1e228b1296eac8e4cb183c2faa735b0468abe124
2020-04-08 15:16:52 +02:00
Pau Espin 80855498f1 utils/bin: Support passing several bin files to setcap helper scripts
Change-Id: Ifa43f895ae0796d086f35778263aaba07f2e1b7a
2020-04-08 15:16:10 +02:00
Pau Espin da2e31f929 Introduce support for AmarisoftEPC
* A new abstract generic base class EPC is created
* srsEPC and AmarisoftEPC inherit from that class
* options are loaded from defaults.conf in cascade. First generic "epc",
  afterwards the specific enb type.
* A new scenario is added to select the EPC type to use. srsEPC is the
  default unless stated by an scenario.
* AmarisoftEPC delegates setup of the tun IP address to an "ifup"
  script. As a result, since we run without root permissions (ony with
  CAP_NET_ADMIN), the ifup script itself is unablet o set the IP
  address. To solve this, we introduce a new osmo-gsm-tester helper
  script which must be installed in the slave node which can be called
  through sudo to increase privileges to do so.

With this commit, I can already get srsUE<->amarisoftENB<->amarisoftEPC
to pass ping and iperf3 4g tests.

Change-Id: Ia50ea6a74b63b2d688c8d683aea11416ad40a6d3
2020-03-31 19:18:18 +02:00
Pau Espin 63685d719a utils: Add limits.d dir with sample config files
Same as the ones described in osmo-gsm-tester User Manual and same as
ones deployed by ansible scripts. Let's rather keep them here.

Change-Id: I8b124a8a1637666536772439b920e7b91e61533c
2020-03-03 09:22:17 +00:00
Pau Espin 69b2cf3ce2 srsue: Create netns on demand
Already existing script osmo-gsm-tester_netns_setup.sh is modified to
support only creating the entns without moving an iface to it.

Change-Id: I1b7e186b0146f932fe37fbea68e4dfa3120b7a74
2020-02-24 10:59:05 +01:00
Pau Espin 31a4aee92f util: Add sudoers.d/ example directory
Change-Id: Ib9ab4d88bf2fb94d04240169e0203b72616f58b0
2020-02-11 15:57:51 +01:00
Pau Espin 49ebbf5ed3 utils: Move shell script helpers to subdir
Change-Id: I86ed3b0bb779c50e57912cf6c2f1ee9fa6e5f557
2020-02-11 15:57:51 +01:00
Pau Espin 7381e820a1 remote: Add more helpers to operate on remote hosts
Change-Id: I034314839675038762e00750b069eee8fcb70a5c
2020-02-11 14:41:09 +01:00
Pau Espin 4c8cd7b9a5 modem: Move modem iface to its netns before using it
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-04 16:10:14 +02:00
Pau Espin e159cd206d process: Prevent NetNSProcess alive forever after SIGKILL
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
2019-04-03 17:53:57 +02:00
Pau Espin fd4c144049 Add support to test gprs IPv4 data plane
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-31 09:59:02 +01:00
Pau Espin 0aaf8e1c1b utils: Add osmo-gsm-tester_setcap_net_*.sh scripts
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-31 08:57:27 +00:00
Pau Espin e972828a01 utils: Introduce modem-netns-setup.py
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-31 08:57:27 +00:00
Alexander Couzens 2decdba7e5 utils: Introduce show_usb_device.py
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
2018-10-31 08:57:27 +00:00