mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
parent
93e131345f
commit
f7a4d10a08
2 changed files with 61 additions and 64 deletions
|
@ -1287,7 +1287,7 @@ in {
|
||||||
wstunnel = runTest ./wstunnel.nix;
|
wstunnel = runTest ./wstunnel.nix;
|
||||||
xandikos = handleTest ./xandikos.nix {};
|
xandikos = handleTest ./xandikos.nix {};
|
||||||
xautolock = handleTest ./xautolock.nix {};
|
xautolock = handleTest ./xautolock.nix {};
|
||||||
xfce = handleTest ./xfce.nix {};
|
xfce = runTest ./xfce.nix;
|
||||||
xfce-wayland = runTest ./xfce-wayland.nix;
|
xfce-wayland = runTest ./xfce-wayland.nix;
|
||||||
xmonad = runTest ./xmonad.nix;
|
xmonad = runTest ./xmonad.nix;
|
||||||
xmonad-xdg-autostart = runTest ./xmonad-xdg-autostart.nix;
|
xmonad-xdg-autostart = runTest ./xmonad-xdg-autostart.nix;
|
||||||
|
|
|
@ -1,76 +1,73 @@
|
||||||
import ./make-test-python.nix (
|
{
|
||||||
{ pkgs, ... }:
|
name = "xfce";
|
||||||
{
|
|
||||||
name = "xfce";
|
|
||||||
|
|
||||||
nodes.machine =
|
nodes.machine =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common/user-account.nix
|
./common/user-account.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
services.xserver.displayManager.lightdm.enable = true;
|
services.xserver.displayManager.lightdm.enable = true;
|
||||||
|
|
||||||
services.displayManager.autoLogin = {
|
services.displayManager.autoLogin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "alice";
|
user = "alice";
|
||||||
};
|
|
||||||
|
|
||||||
services.xserver.desktopManager.xfce.enable = true;
|
|
||||||
environment.systemPackages = [ pkgs.xfce.xfce4-whiskermenu-plugin ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enableOCR = true;
|
services.xserver.desktopManager.xfce.enable = true;
|
||||||
|
environment.systemPackages = [ pkgs.xfce.xfce4-whiskermenu-plugin ];
|
||||||
|
};
|
||||||
|
|
||||||
testScript =
|
enableOCR = true;
|
||||||
{ nodes, ... }:
|
|
||||||
let
|
|
||||||
user = nodes.machine.users.users.alice;
|
|
||||||
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
|
|
||||||
in
|
|
||||||
''
|
|
||||||
with subtest("Wait for login"):
|
|
||||||
machine.wait_for_x()
|
|
||||||
machine.wait_for_file("${user.home}/.Xauthority")
|
|
||||||
machine.succeed("xauth merge ${user.home}/.Xauthority")
|
|
||||||
|
|
||||||
with subtest("Check that logging in has given the user ownership of devices"):
|
testScript =
|
||||||
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
|
{ nodes, ... }:
|
||||||
|
let
|
||||||
|
user = nodes.machine.users.users.alice;
|
||||||
|
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
with subtest("Wait for login"):
|
||||||
|
machine.wait_for_x()
|
||||||
|
machine.wait_for_file("${user.home}/.Xauthority")
|
||||||
|
machine.succeed("xauth merge ${user.home}/.Xauthority")
|
||||||
|
|
||||||
with subtest("Check if Xfce components actually start"):
|
with subtest("Check that logging in has given the user ownership of devices"):
|
||||||
machine.wait_for_window("xfce4-panel")
|
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
|
||||||
machine.wait_for_window("Desktop")
|
|
||||||
for i in ["xfwm4", "xfsettingsd", "xfdesktop", "xfce4-screensaver", "xfce4-notifyd", "xfconfd"]:
|
|
||||||
machine.wait_until_succeeds(f"pgrep -f {i}")
|
|
||||||
|
|
||||||
with subtest("Open whiskermenu"):
|
with subtest("Check if Xfce components actually start"):
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfconf-query -c xfce4-panel -p /plugins/plugin-1 -t string -s whiskermenu -n >&2 &'")
|
machine.wait_for_window("xfce4-panel")
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfconf-query -c xfce4-panel -p /plugins/plugin-1/stay-on-focus-out -t bool -s true -n >&2 &'")
|
machine.wait_for_window("Desktop")
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-panel -r >&2 &'")
|
for i in ["xfwm4", "xfsettingsd", "xfdesktop", "xfce4-screensaver", "xfce4-notifyd", "xfconfd"]:
|
||||||
machine.wait_until_succeeds("journalctl -b --grep 'xfce4-panel: Restarting' -t xsession")
|
machine.wait_until_succeeds(f"pgrep -f {i}")
|
||||||
machine.sleep(5)
|
|
||||||
machine.wait_until_succeeds("pgrep -f libwhiskermenu")
|
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-popup-whiskermenu >&2 &'")
|
|
||||||
machine.wait_for_text('Mail Reader')
|
|
||||||
# Close the menu.
|
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-popup-whiskermenu >&2 &'")
|
|
||||||
|
|
||||||
with subtest("Open Xfce terminal"):
|
with subtest("Open whiskermenu"):
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 xfce4-terminal >&2 &'")
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfconf-query -c xfce4-panel -p /plugins/plugin-1 -t string -s whiskermenu -n >&2 &'")
|
||||||
machine.wait_for_window("Terminal")
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfconf-query -c xfce4-panel -p /plugins/plugin-1/stay-on-focus-out -t bool -s true -n >&2 &'")
|
||||||
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-panel -r >&2 &'")
|
||||||
|
machine.wait_until_succeeds("journalctl -b --grep 'xfce4-panel: Restarting' -t xsession")
|
||||||
|
machine.sleep(5)
|
||||||
|
machine.wait_until_succeeds("pgrep -f libwhiskermenu")
|
||||||
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-popup-whiskermenu >&2 &'")
|
||||||
|
machine.wait_for_text('Mail Reader')
|
||||||
|
# Close the menu.
|
||||||
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 ${bus} xfce4-popup-whiskermenu >&2 &'")
|
||||||
|
|
||||||
with subtest("Open Thunar"):
|
with subtest("Open Xfce terminal"):
|
||||||
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 thunar >&2 &'")
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 xfce4-terminal >&2 &'")
|
||||||
machine.wait_for_window("Thunar")
|
machine.wait_for_window("Terminal")
|
||||||
machine.wait_for_text('(Pictures|Public|Templates|Videos)')
|
|
||||||
|
|
||||||
with subtest("Check if any coredumps are found"):
|
with subtest("Open Thunar"):
|
||||||
machine.succeed("(coredumpctl --json=short 2>&1 || true) | grep 'No coredumps found'")
|
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 thunar >&2 &'")
|
||||||
machine.sleep(10)
|
machine.wait_for_window("Thunar")
|
||||||
machine.screenshot("screen")
|
machine.wait_for_text('(Pictures|Public|Templates|Videos)')
|
||||||
'';
|
|
||||||
}
|
with subtest("Check if any coredumps are found"):
|
||||||
)
|
machine.succeed("(coredumpctl --json=short 2>&1 || true) | grep 'No coredumps found'")
|
||||||
|
machine.sleep(10)
|
||||||
|
machine.screenshot("screen")
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue