depot/third_party/nixpkgs/nixos/tests/privacyidea.nix
Default email 66604c92c1 Project import generated by Copybara.
GitOrigin-RevId: 32b8ed738096bafb4cdb7f70347a0f63f9f40151
2020-05-15 23:57:56 +02:00

36 lines
989 B
Nix

# Miscellaneous small tests that don't warrant their own VM run.
import ./make-test-python.nix ({ pkgs, ...} : rec {
name = "privacyidea";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ fpletz ];
};
machine = { ... }: {
virtualisation.cores = 2;
virtualisation.memorySize = 512;
services.privacyidea = {
enable = true;
secretKey = "testing";
pepper = "testing";
adminPasswordFile = pkgs.writeText "admin-password" "testing";
adminEmail = "root@localhost";
};
services.nginx = {
enable = true;
virtualHosts."_".locations."/".extraConfig = ''
uwsgi_pass unix:/run/privacyidea/socket;
'';
};
};
testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.succeed("curl --fail http://localhost | grep privacyIDEA")
machine.succeed(
"curl --fail http://localhost/auth -F username=admin -F password=testing | grep token"
)
'';
})