nixpkgs/nixos/tests
aszlig 1f34503010
nixos/tests/installer: Add test for LUKS rootfs.
This serves as a regression test for #7859.

It's pretty straightforward, except from the fact that nixos-generate-
config doesn't detect LUKS devices and the "sleep 60".

As for the former, I have tried to add support for LUKS devices for
nixos-generate-config, but it's not so easy as it sounds, because we
need to create a device tree across all possible mappers and/or LVM up
to the "real" device and then decide whether it is relevant to what is
currently mounted. So I guess this is something for the nixpart branch
(see #2079).

And the latter isn't very trivial as well, because the LUKS passphrase
prompt is issued on /dev/console, which is the last "console=..." kernel
parameter (thus the `mkAfter`). So we can't simply grep the log, because
the prompt ends up being on one terminal only (tty0) and using select()
on $machine->{socket} doesn't work very well, because the FD is always
"ready for read". If we would read the FD, we would conflict with
$machine->connect and end up having an inconsistent state. Another idea
would be to use multithreading to do $machine->connect while feeding the
passphrase prompt in a loop and stop the thread once $machine->connect
is done. Turns out that this is not so easy as well, because the threads
need to share the $machine object and of course need to do properly
locking.

In the end I decided to use the "blindly hope that 60 seconds is enough"
approach for now and come up with a better solution later. Other VM
tests surely use sleep as well, but it's $machine->sleep, which is bound
to the clock of the VM, so if the build machine is on high load, a
$machine->sleep gets properly delayed but the timer outside the VM won't
get that delay, so the test is not deterministic.

Tested against the following revisions:

5e3fe39: Before the libgcrypt cleanup (a71f78a) that broke cryptsetup.
69a6848: While cryptsetup was broken (obviously the test failed).
15faa43: After cryptsetup has been switched to OpenSSL (fd588f9).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-21 13:21:41 +02:00
..
common Remove fixed uid in tests 2015-05-13 16:23:57 +02:00
avahi.nix
bittorrent.nix
blivet.nix
boot.nix nixos: test: add tests for booting installation iso in various ways 2015-03-24 22:09:07 +01:00
cadvisor.nix nixos: add cadvisor service 2014-12-28 20:21:41 +01:00
check-filesystems.nix
chromium.nix tests/chromium: Work around popup close flakiness. 2015-04-02 14:12:19 +02:00
cjdns.nix nixos/tests/cjdns: do not build cjdns at evaluation 2015-03-21 10:17:48 -04:00
containers.nix
docker-registry.nix
docker.nix
etcd.nix
firefox.nix
firewall.nix
fleet.nix
gitlab.nix
gnome3.nix
i3wm.nix nixos: Add VM test for i3 window manager. 2015-03-05 05:21:36 +01:00
influxdb.nix
installer.nix nixos/tests/installer: Add test for LUKS rootfs. 2015-05-21 13:21:41 +02:00
ipv6.nix
jenkins.nix nixos/tests/jenkins: increase timeout to 6 minutes 2015-02-10 16:50:50 +01:00
kde4.nix
kexec.nix
kubernetes.nix kubernetes: update to 0.12.1, fix module 2015-03-18 14:37:03 +01:00
login.nix
logstash.nix
make-test.nix
mesos.nix
misc.nix tests/misc.nix: Ensure that the Nix DB is initialised correctly 2015-04-07 15:10:47 +02:00
mpich-example.c
mpich.nix
mumble.nix
munin.nix
mysql-replication.nix
mysql.nix
nat.nix
networking-proxy.nix
networking.nix nixos/tests/networking: Clean up and attempt to make more reliable 2015-04-10 23:23:53 -07:00
nfs.nix Add nfs4 test 2015-04-02 17:44:48 +02:00
nsd.nix
openssh.nix
panamax.nix panamax: simplify, refactor, add test 2015-02-07 15:32:20 +01:00
partition.nix
peerflix.nix
phabricator.nix
printing.nix cups: Second attempt to fix our printing tests; add more sleep statements 2015-05-14 17:46:32 +02:00
proxy.nix
quake3.nix
rabbitmq.nix
run-in-machine.nix
simple.nix
subversion.nix
test-config-examples.sh
testdb.sql
tomcat.nix
trac.nix
udisks2.nix
virtualbox.nix nixos/tests/vbox: Make GUI startup more robust. 2015-04-04 17:09:15 +02:00
xfce.nix