diff --git a/.gitignore b/.gitignore index a78fd1633..930998007 100644 --- a/.gitignore +++ b/.gitignore @@ -646,6 +646,7 @@ Makefile.in /test-data/phony-guests/debian.img /test-data/phony-guests/fedora.img /test-data/phony-guests/fedora-btrfs.img +/test-data/phony-guests/fedora-luks.img /test-data/phony-guests/fedora-md1.img /test-data/phony-guests/fedora-md2.img /test-data/phony-guests/fedora-name.db diff --git a/test-data/phony-guests/Makefile.am b/test-data/phony-guests/Makefile.am index 4e978f654..6a0d23e04 100644 --- a/test-data/phony-guests/Makefile.am +++ b/test-data/phony-guests/Makefile.am @@ -51,6 +51,7 @@ disk_images = \ fedora-md1.img \ fedora-md2.img \ fedora-btrfs.img \ + fedora-luks.img \ ubuntu.img \ archlinux.img \ coreos.img \ @@ -100,6 +101,13 @@ fedora-btrfs.img: make-fedora-img.pl \ fedora-packages.db SRCDIR=$(srcdir) LAYOUT=btrfs $(top_builddir)/run --test ./$< +# Make a (dummy) Fedora image with LVM encrypted with LUKS. +fedora-luks.img: make-fedora-img.pl \ + fedora-journal.tar.xz \ + fedora-name.db \ + fedora-packages.db + SRCDIR=$(srcdir) LAYOUT=lvm-luks $(top_builddir)/run --test ./$< + # Make a (dummy) Debian image. debian.img: make-debian-img.sh SRCDIR=$(srcdir) $(top_builddir)/run --test ./$< diff --git a/test-data/phony-guests/guests.xml.in b/test-data/phony-guests/guests.xml.in index 9c7c989dc..4139d04f6 100644 --- a/test-data/phony-guests/guests.xml.in +++ b/test-data/phony-guests/guests.xml.in @@ -151,6 +151,22 @@ + + fedora + 1048576 + + hvm + + + + + + + + + + + fedora-btrfs 1048576 @@ -167,8 +183,9 @@ + - fedora + fedora-luks 1048576 hvm @@ -177,7 +194,7 @@ - + diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl index cd1c4a48c..c665f0d19 100755 --- a/test-data/phony-guests/make-fedora-img.pl +++ b/test-data/phony-guests/make-fedora-img.pl @@ -153,6 +153,35 @@ EOF $g->mount ('btrfsvol:/dev/sda2/root', '/'); } +elsif ($ENV{LAYOUT} eq 'lvm-luks') { + push (@images, "fedora-luks.img-t"); + + open (my $fstab, '>', "fedora.fstab") or die; + print $fstab <disk_create ("fedora-luks.img-t", "raw", $IMAGE_SIZE); + + $g->add_drive ("fedora-luks.img-t", format => "raw"); + $g->launch (); + + $g->part_init ('/dev/sda', 'mbr'); + foreach my $p (@PARTITIONS) { + $g->part_add('/dev/sda', @$p); + } + + # Put LUKS on the second partition. + $g->luks_format ('/dev/sda2', 'FEDORA', 0); + $g->luks_open ('/dev/sda2', 'FEDORA', 'luks'); + + init_lvm_root ('/dev/mapper/luks'); +} + else { print STDERR "$0: Unknown LAYOUT: ",$ENV{LAYOUT},"\n"; exit 1;