1{ lib, ... }:
2
3{
4 name = "unifi";
5
6 meta.maintainers = with lib.maintainers; [
7 patryk27
8 zhaofengli
9 ];
10
11 node.pkgsReadOnly = false;
12
13 nodes.machine = {
14 nixpkgs.config.allowUnfree = true;
15
16 services.unifi.enable = true;
17 };
18
19 testScript = ''
20 import json
21
22 start_all()
23
24 machine.wait_for_unit("unifi.service")
25 machine.wait_for_open_port(8880)
26
27 status = json.loads(machine.succeed("curl --silent --show-error --fail-with-body http://localhost:8880/status"))
28 assert status["meta"]["rc"] == "ok"
29 '';
30}