at 23.05-pre 841 B view raw
1import ./make-test-python.nix ({ pkgs, ... }: { 2 name = "merecat"; 3 meta = with pkgs.lib.maintainers; { 4 maintainers = [ fgaz ]; 5 }; 6 7 nodes.machine = { config, pkgs, ... }: { 8 services.merecat = { 9 enable = true; 10 settings = { 11 hostname = "localhost"; 12 virtual-host = true; 13 directory = toString (pkgs.runCommand "merecat-webdir" {} '' 14 mkdir -p $out/foo.localhost $out/bar.localhost 15 echo '<h1>Hello foo</h1>' > $out/foo.localhost/index.html 16 echo '<h1>Hello bar</h1>' > $out/bar.localhost/index.html 17 ''); 18 }; 19 }; 20 }; 21 22 testScript = '' 23 machine.wait_for_unit("merecat") 24 machine.wait_for_open_port(80) 25 machine.succeed("curl --fail foo.localhost | grep 'Hello foo'") 26 machine.succeed("curl --fail bar.localhost | grep 'Hello bar'") 27 ''; 28})