1{
2 system ? builtins.currentSystem,
3 config ? { },
4 pkgs ? import ../.. { inherit system config; },
5}:
6
7with import ../lib/testing-python.nix { inherit system pkgs; };
8with pkgs.lib;
9
10let
11 common_meta = {
12 maintainers = [ maintainers.viraptor ];
13 };
14in
15{
16 gemstash_works = makeTest {
17 name = "gemstash-works";
18 meta = common_meta;
19
20 nodes.machine =
21 { config, pkgs, ... }:
22 {
23 services.gemstash = {
24 enable = true;
25 };
26 };
27
28 # gemstash responds to http requests
29 testScript = ''
30 machine.wait_for_unit("gemstash.service")
31 machine.wait_for_file("/var/lib/gemstash")
32 machine.wait_for_open_port(9292)
33 machine.succeed("curl http://localhost:9292")
34 '';
35 };
36
37 gemstash_custom_port = makeTest {
38 name = "gemstash-custom-port";
39 meta = common_meta;
40
41 nodes.machine =
42 { config, pkgs, ... }:
43 {
44 services.gemstash = {
45 enable = true;
46 openFirewall = true;
47 settings = {
48 bind = "tcp://0.0.0.0:12345";
49 };
50 };
51 };
52
53 # gemstash responds to http requests
54 testScript = ''
55 machine.wait_for_unit("gemstash.service")
56 machine.wait_for_file("/var/lib/gemstash")
57 machine.wait_for_open_port(12345)
58 machine.succeed("curl http://localhost:12345")
59 '';
60 };
61}