nixos/tests/php/fpm: make sure that extensions are actually loaded

The phpinfo output from 127.0.0.1:80 only shows configuration options
and thus leads to false-positives.
This commit is contained in:
Maximilian Bosch 2021-03-04 15:48:30 +01:00
parent 8c26eaa144
commit 70ac808b39
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -3,6 +3,8 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
meta.maintainers = lib.teams.php.members;
machine = { config, lib, pkgs, ... }: {
environment.systemPackages = [ php ];
services.nginx = {
enable = true;
@ -50,5 +52,6 @@ import ../make-test-python.nix ({pkgs, lib, php, ...}: {
# Check so we have database and some other extensions loaded
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]:
assert ext in response, f"Missing {ext} extension"
machine.succeed(f'test -n "$(php -m | grep -i {ext})"')
'';
})