summary refs log tree commit diff
path: root/nixos/tests
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
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')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/botamusique.nix47
2 files changed, 48 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 4ada4a5de80..99393e5b184 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -47,6 +47,7 @@ in
   boot = handleTestOn ["x86_64-linux"] ./boot.nix {}; # syslinux is unsupported on aarch64
   boot-stage1 = handleTest ./boot-stage1.nix {};
   borgbackup = handleTest ./borgbackup.nix {};
+  botamusique = handleTest ./botamusique.nix {};
   buildbot = handleTest ./buildbot.nix {};
   buildkite-agents = handleTest ./buildkite-agents.nix {};
   caddy = handleTest ./caddy.nix {};
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)
+  '';
+})