Commit graph

59 commits

Author SHA1 Message Date
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
Eelco Dolstra 1b21115f61 * Support creating a virtual disk in the test driver.
svn path=/nixos/trunk/; revision=19263
2010-01-06 14:37:23 +00:00
Eelco Dolstra 816f12da88 * Test driver: added support for running from an ISO image. The goal
is to merge test-nixos-install-from-cd so that we have a single
  testing framework.

svn path=/nixos/trunk/; revision=19259
2010-01-06 13:36:21 +00:00
Eelco Dolstra bc68c2985c * Added a function waitForX, which returns when the X server accepts
connections.
* In the root shell, source /etc/bashrc and set $HOME and $DISPLAY.  

svn path=/nixos/trunk/; revision=19247
2010-01-05 23:59:29 +00:00
Eelco Dolstra 5cc99487cb * A function to wait until a window exists.
svn path=/nixos/trunk/; revision=19246
2010-01-05 23:38:13 +00:00
Eelco Dolstra ff20b45486 * Don't buffer stderr.
svn path=/nixos/trunk/; revision=19227
2010-01-05 11:43:38 +00:00
Eelco Dolstra 5af12b6afe * Provide a function for taking a screenshot.
svn path=/nixos/trunk/; revision=19225
2010-01-05 11:35:59 +00:00
Eelco Dolstra ff86799d42 * Hm, Perl threads and lexical closures don't interact in the way
you'd expect...

svn path=/nixos/trunk/; revision=19214
2010-01-05 10:35:30 +00:00
Eelco Dolstra 170331be30 * Don't use /hostfs to signal the test driver that a VM is up, but
write some magic string to ttyS0.  This removes the dependency on
  having a CIFS mount.
* Use a thread to process the stdout/stderr of each QEMU instance.
* Add a kernel command line parameter "stage1panic" to tell stage 1 to
  panic if an error occurs.  This is faster than waiting until
  connect() times out.

svn path=/nixos/trunk/; revision=19212
2010-01-04 18:04:57 +00:00
Eelco Dolstra 5730c27aed * For debugging, if $tests is not set, read commands from stdin.
svn path=/nixos/trunk/; revision=19210
2010-01-04 16:30:54 +00:00
Eelco Dolstra 0ecac5a6f9 * Attach stdin to /dev/null, otherwise qemu grabs the terminal
(unpleasant for interactive testing of the test driver).

svn path=/nixos/trunk/; revision=19209
2010-01-04 16:30:26 +00:00