Watch
0
0
Fork
You've already forked hyperhive
0

report the real error when the granter role's bootstrap step fails, and retry on a standby store

This commit is contained in:
atlas 2026-11-05 08:57:10 +01:00
commit cb5a9b2bd7

View file

@ -3,7 +3,9 @@
# cases are in ./granter-login.sh and the stub is ./granter-login-fake-bao.sh.
#
# What runs is the rendered login, with the same `baoStoreUp` text the unit
# passes, rendered once with the bootstrap-token hint and once without.
# passes, rendered once with the bootstrap-token hint and once without. The
# bootstrap token's `auth list` step (../host-modules/lib/bootstrap-auth-list.nix)
# is rendered the same way and run against the same stub.
{
pkgs,
...
@ -31,6 +33,16 @@ pkgs.runCommand "hyperhive-script-test-granter-login"
{
LOGIN = render false;
LOGIN_WITH_TOKEN = render true;
BOOTSTRAP_LIST = pkgs.writeText "bootstrap-auth-list.sh" (
import ../host-modules/lib/bootstrap-auth-list.nix {
inherit (pkgs) lib;
bootstrapTokenFile = "/tmp/granter-bootstrap-test.token";
granterClientCertFile = "/nonexistent/granter.crt";
granterClientKeyFile = "/nonexistent/granter.key";
baoStoreUp = ''HOME=/var/empty bao status >/dev/null 2>>"$err"'';
setupSteps = [ "bao policy write bao-bootstrap /etc/bootstrap.hcl" ];
}
);
FAKE_BAO_BIN = "${fakeBao}/bin";
nativeBuildInputs = [
pkgs.coreutils