summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Kampka <christian@kampka.net>2021-07-03 08:32:03 +0100
committermatthewcroughan <matt@croughan.sh>2021-07-03 08:32:03 +0100
commit971e37dc07266ae61104e3a246cdfd81e867f089 (patch)
tree7042a1b5042cc6525ca1d70bb37ddbdbb7c0edb6
parent3aa9692beb99d6fa0016e99629fbf1f1ed4ec6b2 (diff)
downloadnixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.tar
nixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.tar.gz
nixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.tar.bz2
nixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.tar.lz
nixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.tar.xz
nixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.tar.zst
nixpkgs-971e37dc07266ae61104e3a246cdfd81e867f089.zip
nixos/tests/coturn: init
Co-authored-by: MatthewCroughan <matt@croughan.sh>
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/coturn.nix29
2 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index b5126be8af7..d18770859f2 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -88,6 +88,7 @@ in
   containers-tmpfs = handleTest ./containers-tmpfs.nix {};
   convos = handleTest ./convos.nix {};
   corerad = handleTest ./corerad.nix {};
+  coturn = handleTest ./coturn.nix {};
   couchdb = handleTest ./couchdb.nix {};
   cri-o = handleTestOn ["x86_64-linux"] ./cri-o.nix {};
   custom-ca = handleTest ./custom-ca.nix {};
diff --git a/nixos/tests/coturn.nix b/nixos/tests/coturn.nix
new file mode 100644
index 00000000000..dff832281c7
--- /dev/null
+++ b/nixos/tests/coturn.nix
@@ -0,0 +1,29 @@
+import ./make-test-python.nix ({ ... }: {
+  name = "coturn";
+  nodes = {
+    default = {
+      services.coturn.enable = true;
+    };
+    secretsfile = {
+      boot.postBootCommands = ''
+        echo "some-very-secret-string" > /run/coturn-secret
+      '';
+      services.coturn = {
+        enable = true;
+        static-auth-secret-file = "/run/coturn-secret";
+      };
+    };
+  };
+
+  testScript =
+    ''
+      start_all()
+
+      with subtest("by default works without configuration"):
+          default.wait_for_unit("coturn.service")
+
+      with subtest("works with static-auth-secret-file"):
+          secretsfile.wait_for_unit("coturn.service")
+          secretsfile.succeed("grep 'some-very-secret-string' /run/coturn/turnserver.cfg")
+    '';
+})