Created
February 25, 2016 16:35
-
-
Save whitequark/eeb0b961aa18da9345a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
reset() { | |
ssh lab.m-labs.hk './miniconda/bin/artiq_flash -m qc1 start'; sleep 1s | |
} | |
ping -w 30 -i 0.5 -c 2 kc705.lab.m-labs.hk | |
timeout 30s artiq_run -vv $1 2>&1 | tee /tmp/artiq_run$$ | |
if grep KERNEL_FINISHED /tmp/artiq_run$$; then | |
exit 0 # no crash | |
elif grep LOAD_FAILED /tmp/artiq_run$$; then | |
exit 0 # uninteresting crash | |
elif grep "LLVM IR parsing error" /tmp/artiq_run$$; then | |
exit 0 # uninteresting crash | |
elif grep 'TimeoutError' /tmp/artiq_run$$; then | |
reset | |
exit 1 # interesting crash | |
else | |
reset | |
exit 0 # uninteresting crash, but might've killed device | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment