diff --git a/artiq-fast/windows/manual-test-run.nix b/artiq-fast/windows/manual-test-run.nix index fc90cc6..a969d8a 100644 --- a/artiq-fast/windows/manual-test-run.nix +++ b/artiq-fast/windows/manual-test-run.nix @@ -2,10 +2,9 @@ { pkgs ? import {} , artiqpkgs ? import ../. { inherit pkgs; } -, diskImage ? "/opt/windows/c.img" +, diskImage ? (import ./build.nix { inherit pkgs; }) , qemuMem ? "2G" , testTimeout ? 180 -, }: with pkgs; diff --git a/artiq-fast/windows/qemu.nix b/artiq-fast/windows/qemu.nix index fc26017..26191f0 100644 --- a/artiq-fast/windows/qemu.nix +++ b/artiq-fast/windows/qemu.nix @@ -1,5 +1,4 @@ { pkgs -, diskImage , qemuMem , sshUser ? "user" , sshPassword ? "user" diff --git a/artiq-fast/windows/run-test.nix b/artiq-fast/windows/run-test.nix index 46932e1..a501b5a 100644 --- a/artiq-fast/windows/run-test.nix +++ b/artiq-fast/windows/run-test.nix @@ -1,7 +1,7 @@ { pkgs , sipycoPkg , artiqPkg -, diskImage ? "/opt/windows/c.img" +, diskImage ? (import ./build.nix { inherit pkgs; }) , qemuMem ? "2G" , testTimeout ? 600 , testCommand ? "python -m unittest discover -v sipyco.test && python -m unittest discover -v artiq.test" @@ -14,7 +14,6 @@ let escape = builtins.replaceStrings [ "\\" ] [ "\\\\" ]; qemu = import ./qemu.nix { inherit pkgs qemuMem; - diskImage = "c.img"; }; # Double-escape because we produce a script from a shell heredoc ssh = cmd: qemu.ssh (escape cmd); @@ -34,7 +33,9 @@ in stdenv.mkDerivation { name = "windows-test-runner"; - src = ./.; + + # Dummy sources + src = pkgs.runCommandNoCC "" {} "touch $out"; propagatedBuildInputs = qemu.inputs; dontBuild = true; @@ -44,16 +45,14 @@ stdenv.mkDerivation { #!/usr/bin/env bash set -e -m - # +1 day from last modification of the disk image - CLOCK=$(date -Is -d @$(expr $(stat -c %Y ${diskImage}) + 86400)) + cp ${diskImage} c.img + ${qemu.runQemu true forwardedPorts [ "-boot" "order=c" "-snapshot" "-drive" - "file=${diskImage},index=0,media=disk,cache=unsafe" - "-rtc" - "base=\\$CLOCK" + "file=c.img,index=0,media=disk,cache=unsafe" "-display" "none" ]} &