1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-11 15:15:36 +00:00
nixpkgs/nixos/tests/vault.nix

27 lines
732 B
Nix
Raw Normal View History

2019-11-05 15:57:08 +00:00
import ./make-test-python.nix ({ pkgs, ... }:
2017-12-04 11:42:30 +00:00
{
name = "vault";
meta = with pkgs.lib.maintainers; {
2017-12-04 11:42:30 +00:00
maintainers = [ lnl7 ];
};
machine = { pkgs, ... }: {
2017-12-04 11:42:30 +00:00
environment.systemPackages = [ pkgs.vault ];
environment.variables.VAULT_ADDR = "http://127.0.0.1:8200";
services.vault.enable = true;
virtualisation.memorySize = 512;
2017-12-04 11:42:30 +00:00
};
testScript =
''
2019-11-05 15:57:08 +00:00
start_all()
2017-12-04 11:42:30 +00:00
2019-11-05 15:57:08 +00:00
machine.wait_for_unit("multi-user.target")
machine.wait_for_unit("vault.service")
machine.wait_for_open_port(8200)
machine.succeed("vault operator init")
# vault now returns exit code 2 for sealed vaults
machine.fail("vault status")
machine.succeed("vault status || test $? -eq 2")
2017-12-04 11:42:30 +00:00
'';
})