Laszlo Ersek
2023-May-15 17:55 UTC
[Libguestfs] [v2v PATCH 0/2] test "/dev/mapper/VG-LV" with "--key"
https://bugzilla.redhat.com/show_bug.cgi?id=2168506 This small set covers the new /dev/mapper/VG-LV "--key" ID format in the virt-v2v LUKS-on-LVM conversion test. It depends on: [libguestfs-common PATCH 0/2] recognize "/dev/mapper/VG-LV" with "--key" Message-Id: <20230515174924.290409-1-lersek at redhat.com> https://listman.redhat.com/archives/libguestfs/2023-May/031497.html I intend to extend the LUKS-on-LVM inspection tests in guestfs-tools and libguestfs similarly. Thanks for reviewing, Laszlo Laszlo Ersek (2): LUKS-on-LVM conversion test: rename VGs and LVs LUKS-on-LVM conversion test: test /dev/mapper/VG-LV translation test-data/phony-guests/make-fedora-img.pl | 30 +++++++++++--------- tests/test-v2v-fedora-luks-on-lvm-conversion.sh | 15 +++++++--- 2 files changed, 28 insertions(+), 17 deletions(-)
Laszlo Ersek
2023-May-15 17:55 UTC
[Libguestfs] [v2v PATCH 1/2] LUKS-on-LVM conversion test: rename VGs and LVs
In preparation for a subsequent patch, rename "VG" to "Volume-Group", and "LV<n>" to "Logical-Volume-<n>", in the LUKS-on-LVM conversion test. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506 Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- test-data/phony-guests/make-fedora-img.pl | 30 +++++++++++--------- tests/test-v2v-fedora-luks-on-lvm-conversion.sh | 8 +++--- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl index c30c0b53a775..830accfcbd09 100755 --- a/test-data/phony-guests/make-fedora-img.pl +++ b/test-data/phony-guests/make-fedora-img.pl @@ -224,23 +224,27 @@ EOF # Create the Volume Group on /dev/sda2. $g->pvcreate ('/dev/sda2'); - $g->vgcreate ('VG', ['/dev/sda2']); - $g->lvcreate ('Root', 'VG', 256); - $g->lvcreate ('LV1', 'VG', 32); - $g->lvcreate ('LV2', 'VG', 32); - $g->lvcreate ('LV3', 'VG', 64); + $g->vgcreate ('Volume-Group', ['/dev/sda2']); + $g->lvcreate ('Root', 'Volume-Group', 256); + $g->lvcreate ('Logical-Volume-1', 'Volume-Group', 32); + $g->lvcreate ('Logical-Volume-2', 'Volume-Group', 32); + $g->lvcreate ('Logical-Volume-3', 'Volume-Group', 64); # Format each Logical Group as a LUKS device, with a different password. - $g->luks_format ('/dev/VG/Root', 'FEDORA-Root', 0); - $g->luks_format ('/dev/VG/LV1', 'FEDORA-LV1', 0); - $g->luks_format ('/dev/VG/LV2', 'FEDORA-LV2', 0); - $g->luks_format ('/dev/VG/LV3', 'FEDORA-LV3', 0); + $g->luks_format ('/dev/Volume-Group/Root', 'FEDORA-Root', 0); + $g->luks_format ('/dev/Volume-Group/Logical-Volume-1', 'FEDORA-LV1', 0); + $g->luks_format ('/dev/Volume-Group/Logical-Volume-2', 'FEDORA-LV2', 0); + $g->luks_format ('/dev/Volume-Group/Logical-Volume-3', 'FEDORA-LV3', 0); # Open the LUKS devices. This creates nodes like /dev/mapper/*-luks. - $g->cryptsetup_open ('/dev/VG/Root', 'FEDORA-Root', 'Root-luks'); - $g->cryptsetup_open ('/dev/VG/LV1', 'FEDORA-LV1', 'LV1-luks'); - $g->cryptsetup_open ('/dev/VG/LV2', 'FEDORA-LV2', 'LV2-luks'); - $g->cryptsetup_open ('/dev/VG/LV3', 'FEDORA-LV3', 'LV3-luks'); + $g->cryptsetup_open ('/dev/Volume-Group/Root', + 'FEDORA-Root', 'Root-luks'); + $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-1', + 'FEDORA-LV1', 'LV1-luks'); + $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-2', + 'FEDORA-LV2', 'LV2-luks'); + $g->cryptsetup_open ('/dev/Volume-Group/Logical-Volume-3', + 'FEDORA-LV3', 'LV3-luks'); # Phony root filesystem. $g->mkfs ('ext2', '/dev/mapper/Root-luks', blocksize => 4096, label => 'ROOT'); diff --git a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh index 1a4068cf678f..7ad17e0d827f 100755 --- a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh +++ b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh @@ -28,9 +28,9 @@ skip_if_skipped f=../test-data/phony-guests/fedora-luks-on-lvm.img requires test -f $f -keys=(--key /dev/VG/Root:key:FEDORA-Root - --key /dev/VG/LV1:key:FEDORA-LV1 - --key /dev/VG/LV2:key:FEDORA-LV2 - --key /dev/VG/LV3:key:FEDORA-LV3) +keys=(--key /dev/Volume-Group/Root:key:FEDORA-Root + --key /dev/Volume-Group/Logical-Volume-1:key:FEDORA-LV1 + --key /dev/Volume-Group/Logical-Volume-2:key:FEDORA-LV2 + --key /dev/Volume-Group/Logical-Volume-3:key:FEDORA-LV3) $VG virt-v2v --debug-gc -i disk $f -o null "${keys[@]}"
Laszlo Ersek
2023-May-15 17:55 UTC
[Libguestfs] [v2v PATCH 2/2] LUKS-on-LVM conversion test: test /dev/mapper/VG-LV translation
In the LUKS-on-LVM conversion test, repeat the null conversion with such "--key" options that exercise the recent "/dev/mapper/VG-LV" -> "/dev/VG/LV" translation (unescaping) from libguestfs-common. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168506 Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- tests/test-v2v-fedora-luks-on-lvm-conversion.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh index 7ad17e0d827f..605b19fb523a 100755 --- a/tests/test-v2v-fedora-luks-on-lvm-conversion.sh +++ b/tests/test-v2v-fedora-luks-on-lvm-conversion.sh @@ -34,3 +34,10 @@ keys=(--key /dev/Volume-Group/Root:key:FEDORA-Root --key /dev/Volume-Group/Logical-Volume-3:key:FEDORA-LV3) $VG virt-v2v --debug-gc -i disk $f -o null "${keys[@]}" + +keys=(--key /dev/mapper/Volume--Group-Root:key:FEDORA-Root + --key /dev/mapper/Volume--Group-Logical--Volume--1:key:FEDORA-LV1 + --key /dev/mapper/Volume--Group-Logical--Volume--2:key:FEDORA-LV2 + --key /dev/mapper/Volume--Group-Logical--Volume--3:key:FEDORA-LV3) + +$VG virt-v2v --debug-gc -i disk $f -o null "${keys[@]}"
Laszlo Ersek
2023-May-19 09:47 UTC
[Libguestfs] [v2v PATCH 0/2] test "/dev/mapper/VG-LV" with "--key"
On 5/15/23 19:55, Laszlo Ersek wrote:> https://bugzilla.redhat.com/show_bug.cgi?id=2168506 > > This small set covers the new /dev/mapper/VG-LV "--key" ID format in the > virt-v2v LUKS-on-LVM conversion test. It depends on: > > [libguestfs-common PATCH 0/2] recognize "/dev/mapper/VG-LV" with "--key" > Message-Id: <20230515174924.290409-1-lersek at redhat.com> > https://listman.redhat.com/archives/libguestfs/2023-May/031497.html > > I intend to extend the LUKS-on-LVM inspection tests in guestfs-tools and > libguestfs similarly. > > Thanks for reviewing, > Laszlo > > Laszlo Ersek (2): > LUKS-on-LVM conversion test: rename VGs and LVs > LUKS-on-LVM conversion test: test /dev/mapper/VG-LV translation > > test-data/phony-guests/make-fedora-img.pl | 30 +++++++++++--------- > tests/test-v2v-fedora-luks-on-lvm-conversion.sh | 15 +++++++--- > 2 files changed, 28 insertions(+), 17 deletions(-)Commit range e83de8abe6c5..3060af01e87f. Thanks! Laszlo