From 9b6a396959ccf2e09fbf39b1e47dffc10f2dd2d0 Mon Sep 17 00:00:00 2001 From: ckgxrg Date: Sat, 25 Jan 2025 00:39:20 +0800 Subject: [PATCH] linux-wallpaperengine: add tests --- tests/default.nix | 1 + .../basic-configuration-expected.service | 11 ++++++ .../basic-configuration.nix | 35 +++++++++++++++++++ .../linux-wallpaperengine/default.nix | 1 + 4 files changed, 48 insertions(+) create mode 100644 tests/modules/services/linux-wallpaperengine/basic-configuration-expected.service create mode 100644 tests/modules/services/linux-wallpaperengine/basic-configuration.nix create mode 100644 tests/modules/services/linux-wallpaperengine/default.nix diff --git a/tests/default.nix b/tests/default.nix index b77c354c5016..dcb8fba59168 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -265,6 +265,7 @@ in import nmtSrc { ./modules/services/imapnotify ./modules/services/kanshi ./modules/services/lieer + ./modules/services/linux-wallpaperengine ./modules/services/mopidy ./modules/services/mpd ./modules/services/mpd-mpris diff --git a/tests/modules/services/linux-wallpaperengine/basic-configuration-expected.service b/tests/modules/services/linux-wallpaperengine/basic-configuration-expected.service new file mode 100644 index 000000000000..b0827a39deb3 --- /dev/null +++ b/tests/modules/services/linux-wallpaperengine/basic-configuration-expected.service @@ -0,0 +1,11 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=@linux-wallpaperengine@/bin/linux-wallpaperengine --assets-dir /some/path/to/assets --clamping border --fps 6 --scaling fit --screen-root HDMI-1 --bg 12345678 --no-audio-processing --noautomute --screen-root DP-1 --silent --scaling fill --fps 12 --bg 87654321 +Restart=on-failure + +[Unit] +After=graphical-session.target +Description=Implementation of Wallpaper Engine on Linux +PartOf=graphical-session.target diff --git a/tests/modules/services/linux-wallpaperengine/basic-configuration.nix b/tests/modules/services/linux-wallpaperengine/basic-configuration.nix new file mode 100644 index 000000000000..10aef1b5181a --- /dev/null +++ b/tests/modules/services/linux-wallpaperengine/basic-configuration.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + services.linux-wallpaperengine = { + enable = true; + assetsPath = "/some/path/to/assets"; + clamping = "border"; + wallpapers = [ + { + monitor = "HDMI-1"; + wallpaperId = "12345678"; + scaling = "fit"; + fps = 6; + } + { + monitor = "DP-1"; + wallpaperId = "87654321"; + extraOptions = [ "--scaling fill" "--fps 12" ]; + audio = { + silent = true; + automute = false; + audio-processing = false; + }; + } + ]; + }; + + test.stubs.linux-wallpaperengine = { }; + + nmt.script = '' + assertFileContent \ + home-files/.config/systemd/user/linux-wallpaperengine.service \ + ${./basic-configuration-expected.service} + ''; +} diff --git a/tests/modules/services/linux-wallpaperengine/default.nix b/tests/modules/services/linux-wallpaperengine/default.nix new file mode 100644 index 000000000000..430aa129d72d --- /dev/null +++ b/tests/modules/services/linux-wallpaperengine/default.nix @@ -0,0 +1 @@ +{ linux-wallpaperengine-basic-configuration = ./basic-configuration.nix; }