2021-12-19 01:06:50 +00:00
|
|
|
# Test UniFi controller
|
|
|
|
|
|
|
|
{ system ? builtins.currentSystem
|
|
|
|
, config ? { allowUnfree = true; }
|
|
|
|
, pkgs ? import ../.. { inherit system config; }
|
|
|
|
}:
|
|
|
|
|
|
|
|
with import ../lib/testing-python.nix { inherit system pkgs; };
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
makeAppTest = unifi: makeTest {
|
|
|
|
name = "unifi-controller-${unifi.version}";
|
|
|
|
meta = with pkgs.lib.maintainers; {
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = [ patryk27 zhaofengli ];
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nodes.server = {
|
2023-03-04 12:14:45 +00:00
|
|
|
nixpkgs.config = config;
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
services.unifi = {
|
|
|
|
enable = true;
|
|
|
|
unifiPackage = unifi;
|
|
|
|
openFirewall = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
server.wait_for_unit("unifi.service")
|
|
|
|
server.wait_until_succeeds("curl -Lk https://localhost:8443 >&2", timeout=300)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in with pkgs; {
|
2024-04-21 15:54:59 +00:00
|
|
|
unifi8 = makeAppTest unifi8;
|
2021-12-19 01:06:50 +00:00
|
|
|
}
|