From cf12e0e7ed02b91b202e68d15f045b6982f22d71 Mon Sep 17 00:00:00 2001 From: Winter Date: Mon, 10 Jan 2022 21:29:04 -0500 Subject: [PATCH] nixos/thelounge: add test --- nixos/tests/all-tests.nix | 1 + nixos/tests/thelounge.nix | 29 ++++++++++++++++++++++ pkgs/development/node-packages/default.nix | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/thelounge.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 5ebe07ad3cb..014542486f4 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -472,6 +472,7 @@ in taskserver = handleTest ./taskserver.nix {}; telegraf = handleTest ./telegraf.nix {}; teleport = handleTest ./teleport.nix {}; + thelounge = handleTest ./thelounge.nix {}; tiddlywiki = handleTest ./tiddlywiki.nix {}; tigervnc = handleTest ./tigervnc.nix {}; timezone = handleTest ./timezone.nix {}; diff --git a/nixos/tests/thelounge.nix b/nixos/tests/thelounge.nix new file mode 100644 index 00000000000..e9b85685bf2 --- /dev/null +++ b/nixos/tests/thelounge.nix @@ -0,0 +1,29 @@ +import ./make-test-python.nix { + nodes = { + private = { config, pkgs, ... }: { + services.thelounge = { + enable = true; + plugins = [ pkgs.theLoungePlugins.themes.solarized ]; + }; + }; + + public = { config, pkgs, ... }: { + services.thelounge = { + enable = true; + public = true; + }; + }; + }; + + testScript = '' + start_all() + + for machine in machines: + machine.wait_for_unit("thelounge.service") + machine.wait_for_open_port(9000) + + private.wait_until_succeeds("journalctl -u thelounge.service | grep thelounge-theme-solarized") + private.wait_until_succeeds("journalctl -u thelounge.service | grep 'in private mode'") + public.wait_until_succeeds("journalctl -u thelounge.service | grep 'in public mode'") + ''; +} diff --git a/pkgs/development/node-packages/default.nix b/pkgs/development/node-packages/default.nix index 2e7c6fc38cc..82ad390ff60 100644 --- a/pkgs/development/node-packages/default.nix +++ b/pkgs/development/node-packages/default.nix @@ -1,4 +1,4 @@ -{ pkgs, nodejs, stdenv, applyPatches, fetchFromGitHub, fetchpatch, fetchurl }: +{ pkgs, nodejs, stdenv, applyPatches, fetchFromGitHub, fetchpatch, fetchurl, nixosTests }: let inherit (pkgs) lib; @@ -442,6 +442,7 @@ let echo /var/lib/thelounge > $out/lib/node_modules/thelounge/.thelounge_home patch -d $out/lib/node_modules/thelounge -p1 < ${./thelounge-packages-path.patch} ''; + passthru.tests = { inherit (nixosTests) thelounge; }; }; yaml-language-server = super.yaml-language-server.override {