From 8446f474ec831f76aa073dec18936b899d3a3728 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 18 Feb 2019 23:53:48 +0800 Subject: [PATCH] testing hydra log replacement hack --- extended-tests.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/extended-tests.py b/extended-tests.py index b6e2d9a..2070e66 100644 --- a/extended-tests.py +++ b/extended-tests.py @@ -1,3 +1,14 @@ -import os +import json +import bz2 +import sys -os.system("artiq_flash -t kc705 -V nist_clock") +with open(sys.argv[1], "r") as f: + hydra_json = json.load(f) + +drv = hydra_json["drvPath"] +assert drv.startswith("/nix/store/") +drv = drv[len("/nix/store/"):] +hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:] + +with bz2.BZ2File(hydra_log, "w") as f: + f.write(b"hack successful")