qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] iotests/065: Check for zstd support


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 1/2] iotests/065: Check for zstd support
Date: Tue, 22 Feb 2022 18:44:04 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

21.02.2022 20:08, Hanna Reitz wrote:
Some test cases run in iotest 065 require zstd support.  Skip them if
qemu-img reports it not to be available.

Reported-by: Thomas Huth <thuth@redhat.com>
Fixes: 12a936171d71f839dc907ff ("iotest 065: explicit compression type")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
  tests/qemu-iotests/065 | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065
index f7c1b68dad..b68df84642 100755
--- a/tests/qemu-iotests/065
+++ b/tests/qemu-iotests/065
@@ -24,7 +24,7 @@ import os
  import re
  import json
  import iotests
-from iotests import qemu_img, qemu_img_pipe
+from iotests import qemu_img_pipe, qemu_img_pipe_and_status
  import unittest
test_img = os.path.join(iotests.test_dir, 'test.img')
@@ -35,8 +35,13 @@ class TestImageInfoSpecific(iotests.QMPTestCase):
      def setUp(self):
          if self.img_options is None:
              self.skipTest('Skipping abstract test class')
-        qemu_img('create', '-f', iotests.imgfmt, '-o', self.img_options,
-                 test_img, '128K')
+        output, status = qemu_img_pipe_and_status('create',
+                                                  '-f', iotests.imgfmt,
+                                                  '-o', self.img_options,
+                                                  test_img, '128K')
+        if status == 1 and \
+                "'compression-type' does not accept value 'zstd'" in output:
+            self.case_skip('zstd compression not supported')
def tearDown(self):
          os.remove(test_img)


Hmm. Actually you fix the commit 12a936171d71f in a meaning that test passes 
now. But that only stresses the fact that 12a936171d71f brings a degradation in 
test-count for no-zstd builds. Is it bad?
The simplest solution is to duplicate TestQCow3NotLazy and TestQCow3LazyQMP 
with s/zstd/zlib/.. More complicated is to add generic function to detect is 
zstd supported or not, and use zstd in TestQCow3NotLazy and TestQCow3NotLazy 
only if zstd is supported (and otherwise use zlib).

--
Best regards,
Vladimir



reply via email to

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