aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2024-12-22 11:31:12 +0900
committerOphestra <cat@gensokyo.uk>2024-12-22 11:31:12 +0900
commit5838963265055492d77004e9cd32605243fb4861 (patch)
tree256e8f324a5ada1ad2d6a6168d15fc21326311b1
parente8594cf670e9c5ef22da833702d0f14fd6d0731e (diff)
nix: test dbus via notify-send
Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--test.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/test.nix b/test.nix
index 5ffe5e81..cc95f05c 100644
--- a/test.nix
+++ b/test.nix
@@ -38,6 +38,10 @@ nixosTest {
wayland-utils
alacritty
+ # For D-Bus tests:
+ libnotify
+ mako
+
# For go tests:
self.devShells.${system}.fhs
];
@@ -176,6 +180,10 @@ nixosTest {
if instance['config']['confinement']['enablements'] != enablements:
raise Exception(f"unexpected enablements {instance['config']['confinement']['enablements']}")
+
+ def fortify(command):
+ swaymsg(f"exec fortify {command}")
+
start_all()
machine.wait_for_unit("multi-user.target")
@@ -198,8 +206,10 @@ nixosTest {
machine.wait_for_file("/tmp/fortify.1000/tmpdir/0/success-bare")
# Start fortify within Wayland session:
- swaymsg("exec fortify -v run --wayland --dbus touch /tmp/success-session")
- machine.wait_for_file("/tmp/fortify.1000/tmpdir/0/success-session")
+ fortify('-v run --wayland --dbus notify-send -a "NixOS Tests" "Test notification" "Notification from within sandbox." && touch /tmp/dbus-done')
+ machine.wait_for_file("/tmp/dbus-done")
+ collect_state_ui("dbus_notify_exited")
+ machine.succeed("pkill -9 mako")
# Start a terminal (foot) within fortify:
swaymsg("exec fortify run --wayland foot")