1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
4 meta = with pkgs.lib.maintainers; {
8 nodes.machine = { config, lib, pkgs, ... }: {
11 adminAddr = "admin@localhost";
12 virtualHosts."modperl" =
14 inc = pkgs.writeTextDir "ModPerlTest.pm" ''
17 use Apache2::RequestRec ();
18 use Apache2::RequestIO ();
19 use Apache2::Const -compile => qw(OK);
22 $r->content_type('text/plain');
23 print "Hello mod_perl!\n";
24 return Apache2::Const::OK;
28 startup = pkgs.writeScript "startup.pl" ''
30 split ":","${with pkgs.perl.pkgs; makeFullPerlPath ([ mod_perl2 ])}";
36 PerlRequire ${startup}
38 locations."/modperl" = {
40 SetHandler perl-script
41 PerlResponseHandler ModPerlTest
48 testScript = { ... }: ''
49 machine.wait_for_unit("httpd.service")
50 response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/modperl")
51 assert "Hello mod_perl!" in response, "/modperl handler did not respond"