583470209f
This reverts commit df4d0b03efe967e07b227edc004169701e39fd3e, reversing changes made to b333263534e23f6e5a394193c5cb2c5f793f6525. It didn't even evaluate!
39 lines
1002 B
Nix
39 lines
1002 B
Nix
import ./make-test-python.nix ({ pkgs, ... }:
|
|
{
|
|
name = "uwsgi";
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
maintainers = [ lnl7 ];
|
|
};
|
|
machine = { pkgs, ... }: {
|
|
services.uwsgi.enable = true;
|
|
services.uwsgi.plugins = [ "python3" ];
|
|
services.uwsgi.instance = {
|
|
type = "emperor";
|
|
vassals.hello = {
|
|
type = "normal";
|
|
master = true;
|
|
workers = 2;
|
|
http = ":8000";
|
|
module = "wsgi:application";
|
|
chdir = pkgs.writeTextDir "wsgi.py" ''
|
|
from flask import Flask
|
|
application = Flask(__name__)
|
|
|
|
@application.route("/")
|
|
def hello():
|
|
return "Hello World!"
|
|
'';
|
|
pythonPackages = self: with self; [ flask ];
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript =
|
|
''
|
|
machine.wait_for_unit("multi-user.target")
|
|
machine.wait_for_unit("uwsgi.service")
|
|
machine.wait_for_open_port(8000)
|
|
assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8000")
|
|
'';
|
|
})
|