diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2009-08-31 13:40:57 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2009-08-31 13:40:57 +0000 |
commit | 921b838149492fe1ec55384715f5f94ad454fa3b (patch) | |
tree | f8005bd62290515e875ebb6e72f184bfe8d78ce2 /modules/testing/test-instrumentation.nix | |
parent | 4a0be54df099e43fa2fa154ce4de6e588d2af5c3 (diff) | |
download | nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.tar nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.tar.gz nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.tar.bz2 nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.tar.lz nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.tar.xz nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.tar.zst nixpkgs-921b838149492fe1ec55384715f5f94ad454fa3b.zip |
* test -> tests.
svn path=/nixos/trunk/; revision=16897
Diffstat (limited to 'modules/testing/test-instrumentation.nix')
-rw-r--r-- | modules/testing/test-instrumentation.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix new file mode 100644 index 00000000000..b64dc70ab30 --- /dev/null +++ b/modules/testing/test-instrumentation.nix @@ -0,0 +1,36 @@ +# This module allows the test driver to connect to the virtual machine +# via a root shell attached to port 514. + +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + config = { + + jobs = singleton + { name = "backdoor"; + + startOn = "network-interfaces"; + + preStart = + '' + eval $(cat /proc/cmdline) + echo "guest running, will write in $hostTmpDir on host" > /dev/ttyS0 + touch /hostfs/$hostTmpDir/running + ''; + + exec = "${pkgs.socat}/bin/socat tcp-listen:514,fork exec:/bin/sh,stderr"; + }; + + boot.postBootCommands = + '' + ( eval $(cat /proc/cmdline) + mkdir /hostfs/$hostTmpDir/coverage-data + ln -s /hostfs/$hostTmpDir/coverage-data /tmp/coverage-data + ) + ''; + }; + +} |