qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-block@nongnu.org, jsnow@redhat.com, qemu-devel@nongnu.org,
	mreitz@redhat.com, den@openvz.org
Subject: Re: [PATCH v9 0/6] Rework iotests/check
Date: Tue, 26 Jan 2021 14:29:53 +0100	[thread overview]
Message-ID: <20210126132953.GF4385@merkur.fritz.box> (raw)
In-Reply-To: <2628b158-cc41-908e-550f-ec4fe726a31f@virtuozzo.com>

Am 26.01.2021 um 14:19 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 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?

Ah, I didn't know this one. Yes, that's probably nicer than my attempt
of adding an explicit encoding everywhere.

> > 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)

This one looks a bit nicer than mine (using None instead of an
exception), too, so I'll apply this one as well for the next test cycle.

Kevin



  reply	other threads:[~2021-01-26 13:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 18:50 [PATCH v9 0/6] Rework iotests/check Vladimir Sementsov-Ogievskiy
2021-01-25 18:50 ` [PATCH v9 1/6] iotests: 146: drop extra whitespaces from .out file Vladimir Sementsov-Ogievskiy
2021-01-27 18:22   ` Eric Blake
2021-01-25 18:50 ` [PATCH v9 2/6] iotests: add findtests.py Vladimir Sementsov-Ogievskiy
2021-01-25 18:50 ` [PATCH v9 3/6] iotests: add testenv.py Vladimir Sementsov-Ogievskiy
2021-01-26 10:10   ` Vladimir Sementsov-Ogievskiy
2021-01-25 18:50 ` [PATCH v9 4/6] iotests: add testrunner.py Vladimir Sementsov-Ogievskiy
2021-01-26 10:11   ` Vladimir Sementsov-Ogievskiy
2021-01-25 18:50 ` [PATCH v9 5/6] iotests: rewrite check into python Vladimir Sementsov-Ogievskiy
2021-01-25 18:50 ` [PATCH v9 6/6] iotests: rename and move 169 and 199 tests Vladimir Sementsov-Ogievskiy
2021-02-02 15:57   ` Daniel P. Berrangé
2021-02-02 16:15     ` Vladimir Sementsov-Ogievskiy
2021-01-26 12:53 ` [PATCH v9 0/6] Rework iotests/check Kevin Wolf
2021-01-26 13:19   ` Vladimir Sementsov-Ogievskiy
2021-01-26 13:29     ` Kevin Wolf [this message]
2021-01-26 15:07     ` Kevin Wolf
2021-01-26 15:15       ` Vladimir Sementsov-Ogievskiy
2021-01-26 15:36         ` Kevin Wolf
2021-01-26 15:52           ` Vladimir Sementsov-Ogievskiy
2021-02-16  1:49         ` John Snow
2021-02-16 13:03           ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210126132953.GF4385@merkur.fritz.box \
    --to=kwolf@redhat.com \
    --cc=den@openvz.org \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).