Commit graph

69 commits

Author SHA1 Message Date
Eelco Dolstra a025e7e7e2 Provide a common share between VMs to allow easy communication
Every VM now mounts a common SMB share on /tmp/shared.
2012-08-16 10:47:33 -04:00
Eelco Dolstra 87ae768665 Fix the LVM installer test
GRUB 2 doesn't want to boot off a LVM disk:

machine# installing the GRUB 2 boot loader on /dev/vda...
machine# Path `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting.
machine# /nix/store/7yc535h1lim1a5gkhjb3fr6c8193dv8w-install-grub.pl: installation of GRUB on /dev/vda failed

In theory GRUB 2 supports booting from LVM, but we probably need to
generate the right grub.conf (see
https://wiki.archlinux.org/index.php/GRUB2#LVM).

http://hydra.nixos.org/build/2904680
2012-07-26 16:02:33 -04:00
Eelco Dolstra 1a2b3cc5e4 Fix the tests.installer.grub1 test
GRUB 1 doesn't understand /dev/vda, so use a SCSI rather than virtio disk.
2012-07-26 16:02:33 -04:00
Marc Weber 47e67f5e9c renaming all occurrences of /var/run/{booted,current}-system
in particular those found in docs
still keeping old path in modules/config/shells.nix for unkown reason (?)
2012-07-23 14:01:35 -04:00
Eelco Dolstra 82019c01bb Test driver: exit when all VMs have exited rather than sleeping forever 2012-06-22 14:31:07 -04:00
Eelco Dolstra fa50d105d7 * Pass -cpu kvm64 in NixOS VMs (and add a simple regression test for
GMP).

svn path=/nixos/trunk/; revision=33849
2012-04-19 18:56:35 +00:00
Eelco Dolstra 1d0c23bffb * Use a raw disk for the installer test. This speeds it up by almost
two minutes on my laptop.  Note that due to sparse allocation, raw
  disks don't actually take up more space than qcow2 disks (and
  they're temporary anyway).

svn path=/nixos/trunk/; revision=33746
2012-04-11 10:05:29 +00:00
Eelco Dolstra a395e46192 * Fix the NFS Upstart dependencies. Mountd is now started before
nfsd, as suggested by the nfs-utils README.

  Also, rather than relying on Upstart events (which have all sorts of
  problems, especially if you have jobs that have multiple
  dependencies), we know just let jobs start their on prerequisites.
  That is, nfsd starts mountd in its preStart script; mountd starts
  statd; statd starts portmap.  Likewise, mountall starts statd to
  ensure that it can mount NFS filesystems.  This means that doing
  something like "start nfsd" from the command line will Do The Right
  Thing and start the dependencies of nfsd.

svn path=/nixos/trunk/; revision=33172
2012-03-16 20:10:14 +00:00
Eelco Dolstra d75efe4aa1 * For security, don't mount the entire host filesystem.
svn path=/nixos/trunk/; revision=28429
2011-08-09 14:07:44 +00:00
Eelco Dolstra 2dc81fc9dd * Shut up warnings about QEMU_OPTS being undefined.
svn path=/nixos/trunk/; revision=27982
2011-07-28 09:41:07 +00:00
Eelco Dolstra 0f544f1ea8 * Add a command `forwardPort' to forward a TCP port on the host to a
TCP port on the guest.  Useful during testing (e.g. to access a web
  server in the guest through a web browser on the host).

svn path=/nixos/trunk/; revision=26987
2011-04-27 09:54:17 +00:00
Eelco Dolstra c430bf5cc3 * Add virtio_console to the CD because the backdoor requires it.
* The booted CD no longer requires "-net user".

svn path=/nixos/trunk/; revision=26427
2011-03-19 08:58:56 +00:00
Eelco Dolstra be0fca5781 * Use QEMU/KVM's paravirtualised console device for the backdoor.
This has the advantage that it doesn't depend on networking being
  up.
* Move common QEMU/KVM guest configuration to profiles/qemu-guest.nix.

svn path=/nixos/trunk/; revision=26421
2011-03-18 12:38:22 +00:00
Eelco Dolstra 158a60465f * The vde_switch startup code was reading from the wrong filehandle,
so the startup synchronisation didn't work, causing spurious QEMU
  failures ("Device 'vde' could not be initialized").

svn path=/nixos/trunk/; revision=26055
2011-02-22 10:41:11 +00:00
Eelco Dolstra 32aa967ee1 * Only add a VDE NIC if there is a webserver.
svn path=/nixos/trunk/; revision=25986
2011-02-16 10:07:28 +00:00
Eelco Dolstra 88a4fda7d8 * Don't daemonise vde_switch so that it's cleaned up automatically.
This is useful for interactive use.

svn path=/nixos/trunk/; revision=25570
2011-01-14 16:01:47 +00:00
Eelco Dolstra b3dbcbe249 * Use vde_switch instead of QEMU's multicast feature to tie QEMU VMs
together into virtual networks.  This has several advantages:

  - It's more secure because the QEMU instances use Unix domain
    sockets to talk to the switch.

  - It doesn't depend on the host's network interfaces.  (Local
    multicast fails if there is no default gateway, so for instance it
    fails if a laptop is not connected to any network.)

  - VDE devices can be connected together to form arbitrary network
    topologies.

  - VDE has a "wirefilter" tool to emulate delays and packet loss,
    which are useful for network testing.

svn path=/nixos/trunk/; revision=25526
2011-01-12 18:47:23 +00:00
Eelco Dolstra 5560e422ad * Prerender the tree toggle.
svn path=/nixos/trunk/; revision=25494
2011-01-10 15:29:22 +00:00
Eelco Dolstra 0b33ba7e53 * Clean up the presentation of the log file a bit.
svn path=/nixos/trunk/; revision=25493
2011-01-10 15:17:38 +00:00
Eelco Dolstra 60b6eb7579 * Add a method Machine::sleep to sleep N seconds in virtual (guest)
time rather than host real time.

svn path=/nixos/trunk/; revision=25491
2011-01-10 14:41:16 +00:00
Eelco Dolstra 8f831338df * Log top-level errors.
svn path=/nixos/trunk/; revision=25482
2011-01-09 22:52:27 +00:00
Eelco Dolstra b5b7375eea * If a subtest fails, mark the build as failed.
svn path=/nixos/trunk/; revision=25474
2011-01-09 18:56:11 +00:00
Eelco Dolstra 7fd8ce0d95 * If a subtest fails, continue to the next subtest.
svn path=/nixos/trunk/; revision=25472
2011-01-09 18:46:02 +00:00
Eelco Dolstra e4c1fb3ea7 * Pretty-print the VM build log and publish it as a build product.
svn path=/nixos/trunk/; revision=25468
2011-01-09 17:58:52 +00:00
Eelco Dolstra 405e4dd42e * Somewhere "set_link" stopped accepting "down" and "up" as valid
parameters.

svn path=/nixos/trunk/; revision=25466
2011-01-09 15:44:48 +00:00
Eelco Dolstra e343a16a36 * Improved logging in the test driver.
* Support subtests.

svn path=/nixos/trunk/; revision=25451
2011-01-06 17:28:35 +00:00
Eelco Dolstra 7378e17f74 * Test driver: write structured log info to $out/log.xml (not finished
yet).
* Machine->new -> createMachine (because VMs must be tracked in the
  %vms hash).

svn path=/nixos/trunk/; revision=25427
2011-01-05 15:27:21 +00:00
Eelco Dolstra 0966854590 * Use makeWrapper in building the test driver.
* In the interactive test driver, provide a function "testScript" to
  run the non-interactive test script.

svn path=/nixos/trunk/; revision=25426
2011-01-05 14:04:38 +00:00
Eelco Dolstra dac1936869 * If $DISPLAY is set (i.e. in interactive mode), show QEMU's graphical
output.

svn path=/nixos/trunk/; revision=25157
2010-12-16 16:58:06 +00:00
Eelco Dolstra 445827ad45 * Added a convenience derivation for running the test driver
interactively on a network specification.  For instance:

  $ nix-build tests/ -A quake3.driver
  $ ./result/bin/nixos-test-driver
  > startAll;
  client1: starting vm
  client1: QEMU running (pid 14971)
  server: starting vm
  server: QEMU running (pid 14982)
  ...
  > $client1->execute("quake3 ...");

* Use the GNU readline library in interactive mode.

svn path=/nixos/trunk/; revision=25156
2010-12-16 15:54:15 +00:00
Eelco Dolstra 8496dbf350 * Absolutize the path to the VM start script.
svn path=/nixos/trunk/; revision=25154
2010-12-16 13:53:17 +00:00
Ludovic Courtès 4695f790cf test-driver: Add `startJob' method.
svn path=/nixos/trunk/; revision=24210
2010-10-10 22:37:45 +00:00
Eelco Dolstra 20a88efffa * 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
2010-06-20 15:33:44 +00:00
Eelco Dolstra 411139148d * Put a timeout on the call to readline.
svn path=/nixos/branches/boot-order/; revision=22338
2010-06-19 21:57:20 +00:00
Eelco Dolstra 363806e89b * To establish the connection to the root shell in the guest, let the
guest connect to a Unix domain socket on the host rather than the
  other way around.  The former is a QEMU feature (guestfwd to a
  socket) while the latter requires a patch (which we can now get rid
  of).

svn path=/nixos/branches/boot-order/; revision=22331
2010-06-18 19:31:02 +00:00
Eelco Dolstra cf7e902283 * Intercept SIGCHLD to prevent accept() from waiting forever if QEMU
dies before connecting to the monitor.

svn path=/nixos/branches/boot-order/; revision=22328
2010-06-18 15:30:36 +00:00
Eelco Dolstra eab5aff8d0 * Drop the -no-kvm-irqchip flag here as well.
svn path=/nixos/branches/boot-order/; revision=22281
2010-06-15 18:00:56 +00:00
Eelco Dolstra 46ac1375a7 * Don't use -smb and -no-kvm-irqchip. Maybe this makes VM builds more
reliable.

svn path=/nixos/branches/boot-order/; revision=22280
2010-06-15 16:15:17 +00:00
Eelco Dolstra 483c322a62 * mustFail -> fail.
* Added a function to crash a VM.

svn path=/nixos/branches/boot-order/; revision=22200
2010-06-09 13:46:52 +00:00
Eelco Dolstra 77a4004df1 * The installer test lost the QEMU flags to set up the NIC to talk to
the web server somewhere, so put them back in
  (http://hydra.nixos.org/build/424923).

svn path=/nixos/trunk/; revision=22003
2010-05-27 12:20:37 +00:00
Eelco Dolstra 07df264e0c * mustSucceed -> succeed.
svn path=/nixos/trunk/; revision=21943
2010-05-22 21:27:38 +00:00
Eelco Dolstra 4dac9e5814 * Allow more complex network topologies in distributed tests. Each
machine can now declare an option `virtualisation.vlans' that causes
  it to have network interfaces connected to each listed virtual
  network.  For instance,

    virtualisation.vlans = [ 1 2 ];

  causes the machine to have two interfaces (in addition to eth0, used
  by the test driver to control the machine): eth1 connected to
  network 1 with IP address 192.168.1.<i>, and eth2 connected to
  network 2 with address 192.168.2.<i> (where <i> is the index of the
  machine in the `nodes' attribute set).  On the other hand,
  
    virtualisation.vlans = [ 2 ];

  causes the machine to only have an eth1 connected to network 2 with
  address 192.168.2.<i>.  So each virtual network <n> is assigned the
  IP range 192.168.<n>.0/24.

  Each virtual network is implemented using a separate multicast
  address on the host, so guests really cannot talk to networks to
  which they are not connected.

* Added a simple NAT test to demonstrate this.

* Added an option `virtualisation.qemu.options' to specify QEMU
  command-line options.  Used to factor out some commonality between
  the test driver script and the interactive test script.

svn path=/nixos/trunk/; revision=21928
2010-05-20 21:07:32 +00:00
Eelco Dolstra 55c349fe20 * Added a test that checks whether users can log in on a virtual
console.  This uses the `sendkey' command in the QEMU monitor.
* For the block/unblock primitives, use the `set_link' command in the
  QEMU monitor.

svn path=/nixos/trunk/; revision=19854
2010-02-06 13:08:15 +00:00
Eelco Dolstra fc805fe541 * In the test driver, connect to the QEMU monitor so that we can send
it special commands such as "screendump", "sendkey" and so on.
* Take screenshots using the "screendump" command.  This has the
  advantage over "scrot" that it also supports taking a picture of the
  console, and is not affected by weird X visuals.

svn path=/nixos/trunk/; revision=19837
2010-02-05 16:51:37 +00:00
Eelco Dolstra 5b60c280d7 * Make the Quake 3 test less timing-sensitive.
svn path=/nixos/trunk/; revision=19816
2010-02-04 13:59:31 +00:00
Eelco Dolstra 160b28baa0 * Increase the timeout.
svn path=/nixos/trunk/; revision=19708
2010-01-27 12:46:53 +00:00
Eelco Dolstra fc583b7054 * When QEMU encounters a "disk full" condition on the host filesystem,
its default behaviour is to stop the emulator (i.e. suspend the VM).
  For automated tests, this is bad, because is makes the VM appear to
  hang without any error message.  The "werror=report" flag causes
  QEMU to report the problem to the VM.  As a side effect QEMU exits
  very elegantly:

    [    2.308668] end_request: I/O error, dev vda, sector 534400
    [    2.309611] Buffer I/O error on device vda, logical block 66800
    ...
    *** glibc detected *** /nix/store/yhngqrww53j0aw7z7v4bv948x5g5fc3d-qemu-kvm-0.12.1.2/bin/qemu-system-x86_64: double free or corruption (!prev): 0x08e3e040 ***
    Aborted

  So I guess we now depend on a bug in QEMU :-)

svn path=/nixos/trunk/; revision=19703
2010-01-27 10:36:43 +00:00
Eelco Dolstra ec3398e4b2 * Move the serial console kernel parameters to test-instrumentation.nix.
svn path=/nixos/trunk/; revision=19275
2010-01-06 21:16:57 +00:00
Eelco Dolstra bffb5450e5 * Perform a full installation and boot from the installed system.
svn path=/nixos/trunk/; revision=19274
2010-01-06 20:52:05 +00:00
Eelco Dolstra cbca2f72df * Put a timeout on all wait* actions.
svn path=/nixos/trunk/; revision=19264
2010-01-06 15:14:26 +00:00