Commit Graph

42 Commits

Author SHA1 Message Date
Peter Simons
eb6e1310b8 strip trailing whitespace; no functional change
svn path=/nixos/trunk/; revision=29285
2011-09-14 18:20:50 +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
650d14be8d * Remove most references to the "services" tree.
svn path=/nixos/trunk/; revision=26990
2011-04-27 13:16:33 +00:00
Eelco Dolstra
49213aa80a * Doh! Exceptions outside of subtests were silently ignored.
svn path=/nixos/trunk/; revision=25981
2011-02-15 15:04:17 +00:00
Eelco Dolstra
066f76e65f * Remove "nix-build tests -A foo.vms; ./result/bin/run-vms" as a way
to run the VMs of a test.  Instead, you can do

    $ nix-build tests -A foo.driver
    $ ./result/bin/nixos-run-vms

  This uses the test driver infrastructure, which is necessary in
  order to set up the VDE switches.

svn path=/nixos/trunk/; revision=25586
2011-01-16 14:21:47 +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
2ac09578c0 * runInMachine: properly evaluate the machine configuration.
svn path=/nixos/trunk/; revision=25536
2011-01-13 11:39:03 +00:00
Eelco Dolstra
06a239a699 * runInMachine: use buildVM rather than buildVirtualNetwork since
there is only one machine.
* Add a simple test case for runInMachine.

svn path=/nixos/trunk/; revision=25535
2011-01-13 10:54:07 +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
ef82cd9c48 * Coverage report: propagate the build products of the VM test run.
* Run the Quake 3 with coverage instrumentation.

svn path=/nixos/trunk/; revision=25480
2011-01-09 22:21:22 +00:00
Eelco Dolstra
20b8258e68 * Handle the case where a machine produces no coverage data.
svn path=/nixos/trunk/; revision=25477
2011-01-09 21:37:01 +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
260d9faee7 * Urgh.
svn path=/nixos/trunk/; revision=25471
2011-01-09 18:31:03 +00:00
Eelco Dolstra
a3aa97009c * Doh.
svn path=/nixos/trunk/; revision=25469
2011-01-09 18:16:59 +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
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
Rob Vermaas
c8afc67f6a lib/testing.nix: vm state of nixos machines in network changed location
svn path=/nixos/trunk/; revision=25222
2010-12-21 10:57:19 +00:00
Eelco Dolstra
e90a1cfc59 * A quick hack to enable debugging of VM test scripts: the test script
is now made available in the interactive test driver.  For instance,
  you can do

  $ nix-build tests/ -A quake3.driver
  $ ./result/bin/nixos-test-driver
  > eval $ENV{'testScript'};
  ... see VMs + X11 + Quake get started, bots running around ...
  >

  So after this you can run commands interactively on the VMs in the
  state they were in after the conclusion of the test script.

svn path=/nixos/trunk/; revision=25158
2010-12-16 19:35:43 +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
0bfba4cbf5 * Require KVM.
svn path=/nixos/trunk/; revision=23538
2010-08-29 23:24:54 +00:00
Rob Vermaas
310fffa974 nixos/lib/testing.nix: propogate exit code in runInVM function
svn path=/nixos/trunk/; revision=23102
2010-08-11 07:40:16 +00:00
Rob Vermaas
5dab679f9f lib/testing.nix: remove workaround
svn path=/nixos/trunk/; revision=22719
2010-07-23 13:59:50 +00:00
Rob Vermaas
de8d0c3e14 added some debugging
svn path=/nixos/trunk/; revision=22142
2010-06-04 13:18:19 +00:00
Eelco Dolstra
fa89713c78 * Rename apply' and call'.
svn path=/nixos/trunk/; revision=21944
2010-05-23 12:02:54 +00:00
Eelco Dolstra
dd81311714 * Optionally pass the computed `nodes' to the test script as a
function argument, so that the test script can refer to computed
  values such as the assigned IP addresses of the virtual machines.

svn path=/nixos/trunk/; revision=21939
2010-05-21 14:31:05 +00:00
Rob Vermaas
a4516ec98a workaround for some fs problems experienced by some tests of webdsl/crawljax. also added require argument to runinmachinewithx function
svn path=/nixos/trunk/; revision=21423
2010-04-29 12:45:22 +00:00
Rob Vermaas
e18b352ce0 remove obsolete option from machine spec
svn path=/nixos/trunk/; revision=21151
2010-04-19 07:42:27 +00:00
Rob Vermaas
b75d15a9a8 virtualisation: add option to switch off readonly host fs in vm
svn path=/nixos/trunk/; revision=21126
2010-04-16 15:09:47 +00:00
Rob Vermaas
131b1e57fe nixos: add runinmachinewithx variant
svn path=/nixos/trunk/; revision=20561
2010-03-11 15:09:10 +00:00
Rob Vermaas
95f2e60c5d remove debugging
svn path=/nixos/trunk/; revision=20557
2010-03-11 13:12:17 +00:00
Rob Vermaas
3fae175c10 * nixos/lib/testing.nix: added runinmachine function to build derivation in machine given a nixos configuration
svn path=/nixos/trunk/; revision=20556
2010-03-11 13:11:06 +00:00
Eelco Dolstra
c4ae499f3d svn path=/nixos/trunk/; revision=20545 2010-03-10 22:51:53 +00:00
Eelco Dolstra
358f3cd79c * In tests/default.nix, only import lib/testing.nix.
svn path=/nixos/trunk/; revision=20483
2010-03-09 10:14:45 +00:00
Rob Vermaas
d79d934d85 move functions to lib/testing to allow easier use outside of nixos
svn path=/nixos/trunk/; revision=20072
2010-02-17 09:37:22 +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
4c2fe97acc * Always create hydra-build-products, otherwise the build is made
available as a one-click install which is not useful.

svn path=/nixos/trunk/; revision=19296
2010-01-07 16:50:26 +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
5af12b6afe * Provide a function for taking a screenshot.
svn path=/nixos/trunk/; revision=19225
2010-01-05 11:35:59 +00:00
Eelco Dolstra
51097933ab * Moved test-related stuff from lib/build-vms.nix to lib/testing.nix.
* Factored out some commonality between tests to make them a bit
  simpler to write.  A test is a function { pkgs, ... }: -> { nodes,
  testScript } or { machine, testScript }.  So it's no longer
  necessary to have a "vms" attribute in every test.

svn path=/nixos/trunk/; revision=19220
2010-01-05 11:18:43 +00:00