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 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
1=== modified file 'providers/plainbox-provider-checkbox/bin/network'
2--- providers/plainbox-provider-checkbox/bin/network 2016-07-21 19:17:18 +0000
3+++ providers/plainbox-provider-checkbox/bin/network 2016-10-05 16:25:41 +0000
4@@ -296,14 +296,14 @@
5 logging.error(e.output)
6 ethinfo = None
7 finally:
8- expression = '(\\d+)(base)([A-Z]+)'
9+ expression = '(\\d+)(base)([A-Z]+)|(\d+)(Mb/s)'
10 regex = re.compile(expression)
11 speeds = [0]
12 if ethinfo:
13 for i in ethinfo:
14 hit = regex.search(i)
15 if hit:
16- speeds.append(int(hit.group(1)))
17+ speeds.append(int(re.sub("\D", "", hit.group(0))))
18 return max(speeds)
19
20 @property

Subscribers

People subscribed via source and target branches