diff options
author | Sumner Evans <me@sumnerevans.com> | 2021-05-03 09:38:02 -0600 |
---|---|---|
committer | Sumner Evans <me@sumnerevans.com> | 2021-05-03 13:27:23 -0600 |
commit | 1ce3067c425d7a105ea0bc133de255c9815e495f (patch) | |
tree | 4a5eb65011e0f331af3dcfc6c6bc0d5f77e942ce /nixos | |
parent | 6dde6bf3bf129ca6c84a9472c7c210fd86fd7465 (diff) | |
download | nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.tar nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.tar.gz nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.tar.bz2 nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.tar.lz nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.tar.xz nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.tar.zst nixpkgs-1ce3067c425d7a105ea0bc133de255c9815e495f.zip |
airsonic: add test for module
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/airsonic.nix | 32 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/nixos/tests/airsonic.nix b/nixos/tests/airsonic.nix new file mode 100644 index 00000000000..59bd84877c6 --- /dev/null +++ b/nixos/tests/airsonic.nix @@ -0,0 +1,32 @@ +import ./make-test-python.nix ({ pkgs, ... }: { + name = "airsonic"; + meta = with pkgs.lib.maintainers; { + maintainers = [ sumnerevans ]; + }; + + machine = + { pkgs, ... }: + { + services.airsonic = { + enable = true; + maxMemory = 800; + }; + + # Airsonic is a Java application, and unfortunately requires a significant + # amount of memory. + virtualisation.memorySize = 1024; + }; + + testScript = '' + def airsonic_is_up(_) -> bool: + return machine.succeed("curl --fail http://localhost:4040/login") + + + machine.start() + machine.wait_for_unit("airsonic.service") + machine.wait_for_open_port(4040) + + with machine.nested("Waiting for UI to work"): + retry(airsonic_is_up) + ''; +}) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9043ab144ab..e39c525a604 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -24,6 +24,7 @@ in _3proxy = handleTest ./3proxy.nix {}; acme = handleTest ./acme.nix {}; agda = handleTest ./agda.nix {}; + airsonic = handleTest ./airsonic.nix {}; amazon-init-shell = handleTest ./amazon-init-shell.nix {}; ammonite = handleTest ./ammonite.nix {}; atd = handleTest ./atd.nix {}; |