nixos/tests/uwsgi: test PHP plugin
This commit is contained in:
parent
22e8804308
commit
c32ef2192f
|
@ -4,12 +4,13 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||||
meta = with pkgs.stdenv.lib.maintainers; {
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
maintainers = [ lnl7 ];
|
maintainers = [ lnl7 ];
|
||||||
};
|
};
|
||||||
|
|
||||||
machine = { pkgs, ... }: {
|
machine = { pkgs, ... }: {
|
||||||
services.uwsgi.enable = true;
|
services.uwsgi.enable = true;
|
||||||
services.uwsgi.plugins = [ "python3" ];
|
services.uwsgi.plugins = [ "python3" "php" ];
|
||||||
services.uwsgi.instance = {
|
services.uwsgi.instance = {
|
||||||
type = "emperor";
|
type = "emperor";
|
||||||
vassals.hello = {
|
vassals.python = {
|
||||||
type = "normal";
|
type = "normal";
|
||||||
master = true;
|
master = true;
|
||||||
workers = 2;
|
workers = 2;
|
||||||
|
@ -25,6 +26,17 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||||
'';
|
'';
|
||||||
pythonPackages = self: with self; [ flask ];
|
pythonPackages = self: with self; [ flask ];
|
||||||
};
|
};
|
||||||
|
vassals.php = {
|
||||||
|
type = "normal";
|
||||||
|
master = true;
|
||||||
|
workers = 2;
|
||||||
|
http-socket = ":8001";
|
||||||
|
http-socket-modifier1 = 14;
|
||||||
|
php-index = "index.php";
|
||||||
|
php-docroot = pkgs.writeTextDir "index.php" ''
|
||||||
|
<?php echo "Hello World\n"; ?>
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,6 +45,8 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||||
machine.wait_for_unit("multi-user.target")
|
machine.wait_for_unit("multi-user.target")
|
||||||
machine.wait_for_unit("uwsgi.service")
|
machine.wait_for_unit("uwsgi.service")
|
||||||
machine.wait_for_open_port(8000)
|
machine.wait_for_open_port(8000)
|
||||||
|
machine.wait_for_open_port(8001)
|
||||||
assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8000")
|
assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8000")
|
||||||
|
assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8001")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue