1
0
Fork 0

extended-tests: trap EXIT for ending flock

This commit is contained in:
Astro 2019-05-30 00:49:00 +02:00
parent 70834ad056
commit a42eec91bd
1 changed files with 7 additions and 4 deletions

View File

@ -95,7 +95,13 @@ in
chmod 600 $HOME/.ssh/id_rsa chmod 600 $HOME/.ssh/id_rsa
mkfifo /tmp/lockctl mkfifo /tmp/lockctl
( cat /tmp/lockctl ) | ssh rpi-1 'flock /tmp/board_lock-kc705-1 -c "echo Ok; cat"' | ( cat /tmp/lockctl | ssh rpi-1 'flock /tmp/board_lock-kc705-1 -c "echo Ok; cat"' | (
# End remote flock via FIFO
atexit_unlock() {
echo > /tmp/lockctl
}
trap atexit_unlock EXIT
# Read "Ok" line when remote successfully locked # Read "Ok" line when remote successfully locked
read LOCK_OK read LOCK_OK
@ -109,9 +115,6 @@ in
python -m unittest discover -v artiq.test.coredevice python -m unittest discover -v artiq.test.coredevice
${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\anaconda\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&&python -m unittest discover -v artiq.test.coredevice"; }}/bin/run.sh ${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\anaconda\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&&python -m unittest discover -v artiq.test.coredevice"; }}/bin/run.sh
# End remote flock via FIFO
echo > /tmp/lockctl
) )
mkdir $out mkdir $out