keep the cache's key and pull token for hive-priv in a root-only directory
This commit is contained in:
parent
d241e64ab1
commit
b845630023
1 changed files with 519 additions and 22 deletions
32
nix/script-tests/attic-root-facts.nix
Normal file
32
nix/script-tests/attic-root-facts.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# `checks.script-test-attic-root-facts` — runs
|
||||
# ../host-modules/lib/attic-root-facts.nix's script, as `hive-priv-cache-facts`
|
||||
# runs it, against a stub `bao` that keeps its leaves in files. The cases are in
|
||||
# ./attic-root-facts.sh.
|
||||
#
|
||||
# What runs is the rendered script, with the directory it writes moved into the
|
||||
# test's scratch space.
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
script = pkgs.writeText "attic-root-facts.sh" (
|
||||
import ../host-modules/lib/attic-root-facts.nix { inherit (pkgs) lib; } {
|
||||
hive = "alpha";
|
||||
host = "cache.example";
|
||||
dir = "@DIR@/attic";
|
||||
}
|
||||
);
|
||||
in
|
||||
pkgs.runCommand "hyperhive-script-test-attic-root-facts"
|
||||
{
|
||||
SCRIPT = script;
|
||||
nativeBuildInputs = [
|
||||
pkgs.coreutils
|
||||
pkgs.gnugrep
|
||||
];
|
||||
}
|
||||
''
|
||||
${pkgs.bash}/bin/bash ${./attic-root-facts.sh}
|
||||
touch "$out"
|
||||
''
|
||||
Loading…
Reference in a new issue