[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/17] iotests/245: fixup
From: |
John Snow |
Subject: |
[PATCH v2 11/17] iotests/245: fixup |
Date: |
Thu, 24 Mar 2022 14:30:12 -0400 |
Merge with prior.
This is a little more involved, now, but maybe it's a small price to pay
for the better debug information being deployed universally.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/245 | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245
index 8cbed7821b..edaf29094b 100755
--- a/tests/qemu-iotests/245
+++ b/tests/qemu-iotests/245
@@ -20,11 +20,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+import copy
+import json
import os
import re
+from subprocess import CalledProcessError
+
import iotests
-import copy
-import json
from iotests import qemu_img, qemu_io
hd_path = [
@@ -216,11 +218,14 @@ class TestBlockdevReopen(iotests.QMPTestCase):
# Reopen an image several times changing some of its options
def test_reopen(self):
- # Check whether the filesystem supports O_DIRECT
- if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit',
hd_path[0]):
- supports_direct = False
- else:
+ try:
+ qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', hd_path[0])
supports_direct = True
+ except CalledProcessError as exc:
+ if 'O_DIRECT' in exc.stdout:
+ supports_direct = False
+ else:
+ raise
# Open the hd1 image passing all backing options
opts = hd_opts(1)
--
2.34.1
- [PATCH v2 09/17] iotests/149: fixup, (continued)
- [PATCH v2 09/17] iotests/149: fixup, John Snow, 2022/03/24
- [PATCH v2 12/17] iotests/migration-permissions: fixup, John Snow, 2022/03/24
- [PATCH v2 13/17] iotests/migration-permissions: use assertRaises() for qemu_io() negative test, John Snow, 2022/03/24
- [PATCH v2 17/17] iotests: make qemu_io_log() check return codes by default, John Snow, 2022/03/24
- [PATCH v2 14/17] iotests/image-fleecing: switch to qemu_io(), John Snow, 2022/03/24
- [PATCH v2 06/17] iotests: create generic qemu_tool() function, John Snow, 2022/03/24
- [PATCH v2 03/17] iotests: Don't check qemu_io() output for specific error strings, John Snow, 2022/03/24
- [PATCH v2 11/17] iotests/245: fixup,
John Snow <=
- [PATCH v2 10/17] iotests/205: fixup, John Snow, 2022/03/24
- [PATCH v2 15/17] iotests: remove qemu_io_pipe_and_status(), John Snow, 2022/03/24
- [PATCH v2 16/17] iotests: remove qemu_io_silent() and qemu_io_silent_check()., John Snow, 2022/03/24