-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixosTests.gnome3-flashback: init #71212
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# GNOME Flashback Terminal tests for various custom sessions. | ||
|
||
{ system ? builtins.currentSystem, | ||
config ? {}, | ||
pkgs ? import ../../.. { inherit system config; } | ||
}: | ||
|
||
with import ../../lib/testing.nix { inherit system pkgs; }; | ||
with pkgs.lib; | ||
|
||
let | ||
|
||
baseConfig = { | ||
imports = [ ../common/user-account.nix ]; | ||
|
||
services.xserver.enable = true; | ||
|
||
# See: https://github.com/NixOS/nixpkgs/issues/66443 | ||
services.xserver.displayManager.gdm.enable = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a comment why this is done? I do not think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, it seems in the Actual issue with why we don't test with gdm is #66443. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, link there should be enough. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GDM doesn't have any way to specify a default session, and I'm guessing it will happily launch wayland sessions even though GDM itself runs X11. Think I switched the test to LightDM when adding wayland support since I didn't manage to get it launch the correct session. We'd probably have to do something with AccountsService to get it working. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, that's weird, GDM X11 does indeed launch an X11 session, never mind me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I wasn't sure why I was seeing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hedning You're actually correct, setting xserver |
||
services.xserver.displayManager.lightdm.enable = true; | ||
services.xserver.displayManager.lightdm.autoLogin.enable = true; | ||
services.xserver.displayManager.lightdm.autoLogin.user = "alice"; | ||
services.xserver.desktopManager.gnome3.enable = true; | ||
|
||
virtualisation.memorySize = 2047; | ||
}; | ||
|
||
makeFlashbackTest = | ||
{ wmName | ||
, wmLabel ? "" | ||
, wmCommand ? "" | ||
, useMetacity ? false | ||
}: | ||
makeTest rec { | ||
name = "gnome-flashback-${wmName}"; | ||
|
||
meta = with pkgs.stdenv.lib.maintainers; { | ||
maintainers = pkgs.gnome3.maintainers; | ||
}; | ||
|
||
machine = { ... }: { | ||
imports = [ baseConfig ]; | ||
|
||
services.xserver.desktopManager.default = "gnome-flashback-${wmName}"; | ||
|
||
services.xserver.desktopManager.gnome3.flashback = { | ||
enableMetacity = useMetacity; | ||
|
||
customSessions = mkIf (!useMetacity) [ | ||
{ inherit wmName wmLabel wmCommand; } | ||
]; | ||
}; | ||
|
||
}; | ||
|
||
testScript = | ||
'' | ||
$machine->waitForX; | ||
|
||
# wait for alice to be logged in | ||
$machine->waitForUnit("default.target","alice"); | ||
|
||
# Check that logging in has given the user ownership of devices. | ||
$machine->succeed("getfacl -p /dev/snd/timer | grep -q alice"); | ||
|
||
$machine->succeed("su - alice -c 'DISPLAY=:0.0 gnome-terminal &'"); | ||
$machine->succeed("xauth merge ~alice/.Xauthority"); | ||
$machine->waitForWindow(qr/alice.*machine/); | ||
$machine->succeed("timeout 900 bash -c 'while read msg; do if [[ \$msg =~ \"GNOME Shell started\" ]]; then break; fi; done < <(journalctl -f)'"); | ||
$machine->sleep(10); | ||
$machine->screenshot("screen"); | ||
''; | ||
}; | ||
|
||
in | ||
|
||
{ | ||
|
||
metacity = makeFlashbackTest { | ||
useMetacity = true; | ||
wmName = "metacity"; | ||
}; | ||
|
||
# TODO: These are currently broken with gnome-session 3.34 | ||
# See: https://github.com/NixOS/nixpkgs/pull/71212#issuecomment-544303107 | ||
# i3 = makeFlashbackTest { | ||
# wmName = "i3"; | ||
# wmLabel = "i3"; | ||
# wmCommand = "${pkgs.i3}/bin/i3"; | ||
# }; | ||
|
||
# xmonad = makeFlashbackTest { | ||
# wmName = "xmonad"; | ||
# wmLabel = "XMonad"; | ||
# wmCommand = "${pkgs.haskellPackages.xmonad}/bin/xmonad"; | ||
# }; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they pretty much test if a terminal shows up.
Btw, I've pretty much rewritten this entirely locally. Though there's issues with the python testing driver and other ports preventing me from re-PRing it.