diff options
author | Max Reitz <mreitz@redhat.com> | 2019-04-10 18:29:18 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-04-12 18:03:01 +0200 |
commit | 23e1d054112cec1e9d3a29eb27b89335f42d3479 (patch) | |
tree | bdd53d91fded9a2a41cf1f8b7eaeff54f25d7515 /tests | |
parent | 13c24edaa742181af8d9c6b027ee366b04de1ea1 (diff) |
iotests: Let 245 pass on tmpfs
tmpfs does not support O_DIRECT. Detect this case, and skip flipping
@direct if the filesystem does not support it.
Fixes: bf3e50f6239090e63a8ffaaec971671e66d88e07
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qemu-iotests/245 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index 7891a210c1..a04c6235c1 100644 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -209,6 +209,12 @@ 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: + supports_direct = True + # Open the hd1 image passing all backing options opts = hd_opts(1) opts['backing'] = hd_opts(0) @@ -231,9 +237,9 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True) self.assert_qmp(self.get_node('hd1'), 'cache/direct', False) self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', False) - self.reopen(opts, {'cache': { 'direct': True, 'no-flush': True }}) + self.reopen(opts, {'cache': { 'direct': supports_direct, 'no-flush': True }}) self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True) - self.assert_qmp(self.get_node('hd1'), 'cache/direct', True) + self.assert_qmp(self.get_node('hd1'), 'cache/direct', supports_direct) self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', True) # Reopen again with the original options |