From: Scott Worley Date: Mon, 19 Jul 2021 21:29:43 +0000 (-0700) Subject: Fail if the build happens locally X-Git-Url: http://git.scottworley.com/trustix-integration-tests/commitdiff_plain/c5557e80db6b143ff7f6bff308398ff526b2a908 Fail if the build happens locally This test is supposed to exercise fetching from a remote trusted cache, so a local build means that this didn't happen. --- diff --git a/checks/one-publisher.nix b/checks/one-publisher.nix index 7ecec8f..b661624 100644 --- a/checks/one-publisher.nix +++ b/checks/one-publisher.nix @@ -51,6 +51,10 @@ let } ''; + log-local-builds = writeShellScript "log-local-builds" '' + echo "$OUT_PATHS" >> /var/log/local-builds + ''; + clientConfig = writeText "clientConfig" '' { lib, ... }: { services.trustix-nix-cache = { @@ -76,7 +80,9 @@ let percentage.minimum = 66; }; }; - + nix.extraOptions = ''' + post-build-hook = ${log-local-builds} + '''; } ''; @@ -176,5 +182,6 @@ in nixosTest { "nixos-rebuild switch --show-trace", ) clint.succeed("nix-build '' -A hello") + clint.fail("grep hello /var/log/local-builds") ''; }