mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 06:14:26 +03:00
airsonic: add test for module
This commit is contained in:
parent
6dde6bf3bf
commit
1ce3067c42
32
nixos/tests/airsonic.nix
Normal file
32
nixos/tests/airsonic.nix
Normal file
@ -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)
|
||||||
|
'';
|
||||||
|
})
|
@ -24,6 +24,7 @@ in
|
|||||||
_3proxy = handleTest ./3proxy.nix {};
|
_3proxy = handleTest ./3proxy.nix {};
|
||||||
acme = handleTest ./acme.nix {};
|
acme = handleTest ./acme.nix {};
|
||||||
agda = handleTest ./agda.nix {};
|
agda = handleTest ./agda.nix {};
|
||||||
|
airsonic = handleTest ./airsonic.nix {};
|
||||||
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
|
amazon-init-shell = handleTest ./amazon-init-shell.nix {};
|
||||||
ammonite = handleTest ./ammonite.nix {};
|
ammonite = handleTest ./ammonite.nix {};
|
||||||
atd = handleTest ./atd.nix {};
|
atd = handleTest ./atd.nix {};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchurl }:
|
{ lib, stdenv, fetchurl, nixosTests }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "airsonic";
|
pname = "airsonic";
|
||||||
@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
|
|||||||
cp "$src" "$out/webapps/airsonic.war"
|
cp "$src" "$out/webapps/airsonic.war"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
airsonic-starts = nixosTests.airsonic;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Personal media streamer";
|
description = "Personal media streamer";
|
||||||
homepage = "https://airsonic.github.io";
|
homepage = "https://airsonic.github.io";
|
||||||
|
Loading…
Reference in New Issue
Block a user