Merge lp:~rodsmith/checkbox/fix-net-speed-detection into lp:checkbox

Proposed by Rod Smith
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4509
Merged at revision: 4521
Proposed branch: lp:~rodsmith/checkbox/fix-net-speed-detection
Merge into: lp:checkbox
Diff against target: 20 lines (+2/-2)
1 file modified
providers/plainbox-provider-checkbox/bin/network (+2/-2)
To merge this branch: bzr merge lp:~rodsmith/checkbox/fix-net-speed-detection
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Sylvain Pineau (community) Approve
Review via email: mp+307741@code.launchpad.net

Description of the change

On a Cavium Thunder (ARM64) system, ethtool outputs less information than on (most? all?) AMD64 systems. This causes the network test to fail to identify the network speed, resulting in a default "pass" result even when the network is under-performing. This patch broadens the scope of the search for the link speed in the network test, causing correct behavior on both AMD64 and Cavium systems -- that is, a reported failure when the network test actually fails.

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

Weird indeed. Thanks for the fix Rod

review: Approve
Revision history for this message
Jeff Lane  (bladernr) wrote :

Well, Sylvain beat me to it... ack

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'providers/plainbox-provider-checkbox/bin/network'
--- providers/plainbox-provider-checkbox/bin/network 2016-07-21 19:17:18 +0000
+++ providers/plainbox-provider-checkbox/bin/network 2016-10-05 16:25:41 +0000
@@ -296,14 +296,14 @@
296 logging.error(e.output)296 logging.error(e.output)
297 ethinfo = None297 ethinfo = None
298 finally:298 finally:
299 expression = '(\\d+)(base)([A-Z]+)'299 expression = '(\\d+)(base)([A-Z]+)|(\d+)(Mb/s)'
300 regex = re.compile(expression)300 regex = re.compile(expression)
301 speeds = [0]301 speeds = [0]
302 if ethinfo:302 if ethinfo:
303 for i in ethinfo:303 for i in ethinfo:
304 hit = regex.search(i)304 hit = regex.search(i)
305 if hit:305 if hit:
306 speeds.append(int(hit.group(1)))306 speeds.append(int(re.sub("\D", "", hit.group(0))))
307 return max(speeds)307 return max(speeds)
308308
309 @property309 @property

Subscribers

People subscribed via source and target branches