From: Markus Armbruster <armbru@redhat.com>
To: Sascha Silbe <silbe@linux.vnet.ibm.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.6?] qemu-iotests: iotests: fail hard if not run via "check"
Date: Tue, 19 Apr 2016 14:25:55 +0200 [thread overview]
Message-ID: <87twixyecs.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <87inzd7qss.fsf@oc4731375738.ibm.com> (Sascha Silbe's message of "Tue, 19 Apr 2016 13:59:15 +0200")
Sascha Silbe <silbe@linux.vnet.ibm.com> writes:
> Dear Markus,
>
> Markus Armbruster <armbru@redhat.com> writes:
>
>>> Running an iotests-based Python test directly might appear to work,
>>> but may fail in subtle ways and is insecure:
>>>
>>> - It creates files with predictable file names in a world-writable
>>> location (/var/tmp).
>>>
>>> - Tests expect the environment to be set up by check. E.g. 041 and 055
>>> may take the wrong code paths if QEMU_DEFAULT_MACHINE is not
>>> set. This can lead to false negatives.
>>>
>>> Instead fail hard and tell the user we want to be run via "check".
>>
>> Are the problems serious enough to warrant rejecting the attempt to run
>> the tests directly outright?
>>
>> Judging from your description, I'm inclined to "no".
>
> Having tests do unexpected things and / or fail silently is "serious" in
> my book. After all, what's the value of tests if they don't yell when
> something is broken?
>
>
> [tests/qemu-iotests/iotests.py]
> [...]
>>> + if test_dir is None or qemu_default_machine is None:
>>> + sys.stderr.write('Please run this test via ./check\n')
>>> + sys.exit(os.EX_USAGE)
>>> +
>>
>> Aha, you're not actually rejecting the attempt to run the tests
>> directly, you're merely requiring two environment variables. That's
>> okay with me. [...]
>
> I should probably add a comment that these two environment variables are
> merely used as proxies that indicate we haven't been run via
> "check". They are the ones where there isn't any useful default value we
> could fall back, but without a full audit we can't tell what else some
> of the tests may expect that would normally be set up by "check" (or at
> least I can't).
Say you had an accurate way to find out whether we're running under
"check". You could then reject any attempt to run the test directly.
I'd oppose that.
It's okay to have test wrapper scripts to configure the tests just so.
It's okay to tell people to use them. But "you can't do that, Dave" is
not okay.
It's okay to require certain environment variables to be set. That's
what your patch does (but your commit message doesn't quite say).
It would not be okay to interfere with my ability to run tests the way
*I* want. If a test breaks when I run it my way, I get to keep the
pieces.
next prev parent reply other threads:[~2016-04-19 12:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 11:32 [Qemu-devel] [PATCH for-2.6?] qemu-iotests: iotests: fail hard if not run via "check" Sascha Silbe
2016-04-14 22:11 ` Max Reitz
2016-04-19 12:22 ` Sascha Silbe
2016-04-19 19:06 ` Max Reitz
2016-04-19 19:32 ` Sascha Silbe
2016-04-20 6:55 ` Markus Armbruster
2016-04-20 8:37 ` Sascha Silbe
2016-04-18 7:19 ` Markus Armbruster
2016-04-19 11:59 ` Sascha Silbe
2016-04-19 12:25 ` Markus Armbruster [this message]
2016-04-19 16:49 ` Sascha Silbe
2016-04-20 8:38 ` Kevin Wolf
2016-04-20 8:51 ` Sascha Silbe
2016-04-19 19:34 ` [Qemu-devel] [PATCH for-2.6? v2] " Sascha Silbe
2016-05-11 15:43 ` Max Reitz
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=87twixyecs.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=silbe@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.