summary refs log tree commit diff
path: root/nixos/tests/gemstash.nix
diff options
context:
space:
mode:
authorStanisław Pitucha <git@viraptor.info>2022-08-11 20:10:58 +1000
committerStanisław Pitucha <git@viraptor.info>2023-03-07 15:56:56 +1100
commit70073985ae856f777639a4742943f48b317d7799 (patch)
tree9a1ab3fbb385d3afde757212aeb3406b8701b299 /nixos/tests/gemstash.nix
parentb6cc2f2979a19ec2983cef156d5d44b2fe0e545f (diff)
downloadnixpkgs-70073985ae856f777639a4742943f48b317d7799.tar
nixpkgs-70073985ae856f777639a4742943f48b317d7799.tar.gz
nixpkgs-70073985ae856f777639a4742943f48b317d7799.tar.bz2
nixpkgs-70073985ae856f777639a4742943f48b317d7799.tar.lz
nixpkgs-70073985ae856f777639a4742943f48b317d7799.tar.xz
nixpkgs-70073985ae856f777639a4742943f48b317d7799.tar.zst
nixpkgs-70073985ae856f777639a4742943f48b317d7799.zip
nixos/gemstash: init module
Diffstat (limited to 'nixos/tests/gemstash.nix')
-rw-r--r--nixos/tests/gemstash.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/nixos/tests/gemstash.nix b/nixos/tests/gemstash.nix
new file mode 100644
index 00000000000..bc152e42e92
--- /dev/null
+++ b/nixos/tests/gemstash.nix
@@ -0,0 +1,51 @@
+{ system ? builtins.currentSystem, config ? { }
+, pkgs ? import ../.. { inherit system config; } }:
+
+with import ../lib/testing-python.nix { inherit system pkgs; };
+with pkgs.lib;
+
+let common_meta = { maintainers = [ maintainers.viraptor ]; };
+in
+{
+  gemstash_works = makeTest {
+    name = "gemstash-works";
+    meta = common_meta;
+
+    nodes.machine = { config, pkgs, ... }: {
+      services.gemstash = {
+        enable = true;
+      };
+    };
+
+    # gemstash responds to http requests
+    testScript = ''
+      machine.wait_for_unit("gemstash.service")
+      machine.wait_for_file("/var/lib/gemstash")
+      machine.wait_for_open_port(9292)
+      machine.succeed("curl http://localhost:9292")
+    '';
+  };
+
+  gemstash_custom_port = makeTest {
+    name = "gemstash-custom-port";
+    meta = common_meta;
+
+    nodes.machine = { config, pkgs, ... }: {
+      services.gemstash = {
+        enable = true;
+        openFirewall = true;
+        settings = {
+          bind = "tcp://0.0.0.0:12345";
+        };
+      };
+    };
+
+    # gemstash responds to http requests
+    testScript = ''
+      machine.wait_for_unit("gemstash.service")
+      machine.wait_for_file("/var/lib/gemstash")
+      machine.wait_for_open_port(12345)
+      machine.succeed("curl http://localhost:12345")
+    '';
+  };
+}