forked from M-Labs/nix-scripts
windows tests: run tests for standalone and kc705_nist_clock
This commit is contained in:
parent
f3fca76dd6
commit
858b3de2e4
@ -34,9 +34,10 @@ let
|
|||||||
ssh = qemu.ssh;
|
ssh = qemu.ssh;
|
||||||
scp = qemu.scp;
|
scp = qemu.scp;
|
||||||
condaEnv = "artiq-env";
|
condaEnv = "artiq-env";
|
||||||
in
|
|
||||||
|
makeTest = name: testCommand:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "windows-test-conda-artiq";
|
name = "windows-test-conda-artiq-${name}";
|
||||||
|
|
||||||
outputHashAlgo = "sha256";
|
outputHashAlgo = "sha256";
|
||||||
outputHashMode = "recursive";
|
outputHashMode = "recursive";
|
||||||
@ -53,6 +54,7 @@ in
|
|||||||
"-snapshot"
|
"-snapshot"
|
||||||
"-drive" "file=${diskImage},index=0,media=disk,cache=unsafe"
|
"-drive" "file=${diskImage},index=0,media=disk,cache=unsafe"
|
||||||
"-rtc" "base=$CLOCK"
|
"-rtc" "base=$CLOCK"
|
||||||
|
"-display" "none"
|
||||||
]} &
|
]} &
|
||||||
|
|
||||||
echo "Wait for Windows to boot"
|
echo "Wait for Windows to boot"
|
||||||
@ -66,7 +68,7 @@ in
|
|||||||
# 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 "anaconda\\scripts\\activate ${condaEnv} && python -m unittest discover -v artiq.test"}
|
${testCommand}
|
||||||
|
|
||||||
# Abort timeouted shutdown
|
# Abort timeouted shutdown
|
||||||
${ssh "shutdown -a"}
|
${ssh "shutdown -a"}
|
||||||
@ -76,4 +78,18 @@ in
|
|||||||
mkdir $out
|
mkdir $out
|
||||||
cp ${artiqVersion} $out/passed
|
cp ${artiqVersion} $out/passed
|
||||||
'';
|
'';
|
||||||
}
|
};
|
||||||
|
in {
|
||||||
|
standalone =
|
||||||
|
makeTest "standalone"
|
||||||
|
(ssh "anaconda\\scripts\\activate ${condaEnv} && python -m unittest discover -v artiq.test");
|
||||||
|
kc705 =
|
||||||
|
makeTest "kc705"
|
||||||
|
# This weirdly mangled syntax is legit for Windows
|
||||||
|
(ssh (builtins.replaceStrings [ "\n" ] [ "" ] ''
|
||||||
|
anaconda\scripts\activate ${condaEnv}
|
||||||
|
&& set ARTIQ_ROOT=%cd%\anaconda\envs\artiq-env\Lib\site-packages\artiq\examples\kc705_nist_clock
|
||||||
|
&& set ARTIQ_LOW_LATENCY=1
|
||||||
|
&& python -m unittest discover -v artiq.test.coredevice
|
||||||
|
''));
|
||||||
|
}
|
||||||
|
@ -15,7 +15,6 @@ let
|
|||||||
args = [
|
args = [
|
||||||
"-enable-kvm"
|
"-enable-kvm"
|
||||||
"-m" qemuMem
|
"-m" qemuMem
|
||||||
"-display" "none"
|
|
||||||
"-bios" "${OVMF.fd}/FV/OVMF.fd"
|
"-bios" "${OVMF.fd}/FV/OVMF.fd"
|
||||||
"-netdev" "user,id=n1,restrict=on,hostfwd=tcp::2022-:22" "-device" "e1000,netdev=n1"
|
"-netdev" "user,id=n1,restrict=on,hostfwd=tcp::2022-:22" "-device" "e1000,netdev=n1"
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user