nixosTests.your_spotify: init

This commit is contained in:
Patrick 2024-04-13 10:59:11 +02:00
parent 77a6460e74
commit 05b36f060d
No known key found for this signature in database
GPG Key ID: 451F95EFB8BECD0F
2 changed files with 34 additions and 0 deletions

View File

@ -1042,6 +1042,7 @@ in {
yabar = handleTest ./yabar.nix {};
ydotool = handleTest ./ydotool.nix {};
yggdrasil = handleTest ./yggdrasil.nix {};
your_spotify = handleTest ./your_spotify.nix {};
zammad = handleTest ./zammad.nix {};
zeronet-conservancy = handleTest ./zeronet-conservancy.nix {};
zfs = handleTest ./zfs.nix {};

View File

@ -0,0 +1,33 @@
import ./make-test-python.nix ({pkgs, ...}: {
name = "your_spotify";
meta = with pkgs.lib.maintainers; {
maintainers = [patrickdag];
};
nodes.machine = {
services.your_spotify = {
enable = true;
spotifySecretFile = pkgs.writeText "spotifySecretFile" "deadbeef";
settings = {
CLIENT_ENDPOINT = "http://localhost";
API_ENDPOINT = "http://localhost:3000";
SPOTIFY_PUBLIC = "beefdead";
};
enableLocalDB = true;
nginxVirtualHost = "localhost";
};
};
testScript = ''
machine.wait_for_unit("your_spotify.service")
machine.wait_for_open_port(3000)
machine.wait_for_open_port(80)
out = machine.succeed("curl --fail -X GET 'http://localhost:3000/'")
assert "Hello !" in out
out = machine.succeed("curl --fail -X GET 'http://localhost:80/'")
assert "<title>Your Spotify</title>" in out
'';
})