run HITL tests on KC705

This commit is contained in:
Sebastien Bourdeauducq 2019-02-19 00:50:05 +08:00
parent b4e7b53957
commit 22e5e9fbde
1 changed files with 19 additions and 2 deletions

View File

@ -1,6 +1,11 @@
import json
import sys
import time
import subprocess
import os
import artiq
with open(sys.argv[1], "r") as hydra_json_file:
hydra_json = json.load(hydra_json_file)
@ -11,6 +16,18 @@ drv = drv[len("/nix/store/"):]
hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:]
with open(hydra_log, "w") as log:
def run(*args):
subprocess.run(args, stdout=log, stderr=log).check_returncode()
def run(*args, **kwargs):
subprocess.run(args, stdout=log, stderr=log, **kwargs).check_returncode()
run("artiq_flash", "-t", "kc705", "-V", "nist_clock")
time.sleep(10)
run("ping", "kc705-1", "-c10", "-w30")
env = {
"ARTIQ_ROOT": artiq.__path__ + "/examples/kc705_nist_clock",
"ARTIQ_LOW_LATENCY": "1"
}
env.update(os.environ)
run("python", "-m", "unittest", "-v", "artiq.test.coredevice", env=env)