diff options
author | Jonathan Cave <jonathan.cave@canonical.com> | 2019-06-18 17:53:16 +0100 |
---|---|---|
committer | Jonathan Cave <jonathan.cave@canonical.com> | 2019-06-19 14:19:15 +0100 |
commit | 3df39098a90ab46297792e2804b39c2e59b1d4e9 (patch) | |
tree | aa23d62e857fad876050619171b09b60853fad14 /bin | |
parent | 2bd95e32ce80957c58b10f0f5eb7dfede6d05f91 (diff) |
wifi_client_test_netplan: use gateway_ping_test
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/wifi_client_test_netplan.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/bin/wifi_client_test_netplan.py b/bin/wifi_client_test_netplan.py index 60367e2..1f7e5f4 100755 --- a/bin/wifi_client_test_netplan.py +++ b/bin/wifi_client_test_netplan.py @@ -193,21 +193,7 @@ def netplan_apply_config(): def perform_ping_test(interface): - """Simple ping test - change to call gateway_ping_test ??""" - # Get gateway ip for ping test - server_ip = "" - with open("/proc/net/route", "r") as route_file: - for line in route_file: - if (line.split()[0] == interface - and line.split()[1] == "00000000"): - server_ip = inet_ntoa( - pack('<I', int(line.split()[2], 16))) - if server_ip == "": - print("Can't find default gateway ip, exiting...") - return False - - # Test connection by ping - cmd = "ping -c 5 -I {} {}".format(interface, server_ip) + cmd = 'gateway_ping_test -v --interface={}'.format(interface) print_cmd(cmd) retcode = sp.call(cmd, shell=True) return retcode == 0 |