windows: add sshUnquoted to for interpolated parameters

This partially reverts commit 525b91cb21.
pull/30/head
Astro 2019-11-14 00:13:03 +01:00
parent 184de89074
commit 91182a37dd
2 changed files with 11 additions and 12 deletions

View File

@ -33,13 +33,14 @@ let
# Pass empty config file to prevent ssh from failing to create ~/.ssh
sshOpts = "-F /dev/null -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=\$TMP/known_hosts";
ssh = cmd: ''
echo ssh windows '${cmd}'
sshWithQuotes = quotes: cmd: ''
echo ssh windows ${quotes}${cmd}${quotes}
${sshpass}/bin/sshpass -p${sshPassword} -- \
${openssh}/bin/ssh -np 2022 ${sshOpts} \
${sshUser}@localhost \
'${cmd}'
${quotes}${cmd}${quotes}
'';
ssh = sshWithQuotes "'";
scp = src: target: ''
echo "Copy ${src} to ${target}"
${sshpass}/bin/sshpass -p${sshPassword} -- \
@ -49,6 +50,6 @@ let
in
{
inherit qemu-img runQemu ssh scp;
inherit qemu-img runQemu ssh sshWithQuotes scp;
inputs = [ qemu_kvm openssh sshpass ];
}

View File

@ -17,6 +17,7 @@ let
};
# Double-escape because we produce a script from a shell heredoc
ssh = cmd: qemu.ssh (escape cmd);
sshUnquoted = qemu.sshWithQuotes "\"";
scp = qemu.scp;
condaEnv = "artiq-env";
tcpPorts = [ 1380 1381 1382 1383 ];
@ -53,14 +54,11 @@ stdenv.mkDerivation {
echo "Wait for Windows to boot"
sleep 10
${ssh "ver"}
# FIXME: clean up this hack with the for loops
for pkg in ${sipycoPkg}/noarch/sipyco*.tar.bz2 ; do
${scp "\\$pkg" "sipyco.tar.bz2"}
${ssh "anaconda\\scripts\\activate ${condaEnv} && conda install sipyco.tar.bz2"}
done
for pkg in ${artiqPkg}/noarch/artiq*.tar.bz2 ; do
${scp "\\$pkg" "artiq.tar.bz2"}
${ssh "anaconda\\scripts\\activate ${condaEnv} && conda install artiq.tar.bz2"}
i=0
for pkg in ${sipycoPkg}/noarch/sipyco*.tar.bz2 ${artiqPkg}/noarch/artiq*.tar.bz2 ; do
${scp "\\$pkg" "to_install\\$i.tar.bz2"}
${sshUnquoted "anaconda\\scripts\\activate ${condaEnv} && conda install to_install\\$i.tar.bz2"}
((i=i+1))
done
# Schedule a timed shutdown against hanging test runs