From 20a88efffa6a69b97a293b3a923c052501a964d7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 20 Jun 2010 15:33:44 +0000 Subject: [PATCH] * Fix networking in the installer test. * If connecting to the host fails in the guest, then shutdown immediately. svn path=/nixos/branches/boot-order/; revision=22341 --- lib/test-driver/Machine.pm | 2 +- modules/testing/test-instrumentation.nix | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/test-driver/Machine.pm b/lib/test-driver/Machine.pm index 46fbf6d60cd..9f5971d70a1 100644 --- a/lib/test-driver/Machine.pm +++ b/lib/test-driver/Machine.pm @@ -28,7 +28,7 @@ sub new { # !!! merge with qemu-vm.nix. $startCommand = "qemu-system-x86_64 -m 384 " . - "-net nic,model=virtio -net user \$QEMU_OPTS "; + "-net nic,model=virtio -net user,\$QEMU_NET_OPTS \$QEMU_OPTS "; $startCommand .= "-drive file=" . Cwd::abs_path($args->{hda}) . ",if=virtio,boot=on,werror=report " if defined $args->{hda}; $startCommand .= "-cdrom $args->{cdrom} " diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index 2515edf6192..655cda31ed6 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -24,7 +24,8 @@ in config = { jobs.backdoor = - { startOn = "started network-interfaces"; + { startOn = "ip-up"; + stopOn = "never"; script = '' @@ -35,10 +36,12 @@ in source /etc/profile cd /tmp echo "connecting to host..." > /dev/ttyS0 - exec ${pkgs.socat}/bin/socat tcp:10.0.2.6:23 exec:${rootShell} 2> /dev/ttyS0 + ${pkgs.socat}/bin/socat tcp:10.0.2.6:23 exec:${rootShell} 2> /dev/ttyS0 || poweroff -f ''; + + respawn = false; }; - + boot.postBootCommands = '' # Panic on out-of-memory conditions rather than letting the