diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-08-04 10:54:22 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-08-04 10:54:22 +0000 |
commit | d2e147bedf251976ed99b94b6c905d6761f7a892 (patch) | |
tree | 9e0c62d61698916fd4627ed98d3d880c8fc0ab2e /nixos/tests/node-red.nix | |
parent | 62614cbef7da005c1eda8c9400160f6bcd6546b8 (diff) | |
parent | c464dc811babfe316ed4ab7bbc12351122e69dd7 (diff) | |
download | nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.gz nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.bz2 nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.lz nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.xz nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.tar.zst nixpkgs-d2e147bedf251976ed99b94b6c905d6761f7a892.zip |
Merge remote-tracking branch 'nixpkgs/nixos-unstable' into master
Diffstat (limited to 'nixos/tests/node-red.nix')
-rw-r--r-- | nixos/tests/node-red.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/tests/node-red.nix b/nixos/tests/node-red.nix new file mode 100644 index 00000000000..7660bc32f4c --- /dev/null +++ b/nixos/tests/node-red.nix @@ -0,0 +1,31 @@ +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" + ) + ''; +}) |