From cd687af9f4825f82cb7c77456d6ffdf826a44d31 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 29 Jun 2021 10:10:12 -0700 Subject: [PATCH] nixos/test/vault: fix assertion logic "vault status" now returns exit code 2 when the vault is still unsealed. --- nixos/tests/vault.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/tests/vault.nix b/nixos/tests/vault.nix index 59bccbe25959..c3b28b62695a 100644 --- a/nixos/tests/vault.nix +++ b/nixos/tests/vault.nix @@ -19,6 +19,8 @@ import ./make-test-python.nix ({ pkgs, ... }: machine.wait_for_unit("vault.service") machine.wait_for_open_port(8200) machine.succeed("vault operator init") - machine.succeed("vault status | grep Sealed | grep true") + # vault now returns exit code 2 for sealed vaults + machine.fail("vault status") + machine.succeed("vault status || test $? -eq 2") ''; })