tests: fix I/O test for hosts defaulting to LUKSv2
PATCH 1/1 tests: fix I/O test for hosts defaulting to LUKSv2
Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format.
--- tests/qemu-iotests/149 | 2 +- tests/qemu-iotests/149.out | 44 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-)
tests/qemu-iotests/149 +1 -1
@@ -153,7 +153,7 @@ def cryptsetup_format(config): (password, slot) = config.first_password() - args = ["luksFormat"] + args = ["luksFormat", "--type", "luks1"] cipher = config.cipher + "-" + config.mode + "-" + config.ivgen if config.ivgen_hash is not None: cipher = cipher + ":" + config.ivgen_hash
tests/qemu-iotests/149.out +22 -22
176 lines not on this page · raw message
Signature · 1 line
2.21.0
Quoted 5 lines · Daniel P. Berrangé
Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format.
Ultimately, it would be nice to get LUKS 2 support in qemu too, but that's a much bigger job. This is fine for now.
Quoted 12 lines
Signed-off-by Daniel P. Berrangé <[email protected]>--- tests/qemu-iotests/149 | 2 +- tests/qemu-iotests/149.out | 44 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-)tests/qemu-iotests/149 +0
-0
tests/qemu-iotests/149 def cryptsetup_format(config): · line 156
Quoted 5 lines
tests/qemu-iotests/149 +1
-1@@ -153,7 +153,7 @@ def cryptsetup_format(config): (password, slot) = config.first_password() - args = ["luksFormat"] + args = ["luksFormat", "--type", "luks1"]
On Fedora 29, 'cryptsetup --help | grep -A1 type' shows:
-M, --type=STRING Type of device metadata: luks, plain,
loopaes, tcrypt
but that is just 'luks', not 'luks1'.
On CentOS 6 (yeah, I know, not relevenant to qemu any more), --type is unsupported. But I didn't check our other range of supported systems. My point, however, is whether this patch needs to be conditionalized based on what cryptsetup actually supports.
I could not quickly determine if there is some sort of safe no-op 'cryptsetup --type=FOO action /safe/device' that can be used to tell if --type=FOO is recognized.
Otherwise, this makes sense to me.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Quoted 38 lines · Eric Blake
Quoted 5 lines · Daniel P. Berrangé
Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format.
Ultimately, it would be nice to get LUKS 2 support in qemu too, but that's a much bigger job. This is fine for now.
Quoted 11 lines
Signed-off-by Daniel P. Berrangé <[email protected]>--- tests/qemu-iotests/149 | 2 +- tests/qemu-iotests/149.out | 44 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-)tests/qemu-iotests/149 +0
-0tests/qemu-iotests/149 def cryptsetup_format(config): · line 156
Quoted 5 lines
tests/qemu-iotests/149 +1
-1@@ -153,7 +153,7 @@ def cryptsetup_format(config): (password, slot) = config.first_password() - args = ["luksFormat"] + args = ["luksFormat", "--type", "luks1"]On Fedora 29, 'cryptsetup --help | grep -A1 type' shows:
-M, --type=STRING Type of device metadata: luks, plain,
loopaes, tcryptbut that is just 'luks', not 'luks1'.
On CentOS 6 (yeah, I know, not relevenant to qemu any more), --type is unsupported. But I didn't check our other range of supported systems. My point, however, is whether this patch needs to be conditionalized based on what cryptsetup actually supports.
Quoted 6 lines
I could not quickly determine if there is some sort of safe no-op 'cryptsetup --type=FOO action /safe/device' that can be used to tell if --type=FOO is recognized.
Otherwise, this makes sense to me.
I just tested this on Fedora 28, here it works,
I also see the same message:
[mlevitsk@maximlenovopc ~/USERSPACE/qemu/src/tests/qemu-iotests]$cryptsetup --help | grep -A1 type
-M, --type=STRING Type of device metadata: luks, plain,
loopaes, tcrypt
--
open <device> [--type <type>] [<name>] - open device as mapping <name> close <name> - close device (remove mapping)
I guess the documentation was not updated?
I tested both by running the iotest 149, and by doing manually:
dd if=/dev/zero bs=4K count=1000 of=./test
cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --key-size 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 ./test
Best regards,
Maxim Levitsky
Quoted 30 lines · Eric Blake
Quoted 5 lines · Daniel P. Berrangé
Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format.
Ultimately, it would be nice to get LUKS 2 support in qemu too, but that's a much bigger job. This is fine for now.
Quoted 12 lines
Signed-off-by Daniel P. Berrangé <[email protected]>--- tests/qemu-iotests/149 | 2 +- tests/qemu-iotests/149.out | 44 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-)tests/qemu-iotests/149 +0
-0tests/qemu-iotests/149 def cryptsetup_format(config): · line 154
Quoted 3 lines
tests/qemu-iotests/149 +1
-1@@ -153,7 +153,7 @@ def cryptsetup_format(config): (password, slot) = config.first_password() - args = ["luksFormat"] + args = ["luksFormat", "--type", "luks1"]On Fedora 29, 'cryptsetup --help | grep -A1 type' shows:
-M, --type=STRING Type of device metadata: luks, plain,
loopaes, tcrypt
Quoted 6 lines
but that is just 'luks', not 'luks1'.
On CentOS 6 (yeah, I know, not relevenant to qemu any more), --type is unsupported. But I didn't check our other range of supported systems. My point, however, is whether this patch needs to be conditionalized based on what cryptsetup actually supports.
I tested RHEL-7 and it supported "luks1" despit the docs not reflecting it. The docs fix seems to be quite recent.
That said, I noticed that RHEL-7 (surprisingly) has support for LUKSv2, so might not have been a good test platform.
I'll check what Debian/Ubuntu support in this respect.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 10 lines · Daniel P. Berrangé
Quoted 9 lines · Eric Blake
Quoted 5 lines · Daniel P. Berrangé
Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format.
Ultimately, it would be nice to get LUKS 2 support in qemu too, but that's a much bigger job. This is fine for now.
If there is need, I volunteer to research the area and if this is feasible, add support for LUKSv2.
I haven't yet had looked at the spec.
Best regards,
Maxim Levitsky
Max Reitz
AppliedQuoted 10 lines · Daniel P. Berrangé
Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format.
Signed-off-by Daniel P. Berrangé <[email protected]>--- tests/qemu-iotests/149 | 2 +- tests/qemu-iotests/149.out | 44 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-)
Thanks, applied to my block branch:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block
Max