forked from M-Labs/nix-scripts
windows tests: move to checkPhase
This commit is contained in:
parent
688bc38973
commit
5a2b863eb8
@ -46,8 +46,13 @@ let
|
|||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "windows-test-${name}";
|
name = "windows-test-${name}";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
buildInputs = [ qemu sshpass openssh ];
|
dontBuild = true;
|
||||||
buildPhase = ''
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
'';
|
||||||
|
doCheck = true;
|
||||||
|
checkInputs = [ qemu sshpass openssh ];
|
||||||
|
checkPhase = ''
|
||||||
# +1 day from last modification of the disk image
|
# +1 day from last modification of the disk image
|
||||||
CLOCK=$(date -Is -d @$(expr $(stat -c %Y ${diskImage}) + 86400))
|
CLOCK=$(date -Is -d @$(expr $(stat -c %Y ${diskImage}) + 86400))
|
||||||
${runQemu [
|
${runQemu [
|
||||||
@ -56,23 +61,24 @@ let
|
|||||||
"-drive" "file=${diskImage},index=0,media=disk,cache=unsafe"
|
"-drive" "file=${diskImage},index=0,media=disk,cache=unsafe"
|
||||||
"-rtc" "base=$CLOCK"
|
"-rtc" "base=$CLOCK"
|
||||||
]} &
|
]} &
|
||||||
|
|
||||||
echo "Wait for Windows to boot"
|
echo "Wait for Windows to boot"
|
||||||
sleep 10
|
sleep 10
|
||||||
${ssh "ver"}
|
${ssh "ver"}
|
||||||
for pkg in ${artiqPkg}/noarch/*.tar.bz2 ; do
|
for pkg in ${artiqPkg}/noarch/*.tar.bz2 ; do
|
||||||
${installCondaPkg "$pkg"}
|
${installCondaPkg "$pkg"}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Allow tests to run for 2 minutes
|
# Allow tests to run for 2 minutes
|
||||||
${ssh "shutdown -s -t ${toString testTimeout}"}
|
${ssh "shutdown -s -t ${toString testTimeout}"}
|
||||||
|
|
||||||
${ssh "miniconda\\scripts\\activate && miniconda\\python -m unittest discover -v artiq.test"}
|
${ssh "miniconda\\scripts\\activate && miniconda\\python -m unittest discover -v artiq.test"}
|
||||||
|
|
||||||
# Abort timeouted shutdown
|
# Abort timeouted shutdown
|
||||||
${ssh "shutdown -a"}
|
${ssh "shutdown -a"}
|
||||||
# Power off immediately
|
# Power off immediately
|
||||||
${ssh "shutdown -p -f"}
|
${ssh "shutdown -p -f"}
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
|
||||||
echo Done
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
condaPackageNames =
|
condaPackageNames =
|
||||||
builtins.filter (name: builtins.match "conda-.+" name != null)
|
builtins.filter (name: builtins.match "conda-.+" name != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user