Commit graph

61 commits

Author SHA1 Message Date
aszlig 8be00dc71d
nixos/test-driver: Make tesseract OCR optional.
By default this is now enabled, and it has to be explicitely enabled
using "enableOCR = true". If it is set to false, any usage of
getScreenText or waitForText will fail with an error suggesting to pass
enableOCR.

This should get rid of the rather large dependency on tesseract which
we don't need for most tests.

Note, that I'm using system("type -P") here to check whether tesseract
is in PATH. I know it's a bashism but we already have other bashisms
within the test scripts and we also run it with bash, so IMHO it's not a
problem here.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-22 07:21:58 +02:00
aszlig 8bd025a75e
nixos/test-driver: Add new waitForText function.
As promised in the previous commit, this can be used similarly to
$machine->waitForWindow, where you supply a regular expression and it's
retrying OCR until the regexp matches.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-21 19:55:21 +02:00
aszlig 235c2228ca
nixos/test-driver: Add new getScreenText function.
Basically, this creates a screenshot and throws tesseract at it to
recognize the characters from the screenshot. In order to produce a
result that is well enough, we're using lanczos scaling and scale the
image up to 400% of its original size.

This provides the base functionality for a new Machine method which will
be called waitForText. I originally had that idea long ago when writing
the VM tests for VirtualBox and Chromium, but thought it would be
disproportionate to the case.

The downside however is that VM tests now depend on tesseract, but given
the average runtime of our tests it really shouldn't have a too big
impact and it's only a runtime dependency after all.

Another issue is that the OCR process takes quite some time to finish,
but IMHO it's better (as in more deterministic) than to rely on sleep().

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-21 19:55:21 +02:00
Eelco Dolstra 13dcb35233 VM tests: Don't produce output on failure
Producing output makes it hard to restart builds that failed for
intermittent reasons (like timeouts). So let's not do that.
2015-04-10 11:18:30 +02:00
Nicolas B. Pierron 6de931a0f8 Merge rename.nix changes. 2015-04-03 23:12:12 +02:00
Bob van der Linden c57a912016 nixos: test: add tests for booting installation iso in various ways 2015-03-24 22:09:07 +01:00
Bob van der Linden 16a936be90 nixos: iso-image: filename escaping in xorriso 2015-03-24 22:01:51 +01:00
Bob van der Linden 8d092270d2 nixos: iso-image: use syslinux bootloader for USB booting support
This changes the bootloader for iso generation from Grub to
syslinux. In addition this adds USB booting support, so that
"dd" can be used to burn the generated ISO to USB thumbdrives
instead of needing applications like UnetBootin.
2015-03-24 22:01:04 +01:00
Nicolas B. Pierron 05e8a48fb4 Document and rename internal option of modules. 2015-03-15 14:45:42 +01:00
Shea Levy f69ce50529 Move most extra args out of eval-config.nix 2015-03-12 23:42:57 +01:00
Shea Levy 0a0a29fd0b Add comments about the module system interface
Ideally the module system could be configured pretty much completely by
the contents of the modules themselves, so add comments about avoiding
complicating it further and possibly removing now-redundant
configurability from the existing interface.
2015-03-12 23:42:57 +01:00
Shea Levy e3eff53037 evalModules: Add internal option for the check argument 2015-03-12 23:42:57 +01:00
Shea Levy e4a06f35b1 nixos: Don't evaluate twice to get the value of config.nixpkgs 2015-03-12 23:42:57 +01:00
Sander van der Burg 8d29cb2b00 In a test VM it's impossible to connect to itself, so fix this 2015-02-19 21:13:49 +00:00
Mathijs Kwik 73f18fd42f nixos: allow adding extra modules through environment
This is useful for adding extra functionality or defaults to _every_
nixos evaluation.

My use case is overriding behaviour for all nixos tests, for example
setting packageOverrides to newer versions and changing some default
dependencies/settings.

By making this accessible through an environment variable, this can now
be fully accomplished externally. No more need to fork
nixos/nixpkgs (which becomes a maintenance burden), just use the channel
instead and plug in via this envvar.
2014-12-16 19:13:15 +01:00
Jaka Hudoklin a782b890d5 nixos/make-system-tarball: extra commands to be executed before archive 2014-12-11 23:17:27 +01:00
Luca Bruno 7885c2ed12 Revert "nixos: iso-image: use syslinux bootloader for USB booting support"
This reverts commit 455db168b3.
2014-11-08 14:33:27 +01:00
Bob van der Linden 455db168b3 nixos: iso-image: use syslinux bootloader for USB booting support
This changes the bootloader for iso generation from Grub to
syslinux. In addition this adds USB booting support, so that
"dd" can be used to burn the generated ISO to USB thumbdrives
instead of needing applications like UnetBootin.
2014-11-02 17:35:16 +01:00
Eelco Dolstra 51c349d0cc test-driver: Use netpbm instead of imagemagick
Imagemagick pulls in 100s of megabytes of dependencies.
2014-09-25 00:07:30 +02:00
Bjørn Forsman 8e8f95beda nixos/test-reports: use local copy of jquery
The current way test reports get jquery,

  src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"

only works when getting reports over http:// or https://, not file://.
Change it so that it works for all protocols by using a local copy of
jquery.

This fixes the issue where locally created and browsed test reports
cannot be navigated properly; clicking the '+' symbol to expand
sub-sections doesn't work.
2014-09-07 15:47:59 +02:00
William A. Kennington III 2de0cf2549 nixos/utils: Don't remove first character if not a / 2014-09-03 18:40:05 -07:00
Michael Raskin d140851472 Merge pull request #3779 from offlinehacker/docker
full nixos inside docker
2014-09-02 01:04:05 +04:00
William A. Kennington III 9a697d775a Revert "Revert "Fix syntax error in nixos/lib/build-vms.nix, introduced by 86c0f8c""
This reverts commit 2f697bf693.
2014-08-31 09:46:26 -07:00
William A. Kennington III 3d037ebb94 Revert "Revert "Merge pull request #3182 from wkennington/master.ipv6""
This reverts commit ea8910652f.
2014-08-31 09:46:16 -07:00
Rob Vermaas ea8910652f Revert "Merge pull request #3182 from wkennington/master.ipv6"
This reverts commit b23fd65854, reversing
changes made to 43654cba2c.
2014-08-31 10:58:54 +02:00
Rob Vermaas 2f697bf693 Revert "Fix syntax error in nixos/lib/build-vms.nix, introduced by 86c0f8c"
This reverts commit 704e91bab0.
2014-08-31 10:58:50 +02:00
Rickard Nilsson 704e91bab0 Fix syntax error in nixos/lib/build-vms.nix, introduced by 86c0f8c 2014-08-30 19:54:37 +02:00
William A. Kennington III 86c0f8c549 Refactor nixos files relying on the old ipAddress / prefixLength / subnetMask attributes 2014-08-30 07:33:38 -07:00
Jaka Hudoklin d77150df30 nixos: make-system-tarball, add option for extra arguments for tar
Sometimes extra arguments when making tarball are required,
for example if making a container owner of files has to be changed
to root.
2014-08-25 03:29:07 +02:00
Peter Simons 2d326e5032 Merge remote-tracking branch 'origin/master' into staging.
Conflicts:
	pkgs/desktops/e18/enlightenment.nix
2014-08-04 16:51:47 +02:00
Eelco Dolstra b599deedb4 makeTest: Pass nodes attribute
This allows doing things like:

  nix-build nixos/tests/misc.nix -A nodes.machine.config.system.build.initialRamdisk
2014-07-30 14:30:25 +02:00
Eelco Dolstra 06fc1ec34d Merge remote-tracking branch 'origin/master' into staging
Conflicts:
	pkgs/servers/serfdom/default.nix
2014-07-01 11:25:41 +02:00
Eelco Dolstra 40f7b0f9df Another attempt to eradicate ensureDir
See c556a6ea46.
2014-06-30 14:56:10 +02:00
Florian Friesdorf 6a3e6164bd support for nixos test names 2014-06-28 16:05:03 +02:00
aszlig 622673495b
nixos/log2html: Remove schema from jQuery URLs.
This allows viewing test logs for example when using a Hydra running
with HTTPS.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-06-27 09:41:11 +02:00
Eelco Dolstra 48601269a9 test-driver: Set context to include machines created by createMachine 2014-05-21 15:55:50 +02:00
Eelco Dolstra 019e9d8a3d Fix simpleTest function 2014-04-24 15:46:10 +02:00
Eelco Dolstra bfda72c2f9 Fix waitForX 2014-04-17 17:07:03 +02:00
Eelco Dolstra f0a9703f77 journalctl no longer parses the flag "-bu" 2014-04-17 10:56:10 +02:00
Eelco Dolstra 150d3b0095 no-x-libs.nix: Disable su xauth forwarding, and X11 dependency in dbus 2014-04-16 16:58:06 +02:00
Eelco Dolstra 36c05d5e5b Simplify running tests even further
Now you can just say:

  $ nix-build '<nixos/tests/login.nix>'

You can still get the driver script for interactive testing:

  $ nix-build '<nixos/tests/login.nix>' -A driver
  $ ./result/bin/nixos-test-driver
2014-04-14 14:23:38 +02:00
Eelco Dolstra abe218950c Make it easier to run the tests
You can now run a test in the nixos/tests directory directly using
nix-build, e.g.

  $ nix-build '<nixos/tests/login.nix>' -A test

This gets rid of having to add the test to nixos/tests/default.nix.
(Of course, you still need to add it to nixos/release.nix if you want
Hydra to run the test.)
2014-04-14 14:02:44 +02:00
Eelco Dolstra e09250d41c Disable allowUnfree by default
Fixes #2134.
2014-04-09 00:09:31 +02:00
Eelco Dolstra eb22e5f026 Remove ignored argument to sync 2014-04-07 13:22:12 +02:00
Eelco Dolstra de57c0eb66 Shut up Perl warning 2014-03-18 14:10:31 +01:00
Eelco Dolstra 01fc3e5153 Revert "test-driver: Set the date to the current time on boot"
This reverts commit 4e6eae45ee. It
breaks running the test driver interactively (in that it causes all
VMs to be started immediately, which is not always what you wnat).
2014-03-18 14:05:51 +01:00
Shea Levy 4e6eae45ee test-driver: Set the date to the current time on boot
Should allow merging #1816
2014-03-17 22:05:19 -04:00
Eelco Dolstra 497997cc38 Move generation of coverage reports from nixos/lib/testing to releaseTools
Also, turn some stdenv adapters into setup hooks.
2014-03-03 13:57:08 +01:00
Eelco Dolstra ad7c518e45 Sync /tmp/xchg to ensure that the coverage data is flushed 2014-03-03 13:57:08 +01:00
Shea Levy 51de280c0a nixos X tests: wait for logind to link a session to the server
There seems to be some race causing failures if an X command gets in before slim starts the session

Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-22 14:23:56 -05:00