sanity: non utf-8 characters are tolerated
Sanity check script was not handling non utf-8 characters as a result it crashed and didn't kill qemu and test used to hang. Now tests fail upon untranslatable bytes. JIRA: ZEP-673 Change-Id: I885a185e0481083501fce15cd51412bfdd26a7d7 Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
This commit is contained in:
parent
6ff2011b96
commit
2968b3644c
1 changed files with 7 additions and 1 deletions
|
@ -284,7 +284,13 @@ class QEMUHandler:
|
||||||
out_state = "timeout"
|
out_state = "timeout"
|
||||||
break
|
break
|
||||||
|
|
||||||
|
try:
|
||||||
c = in_fp.read(1).decode("utf-8")
|
c = in_fp.read(1).decode("utf-8")
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
# Test is writing something weird, fail
|
||||||
|
out_state = "unexpected byte"
|
||||||
|
break
|
||||||
|
|
||||||
if c == "":
|
if c == "":
|
||||||
# EOF, this shouldn't happen unless QEMU crashes
|
# EOF, this shouldn't happen unless QEMU crashes
|
||||||
out_state = "unexpected eof"
|
out_state = "unexpected eof"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue