Merge pull request #32304 from LnL7/vault-test

vault: add nixos test
This commit is contained in:
Daiderd Jordan 2017-12-04 13:04:13 +01:00 committed by GitHub
commit 852fe55822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -336,6 +336,7 @@ in rec {
tests.taskserver = callTest tests/taskserver.nix {};
tests.tomcat = callTest tests/tomcat.nix {};
tests.udisks2 = callTest tests/udisks2.nix {};
tests.vault = callTest tests/vault.nix {};
tests.virtualbox = callSubTests tests/virtualbox.nix { system = "x86_64-linux"; };
tests.wordpress = callTest tests/wordpress.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"');
'';
})