2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
testString = "can-use-subgroups";
|
2021-06-28 23:13:55 +00:00
|
|
|
in
|
|
|
|
import ../make-test-python.nix ({ lib, php, ... }: {
|
2021-03-09 03:18:52 +00:00
|
|
|
name = "php-${php.version}-httpd-pcre-jit-test";
|
2020-05-03 17:38:23 +00:00
|
|
|
meta.maintainers = lib.teams.php.members;
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
nodes.machine = { lib, pkgs, ... }: {
|
2020-04-24 23:36:52 +00:00
|
|
|
time.timeZone = "UTC";
|
|
|
|
services.httpd = {
|
|
|
|
enable = true;
|
|
|
|
adminAddr = "please@dont.contact";
|
2021-03-09 03:18:52 +00:00
|
|
|
phpPackage = php;
|
2020-04-24 23:36:52 +00:00
|
|
|
enablePHP = true;
|
|
|
|
phpOptions = "pcre.jit = true";
|
2021-06-28 23:13:55 +00:00
|
|
|
extraConfig =
|
|
|
|
let
|
|
|
|
testRoot = pkgs.writeText "index.php"
|
|
|
|
''
|
|
|
|
<?php
|
|
|
|
preg_match('/(${testString})/', '${testString}', $result);
|
|
|
|
var_dump($result);
|
|
|
|
'';
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
''
|
|
|
|
Alias / ${testRoot}/
|
|
|
|
|
|
|
|
<Directory ${testRoot}>
|
|
|
|
Require all granted
|
|
|
|
</Directory>
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
testScript = { ... }:
|
|
|
|
''
|
|
|
|
machine.wait_for_unit("httpd.service")
|
|
|
|
# Ensure php evaluation by matching on the var_dump syntax
|
2020-10-27 00:29:36 +00:00
|
|
|
response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/index.php")
|
2020-04-24 23:36:52 +00:00
|
|
|
expected = 'string(${toString (builtins.stringLength testString)}) "${testString}"'
|
|
|
|
assert expected in response, "Does not appear to be able to use subgroups."
|
|
|
|
'';
|
|
|
|
})
|