aboutsummaryrefslogtreecommitdiffstats
path: root/suites
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-25 17:37:23 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-31 09:59:02 +0100
commitfd4c14404908c683a00e9132a50fdb9a91ccd698 (patch)
treec262c44b76b823ca322bcb61fda341e93be1964e /suites
parent0aaf8e1c1ba92ce9d8167fc8be78122c908d8138 (diff)
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
Diffstat (limited to 'suites')
-rwxr-xr-xsuites/gprs/ping.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/suites/gprs/ping.py b/suites/gprs/ping.py
index 1647445..9186fe6 100755
--- a/suites/gprs/ping.py
+++ b/suites/gprs/ping.py
@@ -48,8 +48,10 @@ wait(ms.is_attached)
# We need to use inet46 since ofono qmi only uses ipv4v6 eua (OS#2713)
ctx_id_v4 = ms.activate_context(apn='inet46', protocol=ms.CTX_PROT_IPv4)
-sleep(5)
-# TODO: send ping to server or open TCP conn with a socket in python
+print("Setting up data plan for %r" % repr(ctx_id_v4))
+ms.setup_context_data_plane(ctx_id_v4)
+print("Running 10 ping requests for %r" % repr(ctx_id_v4))
+ms.run_netns_wait('ping', ('ping', '-c', '10', ggsn.addr()))
ms.deactivate_context(ctx_id_v4)
# We need to use inet46 since ofono qmi only uses ipv4v6 eua (OS#2713)