vuls: init at 0.27.0
[NixPkgs.git] / nixos / tests / your_spotify.nix
bloba1fa0e459a8e16767636408ff385bdf8d802b862
1 import ./make-test-python.nix ({pkgs, ...}: {
2   name = "your_spotify";
3   meta = with pkgs.lib.maintainers; {
4     maintainers = [patrickdag];
5   };
7   nodes.machine = {
8     services.your_spotify = {
9       enable = true;
10       spotifySecretFile = pkgs.writeText "spotifySecretFile" "deadbeef";
11       settings = {
12         CLIENT_ENDPOINT = "http://localhost";
13         API_ENDPOINT = "http://localhost:3000";
14         SPOTIFY_PUBLIC = "beefdead";
15       };
16       enableLocalDB = true;
17       nginxVirtualHost = "localhost";
18     };
19   };
21   testScript = ''
22     machine.wait_for_unit("your_spotify.service")
24     machine.wait_for_open_port(3000)
25     machine.wait_for_open_port(80)
27     out = machine.succeed("curl --fail -X GET 'http://localhost:3000/'")
28     assert "Hello !" in out
30     out = machine.succeed("curl --fail -X GET 'http://localhost:80/'")
31     assert "<title>Your Spotify</title>" in out
32   '';