OSDN Git Service

tc-testing: tdc.py: ignore errors when decoding stdout/stderr
authorLucas Bates <lucasb@mojatatu.com>
Fri, 16 Nov 2018 22:37:55 +0000 (17:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Nov 2018 05:54:53 +0000 (21:54 -0800)
Prevent exceptions from being raised while decoding output
from an executed command. There is no impact on tdc's
execution and the verify command phase would fail the pattern
match.

Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/tc-testing/tdc.py

index 87a04a8..9b3f414 100755 (executable)
@@ -134,9 +134,9 @@ def exec_cmd(args, pm, stage, command):
     (rawout, serr) = proc.communicate()
 
     if proc.returncode != 0 and len(serr) > 0:
-        foutput = serr.decode("utf-8")
+        foutput = serr.decode("utf-8", errors="ignore")
     else:
-        foutput = rawout.decode("utf-8")
+        foutput = rawout.decode("utf-8", errors="ignore")
 
     proc.stdout.close()
     proc.stderr.close()