Merge pull request #66236 from worldofpeace/test-reorganize

Reorganize GNOME tests, re-enable LightDM for release-combined
This commit is contained in:
worldofpeace 2019-08-10 11:23:57 -04:00 committed by GitHub
commit 2eaef474f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 126 additions and 92 deletions

View File

@ -68,8 +68,9 @@ in rec {
nixos.tests.chromium.x86_64-linux or []
(all nixos.tests.firefox)
(all nixos.tests.firewall)
(except ["aarch64-linux"] nixos.tests.gnome3)
(except ["aarch64-linux"] nixos.tests.pantheon)
(all nixos.tests.gnome3-xorg)
(all nixos.tests.gnome3)
(all nixos.tests.pantheon)
nixos.tests.installer.zfsroot.x86_64-linux or [] # ZFS is 64bit only
(except ["aarch64-linux"] nixos.tests.installer.lvm)
(except ["aarch64-linux"] nixos.tests.installer.luksroot)
@ -103,7 +104,7 @@ in rec {
#(all nixos.tests.keymap.neo)
#(all nixos.tests.keymap.qwertz)
(all nixos.tests.plasma5)
#(all nixos.tests.lightdm)
(all nixos.tests.lightdm)
(all nixos.tests.login)
(all nixos.tests.misc)
(all nixos.tests.mutableUsers)

View File

@ -93,8 +93,8 @@ in
gitlab = handleTest ./gitlab.nix {};
gitolite = handleTest ./gitolite.nix {};
gjs = handleTest ./gjs.nix {};
gnome3 = handleTestOn ["x86_64-linux"] ./gnome3.nix {}; # libsmbios is unsupported on aarch64
gnome3-gdm = handleTestOn ["x86_64-linux"] ./gnome3-gdm.nix {}; # libsmbios is unsupported on aarch64
gnome3-xorg = handleTest ./gnome3-xorg.nix {};
gnome3 = handleTest ./gnome3.nix {};
gocd-agent = handleTest ./gocd-agent.nix {};
gocd-server = handleTest ./gocd-server.nix {};
google-oslogin = handleTest ./google-oslogin {};
@ -139,7 +139,7 @@ in
ldap = handleTest ./ldap.nix {};
leaps = handleTest ./leaps.nix {};
lidarr = handleTest ./lidarr.nix {};
#lightdm = handleTest ./lightdm.nix {};
lightdm = handleTest ./lightdm.nix {};
limesurvey = handleTest ./limesurvey.nix {};
login = handleTest ./login.nix {};
loki = handleTest ./loki.nix {};

View File

@ -1,63 +0,0 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "gnome3-gdm";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ lethalman ];
};
machine =
{ ... }:
{ imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager.gdm = {
enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.desktopManager.gnome3.enable = true;
virtualisation.memorySize = 1024;
};
testScript = let
# Keep line widths somewhat managable
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus";
gdbus = "${bus} gdbus";
# Call javascript in gnome shell, returns a tuple (success, output), where
# `success` is true if the dbus call was successful and output is what the
# javascript evaluates to.
eval = "call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval";
# False when startup is done
startingUp = "${gdbus} ${eval} Main.layoutManager._startingUp";
# Hopefully gnome-terminal's wm class
wmClass = "${gdbus} ${eval} global.display.focus_window.wm_class";
in ''
# wait for gdm to start
$machine->waitForUnit("display-manager.service");
# 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 /dev/snd/timer | grep -q alice");
# Wait for the wayland server
$machine->waitForFile("/run/user/1000/wayland-0");
# Wait for gnome shell, correct output should be "(true, 'false')"
$machine->waitUntilSucceeds("su - alice -c '${startingUp} | grep -q true,..false'");
# open a terminal
$machine->succeed("su - alice -c '${bus} gnome-terminal'");
# and check it's there
$machine->waitUntilSucceeds("su - alice -c '${wmClass} | grep -q gnome-terminal-server'");
# wait to get a nice screenshot
$machine->sleep(20);
$machine->screenshot("screen");
'';
})

View File

@ -0,0 +1,41 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "gnome3-xorg";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = pkgs.gnome3.maintainers;
};
machine =
{ ... }:
{ imports = [ ./common/user-account.nix ];
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = false;
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;
services.xserver.desktopManager.default = "gnome-xorg";
virtualisation.memorySize = 1024;
};
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 /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");
'';
})

View File

@ -1,7 +1,7 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "gnome3";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ domenkozar eelco lethalman ];
maintainers = pkgs.gnome3.maintainers;
};
machine =
@ -11,19 +11,34 @@ import ./make-test.nix ({ pkgs, ...} : {
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = false;
services.xserver.displayManager.lightdm.enable = true;
services.xserver.displayManager.lightdm.autoLogin.enable = true;
services.xserver.displayManager.lightdm.autoLogin.user = "alice";
services.xserver.displayManager.gdm = {
enable = true;
autoLogin = {
enable = true;
user = "alice";
};
};
services.xserver.desktopManager.gnome3.enable = true;
services.xserver.desktopManager.default = "gnome-xorg";
virtualisation.memorySize = 1024;
};
testScript =
''
$machine->waitForX;
testScript = let
# Keep line widths somewhat managable
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus";
gdbus = "${bus} gdbus";
# Call javascript in gnome shell, returns a tuple (success, output), where
# `success` is true if the dbus call was successful and output is what the
# javascript evaluates to.
eval = "call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval";
# False when startup is done
startingUp = "${gdbus} ${eval} Main.layoutManager._startingUp";
# Hopefully gnome-terminal's wm class
wmClass = "${gdbus} ${eval} global.display.focus_window.wm_class";
in ''
# wait for gdm to start
$machine->waitForUnit("display-manager.service");
# wait for alice to be logged in
$machine->waitForUnit("default.target","alice");
@ -31,11 +46,19 @@ import ./make-test.nix ({ pkgs, ...} : {
# Check that logging in has given the user ownership of devices.
$machine->succeed("getfacl /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);
# Wait for the wayland server
$machine->waitForFile("/run/user/1000/wayland-0");
# Wait for gnome shell, correct output should be "(true, 'false')"
$machine->waitUntilSucceeds("su - alice -c '${startingUp} | grep -q true,..false'");
# open a terminal
$machine->succeed("su - alice -c '${bus} gnome-terminal'");
# and check it's there
$machine->waitUntilSucceeds("su - alice -c '${wmClass} | grep -q gnome-terminal-server'");
# wait to get a nice screenshot
$machine->sleep(20);
$machine->screenshot("screen");
'';
})

View File

@ -1,7 +1,7 @@
import ./make-test.nix ({ pkgs, ...} : {
name = "lightdm";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ aszlig ];
maintainers = [ aszlig worldofpeace ];
};
machine = { ... }: {

View File

@ -3,6 +3,12 @@
, gtk3, gsettings-desktop-schemas, gnome-desktop, libxmlb, gnome-online-accounts, hicolor-icon-theme
, json-glib, libsecret, valgrind-light, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_43, gtk-doc, desktop-file-utils }:
let
withFwupd = stdenv.isx86_64 || stdenv.isi686;
in
stdenv.mkDerivation rec {
name = "gnome-software-${version}";
version = "3.32.4";
@ -29,13 +35,16 @@ stdenv.mkDerivation rec {
gtk3 glib packagekit appstream-glib libsoup
gsettings-desktop-schemas gnome-desktop
gspell json-glib libsecret ostree
polkit flatpak fwupd
libxmlb gnome-online-accounts
polkit flatpak libxmlb gnome-online-accounts
] ++ stdenv.lib.optionals withFwupd [
fwupd
];
mesonFlags = [
"-Dubuntu_reviews=false"
"-Dgudev=false"
] ++ stdenv.lib.optionals (!withFwupd) [
"-Dfwupd=false"
];
passthru = {

View File

@ -17,6 +17,18 @@ let
fontsConf = makeFontsConf {
fontDirectories = [ freefont_ttf ];
};
isx86 = stdenv.isx86_64 || stdenv.isi686;
# Dell isn't supported on Aarch64
haveDell = isx86;
# only redfish for x86_64
haveRedfish = stdenv.isx86_64;
# Currently broken on Aarch64
haveFlashrom = isx86;
in stdenv.mkDerivation rec {
pname = "fwupd";
version = "1.2.8";
@ -32,11 +44,12 @@ in stdenv.mkDerivation rec {
meson ninja gtk-doc pkgconfig gobject-introspection intltool shared-mime-info
valgrind gcab docbook_xml_dtd_43 docbook_xsl help2man libxslt python wrapGAppsHook vala
];
buildInputs = [
polkit libxmlb gusb sqlite libarchive libsoup elfutils libsmbios gnu-efi libyaml
libgudev colord gpgme libuuid gnutls glib-networking efivar json-glib umockdev
bash-completion cairo freetype fontconfig pango
];
polkit libxmlb gusb sqlite libarchive libsoup elfutils gnu-efi libyaml
libgudev colord gpgme libuuid gnutls glib-networking json-glib umockdev
bash-completion cairo freetype fontconfig pango efivar
] ++ stdenv.lib.optionals haveDell [ libsmbios ];
patches = [
./fix-paths.patch
@ -71,11 +84,14 @@ in stdenv.mkDerivation rec {
# /etc/os-release not available in sandbox
# doCheck = true;
preFixup = ''
preFixup = let
binPath = [ efibootmgr bubblewrap tpm2-tools ] ++ stdenv.lib.optional haveFlashrom flashrom;
in
''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
# See programs reached with fu_common_find_program_in_path in source
--prefix PATH : "${stdenv.lib.makeBinPath [ flashrom efibootmgr bubblewrap tpm2-tools ]}"
--prefix PATH : "${stdenv.lib.makeBinPath binPath}"
)
'';
@ -89,6 +105,13 @@ in stdenv.mkDerivation rec {
"--localstatedir=/var"
"--sysconfdir=/etc"
"-Dsysconfdir_install=${placeholder "out"}/etc"
] ++ stdenv.lib.optionals (!haveDell) [
"-Dplugin_dell=false"
"-Dplugin_synaptics=false"
] ++ stdenv.lib.optionals (!haveRedfish) [
"-Dplugin_redfish=false"
] ++ stdenv.lib.optionals (!haveFlashrom) [
"-Dplugin_flashrom=false"
];
# TODO: We need to be able to override the directory flags from meson setup hook