1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

nixos/tests/deepin: init

This commit is contained in:
rewine 2023-04-25 11:34:09 +08:00 committed by rewine
parent d55808c2c0
commit d63d98212a
No known key found for this signature in database
GPG key ID: AABB329787290824
2 changed files with 58 additions and 0 deletions

View file

@ -170,6 +170,7 @@ in {
cups-pdf = handleTest ./cups-pdf.nix {};
custom-ca = handleTest ./custom-ca.nix {};
croc = handleTest ./croc.nix {};
deepin = handleTest ./deepin.nix {};
deluge = handleTest ./deluge.nix {};
dendrite = handleTest ./matrix/dendrite.nix {};
dex-oidc = handleTest ./dex-oidc.nix {};

57
nixos/tests/deepin.nix Normal file
View file

@ -0,0 +1,57 @@
import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "deepin";
meta = with lib; {
maintainers = teams.deepin.members;
};
nodes.machine = { ... }: {
imports = [
./common/user-account.nix
];
services.xserver.enable = true;
services.xserver.displayManager = {
lightdm.enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.desktopManager.deepin.enable = true;
};
testScript = { nodes, ... }:
let
user = nodes.machine.users.users.alice;
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"):
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
with subtest("Check if DDE wm chooser actually start"):
machine.wait_until_succeeds("pgrep -f dde-wm-chooser")
machine.wait_for_window("dde-wm-chooser")
machine.execute("pkill dde-wm-chooser")
with subtest("Check if Deepin session components actually start"):
machine.wait_until_succeeds("pgrep -f dde-session-daemon")
machine.wait_for_window("dde-session-daemon")
machine.wait_until_succeeds("pgrep -f dde-desktop")
machine.wait_for_window("dde-desktop")
with subtest("Open deepin-terminal"):
machine.succeed("su - ${user.name} -c 'DISPLAY=:0 deepin-terminal >&2 &'")
machine.wait_for_window("deepin-terminal")
machine.sleep(20)
machine.screenshot("screen")
'';
})