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