about summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-08-10 11:23:57 -0400
committerGitHub <noreply@github.com>2019-08-10 11:23:57 -0400
commit2eaef474f2e9cfa34c7273c1b6cf0ea74829510b (patch)
treea2b169af1377329d843650e9027706ca8fab2fec
parent1ce7ece4b25a415e78b4fd1a7dce4c3e98f8a020 (diff)
parent45643baf2265826e05488064144cdd5911f62788 (diff)
downloadnixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.tar
nixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.tar.gz
nixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.tar.bz2
nixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.tar.lz
nixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.tar.xz
nixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.tar.zst
nixlib-2eaef474f2e9cfa34c7273c1b6cf0ea74829510b.zip
Merge pull request #66236 from worldofpeace/test-reorganize
Reorganize GNOME tests, re-enable LightDM for release-combined
-rw-r--r--nixos/release-combined.nix7
-rw-r--r--nixos/tests/all-tests.nix6
-rw-r--r--nixos/tests/gnome3-gdm.nix63
-rw-r--r--nixos/tests/gnome3-xorg.nix41
-rw-r--r--nixos/tests/gnome3.nix51
-rw-r--r--nixos/tests/lightdm.nix2
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-software/default.nix13
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/default.nix35
8 files changed, 126 insertions, 92 deletions
diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix
index b9a9515f94ef..7146aebf54be 100644
--- a/nixos/release-combined.nix
+++ b/nixos/release-combined.nix
@@ -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)
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index feb9e1cdfd3f..4a802158752c 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -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 {};
diff --git a/nixos/tests/gnome3-gdm.nix b/nixos/tests/gnome3-gdm.nix
deleted file mode 100644
index c2808d87d99d..000000000000
--- a/nixos/tests/gnome3-gdm.nix
+++ /dev/null
@@ -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");
-    '';
-})
diff --git a/nixos/tests/gnome3-xorg.nix b/nixos/tests/gnome3-xorg.nix
new file mode 100644
index 000000000000..f12361da0372
--- /dev/null
+++ b/nixos/tests/gnome3-xorg.nix
@@ -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");
+    '';
+})
diff --git a/nixos/tests/gnome3.nix b/nixos/tests/gnome3.nix
index b58c9e5a0e32..b6fe602a7327 100644
--- a/nixos/tests/gnome3.nix
+++ b/nixos/tests/gnome3.nix
@@ -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");
     '';
 })
diff --git a/nixos/tests/lightdm.nix b/nixos/tests/lightdm.nix
index 8a9a7408d292..c805f1ed9f3c 100644
--- a/nixos/tests/lightdm.nix
+++ b/nixos/tests/lightdm.nix
@@ -1,7 +1,7 @@
 import ./make-test.nix ({ pkgs, ...} : {
   name = "lightdm";
   meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ aszlig ];
+    maintainers = [ aszlig worldofpeace ];
   };
 
   machine = { ... }: {
diff --git a/pkgs/desktops/gnome-3/core/gnome-software/default.nix b/pkgs/desktops/gnome-3/core/gnome-software/default.nix
index e301305d405d..6d4875979007 100644
--- a/pkgs/desktops/gnome-3/core/gnome-software/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-software/default.nix
@@ -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 = {
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
index e0d70b5d43eb..b4d5d54137cd 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -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