anchor.diff:          gid="$(id -g)"
   
           # Setup directories and libvirt XML files
  -        mkdir -p $build/libvirt $build/hosts/{${instList}}
  -        touch $build/hosts/{${instList}}/{console,journal}.log
  -        touch $build/script.std{out,err}
  -        cp -t $build/libvirt "$src"/*
  -        for f in $build/libvirt/{dom,net}-*.xml; do substituteAllInPlace "$f"; done
  +        mkdir -p build/libvirt build/hosts/{${instList}}
  +        touch build/std{out,err} build/hosts/{${instList}}/{console,journal}.log
  +        cp -t build/libvirt "$src"/*
  +        for f in build/libvirt/{dom,net}-*.xml; do substituteAllInPlace "$f"; done
           ${optionalString (cfg.backend == "lxc") "mkdir root-{${instList}}"}
   
           # Let libvirt access paths inside the build directory and write to out dirs
           chmod a+x .
  -        chmod a+w $build $build/script.std{out,err} $build/hosts/*
  -
  +        chmod a+w build build/std{out,err} build/hosts/*
  +
  +        # Start the libvirt machines
           ${pkgs.libvirt}/bin/virsh -c "${cfg.connectionURI}" \
             "${virshCmds}" >/dev/null &
           virshpid=$!
  
positive.code:       }];
      };
  
      libvirt.test.out.result = pkgs.stdenv.mkDerivation {
        name = "test-result";
  
        phases = [ "buildPhase" ];
  
        buildPhase = ''
          export output="${cfg.out.output}"
          echo "Verifying test output $output"
          ${cfg.verification-script}
          test -a "$out" || mkdir "$out"
        '';
      };
  
      libvirt.test.out.output = pkgs.stdenv.mkDerivation {
        name = "test-output";
  
        src = runCommand "test-src" {} ''
          mkdir $out
  
negative.code:       tailFiles = mkOption {
          type = with types; attrsOf str;
          default = {
            OUT = "stdout";
            ERR = "stderr";
          } // genAttrs instNames (n: "hosts/${n}/console.log")
            // genAttrs instNames (n: "hosts/${n}/journal.log");
        };
  