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
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):
256256
257 if target:257 if target:
258 count = 5258 count = 5
259 result = ping(target, interface, count, 4, True)259 result = ping(target, interface, count, 10, True)
260 if result['received'] == count:260 if result['received'] == count:
261 return True261 return True
262262
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():
9999
100def perform_ping_test(interface):100def perform_ping_test(interface):
101 target = None101 target = None
102 cmd = 'nmcli -g IP4.GATEWAY c show TEST_CON'102 cmd = 'nmcli --mode tabular --terse --fields IP4.GATEWAY c show TEST_CON'
103 print_cmd(cmd)103 print_cmd(cmd)
104 output = sp.check_output(cmd, shell=True)104 output = sp.check_output(cmd, shell=True)
105 target = output.decode(sys.stdout.encoding).strip()105 target = output.decode(sys.stdout.encoding).strip()
@@ -107,7 +107,7 @@ def perform_ping_test(interface):
107107
108 if target:108 if target:
109 count = 5109 count = 5
110 result = ping(target, interface, count, 4, True)110 result = ping(target, interface, count, 10, True)
111 if result['received'] == count:111 if result['received'] == count:
112 return True112 return True
113113
@@ -149,6 +149,8 @@ def open_connection(args):
149 "ifname {} "149 "ifname {} "
150 "type wifi "150 "type wifi "
151 "ssid {} "151 "ssid {} "
152 "-- "
153 "ipv4.method auto "
152 "ipv4.dhcp-timeout 30 "154 "ipv4.dhcp-timeout 30 "
153 "ipv6.method ignore".format(args.device, args.essid))155 "ipv6.method ignore".format(args.device, args.essid))
154 print_cmd(cmd)156 print_cmd(cmd)
@@ -192,8 +194,10 @@ def secured_connection(args):
192 "ifname {} "194 "ifname {} "
193 "type wifi "195 "type wifi "
194 "ssid {} "196 "ssid {} "
197 "-- "
195 "wifi-sec.key-mgmt wpa-psk "198 "wifi-sec.key-mgmt wpa-psk "
196 "wifi-sec.psk {} "199 "wifi-sec.psk {} "
200 "ipv4.method auto "
197 "ipv4.dhcp-timeout 30 "201 "ipv4.dhcp-timeout 30 "
198 "ipv6.method ignore".format(args.device, args.essid, args.psk))202 "ipv6.method ignore".format(args.device, args.essid, args.psk))
199 print_cmd(cmd)203 print_cmd(cmd)

Subscribers

People subscribed via source and target branches