45 lines
849 B
Nix
45 lines
849 B
Nix
{
|
|
testers,
|
|
curl,
|
|
lib,
|
|
gnugrep,
|
|
...
|
|
}:
|
|
testers.runNixOSTest {
|
|
name = "static-page";
|
|
|
|
nodes.webserver =
|
|
{ ... }:
|
|
{
|
|
# Service under test
|
|
imports = [ ../../../nixos-modules/static-page ];
|
|
qois.static-page = {
|
|
enable = true;
|
|
pages = lib.mkForce {
|
|
"localhost" = {
|
|
domainAliases = [ "example.com" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
# Test environment
|
|
environment.systemPackages = [
|
|
curl
|
|
gnugrep
|
|
];
|
|
# Disable TLS services
|
|
services.nginx.virtualHosts =
|
|
let
|
|
tlsOff = {
|
|
forceSSL = lib.mkForce false;
|
|
enableACME = lib.mkForce false;
|
|
};
|
|
in
|
|
{
|
|
"localhost" = tlsOff;
|
|
"example.com" = tlsOff;
|
|
};
|
|
};
|
|
|
|
testScript = lib.readFile ./test.py;
|
|
}
|