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
This commit is contained in:
Rob Vermaas 2010-04-29 12:45:22 +00:00
parent 310eefffe7
commit a4516ec98a
1 changed files with 16 additions and 1 deletions

View File

@ -104,15 +104,29 @@ rec {
, machine , machine
, preBuild ? "" , preBuild ? ""
, postBuild ? "" , postBuild ? ""
, ...
}: }:
let let
vms = vms =
buildVirtualNetwork { nodes = { client = machine; } ; }; buildVirtualNetwork { nodes = { client = machine; } ; };
# ugly workaround, until we figure out why some fs actions work properly inside
# the vm. (e.g. unlink gives access denied over smb in qemu). note that the function
# now only works for derivations that lead to a directory in the store, not a file.
buildrunner = writeText "vm-build" '' buildrunner = writeText "vm-build" ''
source $1 source $1
oldout=$out
out=$TMPDIR$out
${coreutils}/bin/mkdir -p $out
${coreutils}/bin/mkdir -p $oldout
${coreutils}/bin/ln -s $out $oldout
${coreutils}/bin/mkdir -p $TMPDIR ${coreutils}/bin/mkdir -p $TMPDIR
exec $origBuilder $origArgs exec $origBuilder $origArgs
${coreutils}/bin/rm -v $oldout
${coreutils}/bin/cp -Rv $out/* $oldout/
out=$oldout
''; '';
testscript = '' testscript = ''
@ -139,11 +153,12 @@ rec {
origBuilder = attrs.builder; origBuilder = attrs.builder;
}); });
runInMachineWithX = args : runInMachineWithX = { require ? [], ...}@args :
let let
client = client =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
inherit require;
virtualisation.memorySize = 1024; virtualisation.memorySize = 1024;
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.slim.enable = false; services.xserver.displayManager.slim.enable = false;