mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-30 06:01:19 +00:00
nixos: add maestral tests
This commit is contained in:
parent
43844c1f1a
commit
e38cc45dd1
@ -281,6 +281,7 @@ in
|
||||
#logstash = handleTest ./logstash.nix {};
|
||||
lorri = handleTest ./lorri/default.nix {};
|
||||
maddy = handleTest ./maddy.nix {};
|
||||
maestral = handleTest ./maestral.nix {};
|
||||
magic-wormhole-mailbox-server = handleTest ./magic-wormhole-mailbox-server.nix {};
|
||||
magnetico = handleTest ./magnetico.nix {};
|
||||
mailcatcher = handleTest ./mailcatcher.nix {};
|
||||
|
72
nixos/tests/maestral.nix
Normal file
72
nixos/tests/maestral.nix
Normal file
@ -0,0 +1,72 @@
|
||||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "maestral";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ peterhoeg ];
|
||||
};
|
||||
|
||||
nodes =
|
||||
let
|
||||
common = attrs:
|
||||
pkgs.lib.recursiveUpdate
|
||||
{
|
||||
imports = [ ./common/user-account.nix ];
|
||||
systemd.user.services.maestral = {
|
||||
description = "Maestral Dropbox Client";
|
||||
serviceConfig.Type = "exec";
|
||||
};
|
||||
}
|
||||
attrs;
|
||||
|
||||
in
|
||||
{
|
||||
cli = { ... }: common {
|
||||
systemd.user.services.maestral = {
|
||||
wantedBy = [ "default.target" ];
|
||||
serviceConfig.ExecStart = "${pkgs.maestral}/bin/maestral start --foreground";
|
||||
};
|
||||
};
|
||||
|
||||
gui = { ... }: common {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
displayManager.defaultSession = "plasma";
|
||||
desktopManager.plasma5.enable = true;
|
||||
desktopManager.plasma5.runUsingSystemd = true;
|
||||
displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "alice";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services = {
|
||||
maestral = {
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig.ExecStart = "${pkgs.maestral-gui}/bin/maestral_qt";
|
||||
};
|
||||
# PowerDevil doesn't like our VM
|
||||
plasma-powerdevil.enable = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = { nodes, ... }:
|
||||
let
|
||||
user = nodes.cli.config.users.users.alice;
|
||||
in
|
||||
''
|
||||
start_all()
|
||||
|
||||
with subtest("CLI"):
|
||||
# we need SOME way to give the user an active login session
|
||||
cli.execute("loginctl enable-linger ${user.name}")
|
||||
cli.systemctl("start user@${toString user.uid}")
|
||||
cli.wait_for_unit("maestral.service", "${user.name}")
|
||||
|
||||
with subtest("GUI"):
|
||||
gui.wait_for_x()
|
||||
gui.succeed("xauth merge ${user.home}/.Xauthority")
|
||||
gui.wait_for_window("^Desktop ")
|
||||
gui.wait_for_unit("maestral.service", "${user.name}")
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue
Block a user