depot/third_party/nixpkgs/nixos/tests/node-red.nix
Default email a3bb8d7922 Project import generated by Copybara.
GitOrigin-RevId: 439b1605227b8adb1357b55ce8529d541abbe9eb
2021-08-06 00:33:18 +03:00

31 lines
773 B
Nix

import ./make-test-python.nix ({ pkgs, ... }: {
name = "nodered";
meta = with pkgs.lib.maintainers; {
maintainers = [ matthewcroughan ];
};
nodes = {
client = { config, pkgs, ... }: {
environment.systemPackages = [ pkgs.curl ];
};
nodered = { config, pkgs, ... }: {
services.node-red = {
enable = true;
openFirewall = true;
};
};
};
testScript = ''
start_all()
nodered.wait_for_unit("node-red.service")
nodered.wait_for_open_port("1880")
client.wait_for_unit("multi-user.target")
with subtest("Check that the Node-RED webserver can be reached."):
assert "<title>Node-RED</title>" in client.succeed(
"curl -sSf http:/nodered:1880/ | grep title"
)
'';
})