1import ../make-test-python.nix (
2 { lib, ... }:
3
4 {
5 name = "homer-caddy";
6 meta.maintainers = with lib.maintainers; [ stunkymonkey ];
7
8 nodes.machine =
9 { pkgs, ... }:
10 {
11 services.homer = {
12 enable = true;
13 virtualHost = {
14 caddy.enable = true;
15 domain = "localhost:80";
16 };
17 settings = {
18 title = "testing";
19 };
20 };
21 };
22
23 testScript = ''
24 machine.wait_for_unit("caddy.service")
25 machine.wait_for_open_port(80)
26 machine.succeed("curl --fail --show-error --silent http://localhost:80/ | grep '<title>Homer</title>'")
27 machine.succeed("curl --fail --show-error --silent http://localhost:80/assets/config.yml | grep 'title: testing'")
28 '';
29 }
30)