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