1 import ./make-test-python.nix ({ pkgs, ... }:
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ lnl7 mic92 ];
7 nodes.machine = { pkgs, config, ... }: {
8 environment.systemPackages = [ pkgs.vault ];
9 environment.variables.VAULT_ADDR = "http://127.0.0.1:8200";
10 environment.variables.VAULT_TOKEN = "phony-secret";
15 devRootTokenID = config.environment.variables.VAULT_TOKEN;
22 machine.wait_for_unit("multi-user.target")
23 machine.wait_for_unit("vault.service")
24 machine.wait_for_open_port(8200)
25 out = machine.succeed("vault status -format=json")
27 status = json.loads(out)
28 assert status.get("initialized") == True
29 machine.succeed("vault kv put secret/foo bar=baz")
30 out = machine.succeed("vault kv get -format=json secret/foo")
32 status = json.loads(out)
33 assert status.get("data", {}).get("data", {}).get("bar") == "baz"