qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 0/6] Rework iotests/check


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v9 0/6] Rework iotests/check
Date: Tue, 26 Jan 2021 16:19:41 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1

26.01.2021 15:53, Kevin Wolf wrote:
Am 25.01.2021 um 19:50 hat Vladimir Sementsov-Ogievskiy geschrieben:
v9:
01: new, one more whitespace-fixing patch
testenv: allow case when we don't have system-arch emulator, but have several 
for another architectures
          change direct os.access(..., os.X_OK) calls to new helper function 
which also check that path is a file
testrunner: s/fail/not run/ for 'No qualified output'
             drop elapsed time arg for one of 'not run' results (now no elapsed 
time for any 'not run' result)

More CI fun:

Traceback (most recent call last):
   File "./check", line 117, in <module>
     testfinder = TestFinder(test_dir=env.source_iotests)
   File "/builds/.../qemu/tests/qemu-iotests/findtests.py", line 53, in __init__
     for line in f:
   File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
     return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1591: 
ordinal not in range(128)

Can be solved by adding encoding='utf8' to the open().. But.. Adding it 
everywhere is not fun.

So, what about just define PYTHONUTF8=1 for running check in check-block.sh?

https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUTF8


diff --git a/tests/check-block.sh b/tests/check-block.sh
index ac32fd67dd..9dcadc435f 100755
--- a/tests/check-block.sh
+++ b/tests/check-block.sh
@@ -74,6 +74,8 @@ cd tests/qemu-iotests
 # QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests
 export QEMU_CHECK_BLOCK_AUTO=1
+export PYTHONUTF8=1
+
 ret=0
 for fmt in $format_list ; do
     ${PYTHON} ./check -makecheck -$fmt $group || ret=1


Traceback (most recent call last):
   File "./check", line 112, in <module>
     env = TestEnv(imgfmt=args.imgfmt, imgproto=args.imgproto,
   File "/builds/.../qemu/tests/qemu-iotests/testenv.py", line 216, in __init__
     self.qemu_default_machine = get_default_machine(self.qemu_prog)
   File "/builds/.../qemu/tests/qemu-iotests/testenv.py", line 41, in 
get_default_machine
     default_machine = next(m for m in machines if m.endswith(' (default)'))

Looking at original check, default_machine should be empty string in this case.

so we need

diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py
index 8b80425670..222395caef 100644
--- a/tests/qemu-iotests/testenv.py
+++ b/tests/qemu-iotests/testenv.py
@@ -38,7 +38,11 @@ def get_default_machine(qemu_prog: str) -> str:
                           stdout=subprocess.PIPE).stdout
machines = outp.split('\n')
-    default_machine = next(m for m in machines if m.endswith(' (default)'))
+    try:
+        default_machine = next(m for m in machines if m.endswith(' (default)'))
+    except StopIteration:
+        return ''
+
     default_machine = default_machine.split(' ', 1)[0]
alias_suf = ' (alias of {})'.format(default_machine)



--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]