2017-11-12 07:05:27 +00:00
|
|
|
|
|
|
|
let testString = "can-use-subgroups"; in
|
|
|
|
|
2018-07-20 21:56:59 +01:00
|
|
|
import ./make-test.nix ({ ...}: {
|
2017-11-12 07:05:27 +00:00
|
|
|
name = "php-httpd-pcre-jit-test";
|
2018-07-20 21:56:59 +01:00
|
|
|
machine = { lib, pkgs, ... }: {
|
2017-11-12 07:05:27 +00:00
|
|
|
time.timeZone = "UTC";
|
|
|
|
services.httpd = {
|
|
|
|
enable = true;
|
|
|
|
adminAddr = "please@dont.contact";
|
|
|
|
extraSubservices = lib.singleton {
|
|
|
|
function = f: {
|
|
|
|
enablePHP = true;
|
|
|
|
phpOptions = "pcre.jit = true";
|
|
|
|
|
|
|
|
extraConfig =
|
|
|
|
let
|
|
|
|
testRoot = pkgs.writeText "index.php"
|
|
|
|
''
|
|
|
|
<?php
|
|
|
|
preg_match('/(${testString})/', '${testString}', $result);
|
|
|
|
var_dump($result);
|
|
|
|
?>
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
|
|
|
Alias / ${testRoot}/
|
|
|
|
|
|
|
|
<Directory ${testRoot}>
|
|
|
|
Require all granted
|
|
|
|
</Directory>
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2018-07-20 21:56:59 +01:00
|
|
|
testScript = { ... }:
|
2017-11-12 07:05:27 +00:00
|
|
|
''
|
|
|
|
$machine->waitForUnit('httpd.service');
|
|
|
|
# Ensure php evaluation by matching on the var_dump syntax
|
|
|
|
$machine->succeed('curl -vvv -s http://127.0.0.1:80/index.php \
|
|
|
|
| grep "string(${toString (builtins.stringLength testString)}) \"${testString}\""');
|
|
|
|
'';
|
|
|
|
})
|