summary refs log tree commit diff
path: root/nixos/tests/botamusique.nix
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2021-05-04 14:30:25 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2021-05-23 01:01:52 +0200
commitd210ed99c4461c4d11f7a2a02a4da2cfe41616af (patch)
tree6148b9ffee50196961594f19d36878849af8a02e /nixos/tests/botamusique.nix
parent59e5ff4b29a8091135938d2145df9a7b2ed3c11e (diff)
downloadnixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.tar
nixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.tar.gz
nixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.tar.bz2
nixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.tar.lz
nixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.tar.xz
nixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.tar.zst
nixpkgs-d210ed99c4461c4d11f7a2a02a4da2cfe41616af.zip
nixos/tests/botamusique: init
Diffstat (limited to 'nixos/tests/botamusique.nix')
-rw-r--r--nixos/tests/botamusique.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixos/tests/botamusique.nix b/nixos/tests/botamusique.nix
new file mode 100644
index 00000000000..ccb105dc142
--- /dev/null
+++ b/nixos/tests/botamusique.nix
@@ -0,0 +1,47 @@
+import ./make-test-python.nix ({ pkgs, lib, ...} :
+
+{
+  name = "botamusique";
+  meta.maintainers = with lib.maintainers; [ hexa ];
+
+  nodes = {
+    machine = { config, ... }: {
+      services.murmur = {
+        enable = true;
+        registerName = "NixOS tests";
+      };
+
+      services.botamusique = {
+        enable = true;
+        settings = {
+          server = {
+            channel = "NixOS tests";
+          };
+          bot = {
+            version = false;
+            auto_check_update = false;
+          };
+        };
+      };
+    };
+  };
+
+  testScript = ''
+    start_all()
+
+    machine.wait_for_unit("murmur.service")
+    machine.wait_for_unit("botamusique.service")
+
+    machine.sleep(10)
+
+    machine.wait_until_succeeds(
+        "journalctl -u murmur.service -e | grep -q '<1:botamusique(-1)> Authenticated'"
+    )
+
+    with subtest("Check systemd hardening"):
+        output = machine.execute("systemctl show botamusique.service")[1]
+        machine.log(output)
+        output = machine.execute("systemd-analyze security botamusique.service")[1]
+        machine.log(output)
+  '';
+})