Merge ~jocave/plainbox-provider-checkbox:support-xenial-fix-ping into plainbox-provider-checkbox:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: ec0035aac18edc5236b4b5cca2aa02e46c28d369
Merged at revision: bb9d381c2f70c9f8a1a434d8cfa45780fcfc8dc6
Proposed branch: ~jocave/plainbox-provider-checkbox:support-xenial-fix-ping
Merge into: plainbox-provider-checkbox:master
Diff against target: 55 lines (+7/-3)
2 files modified
bin/wifi_client_test_netplan.py (+1/-1)
bin/wifi_nmcli_test.py (+6/-2)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+387743@code.launchpad.net

Description of the change

Edge tests highlighted problems with nmcli args that were not supported on xenial. These were swapped for backwards compatible versions.

Realised the ping test was failing not because of inability to reach the gateway but because of impossible to meet arguments.

Tested on caracalla-transport UC16.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/wifi_client_test_netplan.py b/bin/wifi_client_test_netplan.py
2index 4b7b14d..d984e2e 100755
3--- a/bin/wifi_client_test_netplan.py
4+++ b/bin/wifi_client_test_netplan.py
5@@ -256,7 +256,7 @@ def perform_ping_test(interface):
6
7 if target:
8 count = 5
9- result = ping(target, interface, count, 4, True)
10+ result = ping(target, interface, count, 10, True)
11 if result['received'] == count:
12 return True
13
14diff --git a/bin/wifi_nmcli_test.py b/bin/wifi_nmcli_test.py
15index 18b5572..a6bbd8f 100755
16--- a/bin/wifi_nmcli_test.py
17+++ b/bin/wifi_nmcli_test.py
18@@ -99,7 +99,7 @@ def print_route_info():
19
20 def perform_ping_test(interface):
21 target = None
22- cmd = 'nmcli -g IP4.GATEWAY c show TEST_CON'
23+ cmd = 'nmcli --mode tabular --terse --fields IP4.GATEWAY c show TEST_CON'
24 print_cmd(cmd)
25 output = sp.check_output(cmd, shell=True)
26 target = output.decode(sys.stdout.encoding).strip()
27@@ -107,7 +107,7 @@ def perform_ping_test(interface):
28
29 if target:
30 count = 5
31- result = ping(target, interface, count, 4, True)
32+ result = ping(target, interface, count, 10, True)
33 if result['received'] == count:
34 return True
35
36@@ -149,6 +149,8 @@ def open_connection(args):
37 "ifname {} "
38 "type wifi "
39 "ssid {} "
40+ "-- "
41+ "ipv4.method auto "
42 "ipv4.dhcp-timeout 30 "
43 "ipv6.method ignore".format(args.device, args.essid))
44 print_cmd(cmd)
45@@ -192,8 +194,10 @@ def secured_connection(args):
46 "ifname {} "
47 "type wifi "
48 "ssid {} "
49+ "-- "
50 "wifi-sec.key-mgmt wpa-psk "
51 "wifi-sec.psk {} "
52+ "ipv4.method auto "
53 "ipv4.dhcp-timeout 30 "
54 "ipv6.method ignore".format(args.device, args.essid, args.psk))
55 print_cmd(cmd)

Subscribers

People subscribed via source and target branches