2020-04-21 11:37:00 +00:00
|
|
|
# Miscellaneous small tests that don't warrant their own VM run.
|
|
|
|
|
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : rec {
|
|
|
|
name = "privacyidea";
|
2021-01-10 19:08:30 +00:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2020-04-21 11:37:00 +00:00
|
|
|
maintainers = [ fpletz ];
|
|
|
|
};
|
|
|
|
|
|
|
|
machine = { ... }: {
|
|
|
|
virtualisation.cores = 2;
|
|
|
|
virtualisation.memorySize = 512;
|
|
|
|
|
|
|
|
services.privacyidea = {
|
|
|
|
enable = true;
|
|
|
|
secretKey = "testing";
|
|
|
|
pepper = "testing";
|
2020-05-08 12:09:10 +00:00
|
|
|
adminPasswordFile = pkgs.writeText "admin-password" "testing";
|
2020-04-21 11:37:00 +00:00
|
|
|
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"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
})
|