diff options
author | Jonathan Cave <jonathan.cave@canonical.com> | 2020-07-21 11:57:45 +0100 |
---|---|---|
committer | Jonathan Cave <jonathan.cave@canonical.com> | 2020-07-21 11:57:45 +0100 |
commit | 1322578b638d9f44caba21435efcb80a1fcd3258 (patch) | |
tree | d3f4f724f90fafb63dd7851ba4589ca6e067144c | |
parent | 5c62402a66f3735b25438fa56524e980e2d40307 (diff) |
wifi: fixes for xenial, fix ping args
Need to support nmcli arguments back to xenial. Also the ping test appears to have failed due to impossible to reach requirement of 5 pings in 4 second timeout
-rwxr-xr-x | bin/wifi_client_test_netplan.py | 2 | ||||
-rwxr-xr-x | bin/wifi_nmcli_test.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/bin/wifi_client_test_netplan.py b/bin/wifi_client_test_netplan.py index 4b7b14d..d984e2e 100755 --- a/bin/wifi_client_test_netplan.py +++ b/bin/wifi_client_test_netplan.py @@ -256,7 +256,7 @@ def perform_ping_test(interface): if target: count = 5 - result = ping(target, interface, count, 4, True) + result = ping(target, interface, count, 10, True) if result['received'] == count: return True diff --git a/bin/wifi_nmcli_test.py b/bin/wifi_nmcli_test.py index 18b5572..a6bbd8f 100755 --- a/bin/wifi_nmcli_test.py +++ b/bin/wifi_nmcli_test.py @@ -99,7 +99,7 @@ def print_route_info(): def perform_ping_test(interface): target = None - cmd = 'nmcli -g IP4.GATEWAY c show TEST_CON' + cmd = 'nmcli --mode tabular --terse --fields IP4.GATEWAY c show TEST_CON' print_cmd(cmd) output = sp.check_output(cmd, shell=True) target = output.decode(sys.stdout.encoding).strip() @@ -107,7 +107,7 @@ def perform_ping_test(interface): if target: count = 5 - result = ping(target, interface, count, 4, True) + result = ping(target, interface, count, 10, True) if result['received'] == count: return True @@ -149,6 +149,8 @@ def open_connection(args): "ifname {} " "type wifi " "ssid {} " + "-- " + "ipv4.method auto " "ipv4.dhcp-timeout 30 " "ipv6.method ignore".format(args.device, args.essid)) print_cmd(cmd) @@ -192,8 +194,10 @@ def secured_connection(args): "ifname {} " "type wifi " "ssid {} " + "-- " "wifi-sec.key-mgmt wpa-psk " "wifi-sec.psk {} " + "ipv4.method auto " "ipv4.dhcp-timeout 30 " "ipv6.method ignore".format(args.device, args.essid, args.psk)) print_cmd(cmd) |