mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Create a new (fake) Fedora disk image with two partitions. /dev/sda1 is the boot partition as usual, /dev/sda2 is used as an LVM PV. The VG has four LVs, Root and LV1 through LV3. Each LV holds a LUKS device (with a different key). Each decrypted LUKS device holds an ext2 filesystem, with "/dev/mapper/Root-luks" holding the root filesystem. Each filesystem has a dedicated label (ROOT, LV1, LV2, LV3). In the test case, run guestfish in inspector mode, twice. In the first invocation, provide the LUKS passphrases by LV name. Also specific to the first invocation, fetch the LUKS UUIDs by LV name. In the second invocation, provide the LUKS passphrases by UUID. In both invocations, after decryption, check the filesystem labels, the /dev/mapper/* names generated for the decrypted LUKS block devices, and the existence of "/etc/fedora-release" on the root filesystem. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1658126 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20220223162120.16729-3-lersek@redhat.com> Acked-by: Richard W.M. Jones <rjones@redhat.com>
326 lines
8.0 KiB
XML
326 lines
8.0 KiB
XML
<!--
|
|
libguestfs test images
|
|
@configure_input@
|
|
Copyright (C) 2013 Red Hat Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
To use the test guests by name, specify the following libvirt URI:
|
|
test://$(abs_builddir)/guests.xml
|
|
|
|
eg:
|
|
./run ./df/virt-df -c test://@abs_builddir@/guests.xml
|
|
./run ./align/virt-alignment-scan -c test://@abs_builddir@/guests.xml
|
|
-->
|
|
<node>
|
|
|
|
<!-- no disks -->
|
|
<domain type='test'>
|
|
<name>nodisks</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
</devices>
|
|
</domain>
|
|
|
|
<!-- deliberately missing disks -->
|
|
<domain type='test'>
|
|
<name>missing-disks</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/no-such-disk.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>blank-bootroot</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/blank-bootroot.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>blank-bootrootlv</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/blank-bootrootlv.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>blank-disk</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/blank-disk.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>blank-fs</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/blank-fs.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>blank-part</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/blank-part.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>debian</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/debian.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>fedora</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/fedora.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>fedora-btrfs</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/fedora-btrfs.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<!-- LUKS passwords are 'FEDORA-Root', 'FEDORA-LV1', 'FEDORA-LV2',
|
|
'FEDORA-LV3' -->
|
|
<domain type='test'>
|
|
<name>fedora-luks-on-lvm</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/fedora-luks-on-lvm.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<!-- LUKS password is 'FEDORA' -->
|
|
<domain type='test'>
|
|
<name>fedora-lvm-on-luks</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/fedora-lvm-on-luks.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>fedora-md1</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/fedora-md1.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>fedora-md2</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/fedora-md2.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>ubuntu</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/ubuntu.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>archlinux</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/archlinux.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>coreos</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/coreos.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
</devices>
|
|
</domain>
|
|
|
|
<domain type='test'>
|
|
<name>windows</name>
|
|
<memory>1048576</memory>
|
|
<os>
|
|
<type>hvm</type>
|
|
<boot dev='hd'/>
|
|
</os>
|
|
<devices>
|
|
<disk type='file' device='disk'>
|
|
<driver name='qemu' type='raw'/>
|
|
<source file='@abs_builddir@/windows.img'/>
|
|
<target dev='vda' bus='virtio'/>
|
|
</disk>
|
|
<interface type='network'>
|
|
<mac address='00:11:22:33:44:55'/>
|
|
<source network='default'/>
|
|
<model type='virtio'/>
|
|
</interface>
|
|
<video>
|
|
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
|
|
</video>
|
|
</devices>
|
|
</domain>
|
|
|
|
</node>
|