vault: add nixos test

This commit is contained in:
Daiderd Jordan 2017-12-04 12:42:30 +01:00
parent 8c3b96e58c
commit 6a20b88cec
No known key found for this signature in database
GPG Key ID: D02435D05B810C96
2 changed files with 24 additions and 0 deletions

View File

@ -336,6 +336,7 @@ in rec {
tests.taskserver = callTest tests/taskserver.nix {}; tests.taskserver = callTest tests/taskserver.nix {};
tests.tomcat = callTest tests/tomcat.nix {}; tests.tomcat = callTest tests/tomcat.nix {};
tests.udisks2 = callTest tests/udisks2.nix {}; tests.udisks2 = callTest tests/udisks2.nix {};
tests.vault = callTest tests/vault.nix {};
tests.virtualbox = callSubTests tests/virtualbox.nix { system = "x86_64-linux"; }; tests.virtualbox = callSubTests tests/virtualbox.nix { system = "x86_64-linux"; };
tests.wordpress = callTest tests/wordpress.nix {}; tests.wordpress = callTest tests/wordpress.nix {};
tests.xfce = callTest tests/xfce.nix {}; tests.xfce = callTest tests/xfce.nix {};

23
nixos/tests/vault.nix Normal file
View File

@ -0,0 +1,23 @@
import ./make-test.nix ({ pkgs, ... }:
{
name = "vault";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lnl7 ];
};
machine = { config, pkgs, ... }: {
environment.systemPackages = [ pkgs.vault ];
environment.variables.VAULT_ADDR = "http://127.0.0.1:8200";
services.vault.enable = true;
};
testScript =
''
startAll;
$machine->waitForUnit('multi-user.target');
$machine->waitForUnit('vault.service');
$machine->waitForOpenPort(8200);
$machine->succeed('vault init');
$machine->succeed('vault status | grep "Sealed: true"');
'';
})