[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/31] iotests: Check whether luks works
From: |
Max Reitz |
Subject: |
[PULL 08/31] iotests: Check whether luks works |
Date: |
Mon, 6 Jul 2020 12:04:09 +0200 |
Whenever running an iotest for the luks format, we should check whether
luks actually really works.
Tests that try to create luks-encrypted qcow2 images should do the same.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200625125548.870061-7-mreitz@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
---
tests/qemu-iotests/087 | 1 +
tests/qemu-iotests/178 | 1 +
tests/qemu-iotests/188 | 1 +
tests/qemu-iotests/189 | 1 +
tests/qemu-iotests/198 | 1 +
tests/qemu-iotests/206 | 1 +
tests/qemu-iotests/263 | 1 +
tests/qemu-iotests/284 | 1 +
tests/qemu-iotests/common.rc | 3 +++
tests/qemu-iotests/iotests.py | 5 +++++
10 files changed, 16 insertions(+)
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087
index bdfdad3454..678e748c58 100755
--- a/tests/qemu-iotests/087
+++ b/tests/qemu-iotests/087
@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto file
_supported_os Linux
+_require_working_luks
do_run_qemu()
{
diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178
index 7cf0e27154..f09b27caac 100755
--- a/tests/qemu-iotests/178
+++ b/tests/qemu-iotests/178
@@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt raw qcow2
_supported_proto file
_supported_os Linux
+_require_working_luks
echo "== Input validation =="
echo
diff --git a/tests/qemu-iotests/188 b/tests/qemu-iotests/188
index 09b9b6083a..13b225fded 100755
--- a/tests/qemu-iotests/188
+++ b/tests/qemu-iotests/188
@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
+_require_working_luks
size=16M
diff --git a/tests/qemu-iotests/189 b/tests/qemu-iotests/189
index c9ce9d3bed..e6a84b8a3b 100755
--- a/tests/qemu-iotests/189
+++ b/tests/qemu-iotests/189
@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
+_require_working_luks
size=16M
diff --git a/tests/qemu-iotests/198 b/tests/qemu-iotests/198
index fb0d5a29d3..aeb059d5ea 100755
--- a/tests/qemu-iotests/198
+++ b/tests/qemu-iotests/198
@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
+_require_working_luks
size=16M
diff --git a/tests/qemu-iotests/206 b/tests/qemu-iotests/206
index f42432a838..11bc51f256 100755
--- a/tests/qemu-iotests/206
+++ b/tests/qemu-iotests/206
@@ -24,6 +24,7 @@ import iotests
from iotests import imgfmt
iotests.script_initialize(supported_fmts=['qcow2'])
+iotests.verify_working_luks()
with iotests.FilePath('t.qcow2') as disk_path, \
iotests.FilePath('t.qcow2.base') as backing_path, \
diff --git a/tests/qemu-iotests/263 b/tests/qemu-iotests/263
index d2c030fae9..f598a12899 100755
--- a/tests/qemu-iotests/263
+++ b/tests/qemu-iotests/263
@@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
+_require_working_luks
size=1M
diff --git a/tests/qemu-iotests/284 b/tests/qemu-iotests/284
index 071e89b33e..9f6c29a79c 100755
--- a/tests/qemu-iotests/284
+++ b/tests/qemu-iotests/284
@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
+_require_working_luks
size=1M
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index f3667f48ab..7ac46edc1f 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -605,6 +605,9 @@ _supported_fmt()
# setting IMGFMT_GENERIC to false.
for f; do
if [ "$f" = "$IMGFMT" -o "$f" = "generic" -a "$IMGFMT_GENERIC" =
"true" ]; then
+ if [ "$IMGFMT" = "luks" ]; then
+ _require_working_luks
+ fi
return
fi
done
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 1d8a45c02e..f1e0733dda 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1010,12 +1010,17 @@ def _verify_image_format(supported_fmts: Sequence[str]
= (),
# similar to
# _supported_fmt generic
# for bash tests
+ if imgfmt == 'luks':
+ verify_working_luks()
return
not_sup = supported_fmts and (imgfmt not in supported_fmts)
if not_sup or (imgfmt in unsupported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
+ if imgfmt == 'luks':
+ verify_working_luks()
+
def _verify_protocol(supported: Sequence[str] = (),
unsupported: Sequence[str] = ()) -> None:
assert not (supported and unsupported)
--
2.26.2
- [PULL 00/31] Block patches, Max Reitz, 2020/07/06
- [PULL 01/31] block/block-copy: block_copy_dirty_clusters: fix failure check, Max Reitz, 2020/07/06
- [PULL 02/31] qcow2: Fix preallocation on images with unaligned sizes, Max Reitz, 2020/07/06
- [PULL 03/31] iotests: Make _filter_img_create more active, Max Reitz, 2020/07/06
- [PULL 04/31] iotests: filter few more luks specific create options, Max Reitz, 2020/07/06
- [PULL 05/31] iotests/common.rc: Add _require_working_luks, Max Reitz, 2020/07/06
- [PULL 07/31] iotests.py: Add (verify|has)_working_luks(), Max Reitz, 2020/07/06
- [PULL 06/31] iotests.py: Add qemu_img_pipe_and_status(), Max Reitz, 2020/07/06
- [PULL 08/31] iotests: Check whether luks works,
Max Reitz <=
- [PULL 09/31] qcrypto/core: add generic infrastructure for crypto options amendment, Max Reitz, 2020/07/06
- [PULL 10/31] qcrypto/luks: implement encryption key management, Max Reitz, 2020/07/06
- [PULL 11/31] block/amend: add 'force' option, Max Reitz, 2020/07/06
- [PULL 12/31] block/amend: separate amend and create options for qemu-img, Max Reitz, 2020/07/06
- [PULL 14/31] block/crypto: rename two functions, Max Reitz, 2020/07/06
- [PULL 13/31] block/amend: refactor qcow2 amend options, Max Reitz, 2020/07/06
- [PULL 15/31] block/crypto: implement the encryption key management, Max Reitz, 2020/07/06
- [PULL 16/31] block/qcow2: extend qemu-img amend interface with crypto options, Max Reitz, 2020/07/06
- [PULL 17/31] iotests: qemu-img tests for luks key management, Max Reitz, 2020/07/06
- [PULL 19/31] block/crypto: implement blockdev-amend, Max Reitz, 2020/07/06