[libvirt] [tck PATCH 0/2] Enable the storage encryption test

The test was present, but at the time the test was added libvirt (apparently) didn't fully support LUKS encryption with disks. Erik Skultety (2): scripts: qemu: Fix the disk encryption test description scripts: qemu: Enable disk encryption test scripts/qemu/100-disk-encryption.t | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.23.0

The original text was a copy-paste from a different test case. Signed-off-by: Erik Skultety <eskultet@redhat.com> --- scripts/qemu/100-disk-encryption.t | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/qemu/100-disk-encryption.t b/scripts/qemu/100-disk-encryption.t index 12386ae..2c988ec 100644 --- a/scripts/qemu/100-disk-encryption.t +++ b/scripts/qemu/100-disk-encryption.t @@ -16,13 +16,12 @@ =head1 NAME -domain/060-persistent-lifecycle.t - Persistent domain lifecycle +domain/100-disk-encryption.t - LUKS disk encryption =head1 DESCRIPTION -The test case validates the core lifecycle operations on -persistent domains. A persistent domain is one with a -configuration enabling it to be tracked when inactive. +The test case verifies that libvirt is able to both create LUKS encrypted +storage volumes as well as start a domain with such disks assigned. =cut -- 2.23.0

On Mon, Nov 25, 2019 at 01:38:12PM +0100, Erik Skultety wrote:
The original text was a copy-paste from a different test case.
Signed-off-by: Erik Skultety <eskultet@redhat.com> --- scripts/qemu/100-disk-encryption.t | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: 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 :|

At the time the test was added, volume encryption wasn't fully supported in libvirt. For disks of type 'raw', this is not the case anymore, so let's adjust the test according to that fact and enable it. Signed-off-by: Erik Skultety <eskultet@redhat.com> --- scripts/qemu/100-disk-encryption.t | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/qemu/100-disk-encryption.t b/scripts/qemu/100-disk-encryption.t index 2c988ec..b44dbc8 100644 --- a/scripts/qemu/100-disk-encryption.t +++ b/scripts/qemu/100-disk-encryption.t @@ -41,10 +41,9 @@ END { $tck->cleanup if $tck; } SKIP: { skip "Only relevant to QEMU driver", 8 unless $conn->get_type() eq "QEMU"; - skip "Libvirt LUKS support isn't ready", 8; my $dir = $tck->bucket_dir("300-disk-encryption"); -my $disk = catfile($dir, "demo.qcow2"); +my $disk = catfile($dir, "demo.img"); my $secretXML = <<EOF; @@ -73,9 +72,9 @@ diag "Creating pool $poolXML"; lives_ok(sub { $pool = $conn->create_storage_pool($poolXML) }, "pool created"); -my $volXML = Sys::Virt::TCK::StorageVolBuilder->new(name => "demo.qcow2") +my $volXML = Sys::Virt::TCK::StorageVolBuilder->new(name => "demo.img") ->capacity(1024*1024*1024) - ->format("qcow2") + ->format("raw") ->encryption_format("luks") ->secret($secretUUID) ->as_xml(); @@ -86,7 +85,7 @@ diag "Creating volume $volXML"; lives_ok(sub { $vol = $pool->create_volume($volXML) }, "volume created"); my $xml = $tck->generic_domain(name => "tck") - ->disk(format => { name => "qemu", type => "qcow2" }, + ->disk(format => { name => "qemu", type => "raw" }, encryption_format => "luks", secret => $secretUUID, type => "file", -- 2.23.0

On Mon, Nov 25, 2019 at 01:38:13PM +0100, Erik Skultety wrote:
At the time the test was added, volume encryption wasn't fully supported in libvirt. For disks of type 'raw', this is not the case anymore, so let's adjust the test according to that fact and enable it.
Signed-off-by: Erik Skultety <eskultet@redhat.com> --- scripts/qemu/100-disk-encryption.t | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: 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 :|

On Mon, Nov 25, 2019 at 01:38:11PM +0100, Erik Skultety wrote:
The test was present, but at the time the test was added libvirt (apparently) didn't fully support LUKS encryption with disks.
Erik Skultety (2): scripts: qemu: Fix the disk encryption test description scripts: qemu: Enable disk encryption test
scripts/qemu/100-disk-encryption.t | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
ping?
participants (2)
-
Daniel P. Berrangé
-
Erik Skultety