41 lines
1.6 KiB
Perl
Executable file
41 lines
1.6 KiB
Perl
Executable file
#!/usr/bin/perl -T
|
|
|
|
BEGIN {
|
|
require "./debian/tests/utils/mock.pm";
|
|
CryptrootTest::Mock::->import();
|
|
}
|
|
|
|
my %passphrases;
|
|
$passphrases{$_} = $_ foreach qw/vda3_crypt vda4_crypt vdb3_crypt vdb4_crypt/;
|
|
unlock_disk(\%passphrases) for 1 .. scalar(%passphrases);
|
|
|
|
# check that the above was done at initramfs stage
|
|
expect($SERIAL => qr#\bRunning /scripts/init-bottom\s*\.\.\. #);
|
|
|
|
login("root");
|
|
|
|
# make sure the root FS and swap are help by dm-crypt devices
|
|
shell(q{cryptsetup luksOpen --test-passphrase /dev/vda3 <<<vda3_crypt}, rv => 0);
|
|
shell(q{cryptsetup luksOpen --test-passphrase /dev/vda4 <<<vda4_crypt}, rv => 0);
|
|
shell(q{cryptsetup luksOpen --test-passphrase /dev/vdb3 <<<vdb3_crypt}, rv => 0);
|
|
shell(q{cryptsetup luksOpen --test-passphrase /dev/vdb4 <<<vdb4_crypt}, rv => 0);
|
|
|
|
my $out = shell(q{lsblk -in -oNAME,TYPE,MOUNTPOINT /dev/vda3});
|
|
die unless $out =~ m#^`-vda3_crypt\s+crypt\s*$#m;
|
|
die unless $out =~ m#^ `-md1\s+raid0\s+\[SWAP\]\s*$#m;
|
|
|
|
$out = shell(q{lsblk -in -oNAME,TYPE,MOUNTPOINT /dev/vdb3});
|
|
die unless $out =~ m#^`-vdb3_crypt\s+crypt\s*$#m;
|
|
die unless $out =~ m#^ `-md1\s+raid0\s+\[SWAP\]\s*$#m;
|
|
|
|
$out = shell(q{lsblk -in -oNAME,TYPE,MOUNTPOINT /dev/vda4});
|
|
die unless $out =~ m#^`-vda4_crypt\s+crypt\s*$#m;
|
|
die unless $out =~ m#^ [`|]-cryptvg-swap\s+lvm\s+\[SWAP\]\s*$#m;
|
|
die unless $out =~ m#^ [`|]-cryptvg-root\s+lvm\s+/\s*$#m;
|
|
|
|
$out = shell(q{lsblk -in -oNAME,TYPE,MOUNTPOINT /dev/vdb4});
|
|
die unless $out =~ m#^`-vdb4_crypt\s+crypt\s*$#m;
|
|
die unless $out =~ m#^ [`|]-cryptvg-swap\s+lvm\s+\[SWAP\]\s*$#m;
|
|
die unless $out =~ m#^ [`|]-cryptvg-root\s+lvm\s+/\s*$#m;
|
|
|
|
QMP::quit();
|