qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] iotests: Test prefix for supported_oses in Python
@ 2015-01-22 16:52 Max Reitz
  2015-01-22 17:42 ` Max Reitz
  0 siblings, 1 reply; 2+ messages in thread
From: Max Reitz @ 2015-01-22 16:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Fam Zheng, Stefan Hajnoczi, Max Reitz

sys.platform may be set to "linux2" instead of just "linux" (in theory,
it could even be set to "linux3" or something else). The Python
documentation on sys.platform recommends testing the prefix of the
platform against "linux", so we should do that.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/iotests.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 87002e0..da00de5 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -288,7 +288,13 @@ def main(supported_fmts=[], supported_oses=['linux']):
     if supported_fmts and (imgfmt not in supported_fmts):
         notrun('not suitable for this image format: %s' % imgfmt)
 
-    if sys.platform not in supported_oses:
+    os_supported = False
+    for supported_os in supported_oses:
+        if sys.platform.startswith(supported_os):
+            os_supported = True
+            break
+
+    if not os_supported:
         notrun('not suitable for this OS: %s' % sys.platform)
 
     # We need to filter out the time taken from the output so that qemu-iotest
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] iotests: Test prefix for supported_oses in Python
  2015-01-22 16:52 [Qemu-devel] [PATCH] iotests: Test prefix for supported_oses in Python Max Reitz
@ 2015-01-22 17:42 ` Max Reitz
  0 siblings, 0 replies; 2+ messages in thread
From: Max Reitz @ 2015-01-22 17:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Fam Zheng, Stefan Hajnoczi

On 2015-01-22 at 11:52, Max Reitz wrote:
> sys.platform may be set to "linux2" instead of just "linux" (in theory,
> it could even be set to "linux3" or something else). The Python
> documentation on sys.platform recommends testing the prefix of the
> platform against "linux", so we should do that.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   tests/qemu-iotests/iotests.py | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)

NACK, somehow missed the patch from Fam himself. (And then I didn't use 
Stefan's block branch but Kevin's, so it was missing there, because 
Stefan's pull request last week apparently didn't go through)

So it's already fixed and this patch is no longer required. Thanks John 
for pointing it out to me!

Max

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-22 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22 16:52 [Qemu-devel] [PATCH] iotests: Test prefix for supported_oses in Python Max Reitz
2015-01-22 17:42 ` Max Reitz

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