test_hifi: Fix occasional test breakage
Source of error: regex to parse ps output had a single space, rather than handling any amount of whitespace before the CPU percentage. When that percentage would drop below 10.0, an space would be printed, confusing the regex. Fixed by handling arbitrary whitespace before the percentage.
This commit is contained in:
+1
-1
@@ -626,7 +626,7 @@ class Mininet( object ):
|
||||
# Split by line. Ignore first line, which looks like this:
|
||||
# PID %CPU COMMAND\n
|
||||
for line in test_output.split('\n')[1:]:
|
||||
r = r'\d+ (\d+\.\d+)'
|
||||
r = r'\d+\s*(\d+\.\d+)'
|
||||
m = re.search( r, line )
|
||||
if m is None:
|
||||
error( '*** Error: could not extract CPU fraction: %s\n' %
|
||||
|
||||
Reference in New Issue
Block a user