nixos/fwupd: add test
This commit is contained in:
parent
be54e4b07e
commit
201cc158cb
|
@ -258,6 +258,7 @@ in rec {
|
||||||
tests.firefox = callTest tests/firefox.nix {};
|
tests.firefox = callTest tests/firefox.nix {};
|
||||||
tests.firewall = callTest tests/firewall.nix {};
|
tests.firewall = callTest tests/firewall.nix {};
|
||||||
tests.fleet = callTestOnTheseSystems ["x86_64-linux"] tests/fleet.nix {};
|
tests.fleet = callTestOnTheseSystems ["x86_64-linux"] tests/fleet.nix {};
|
||||||
|
tests.fwupd = callTest tests/fwupd.nix {};
|
||||||
#tests.gitlab = callTest tests/gitlab.nix {};
|
#tests.gitlab = callTest tests/gitlab.nix {};
|
||||||
tests.gitolite = callTest tests/gitolite.nix {};
|
tests.gitolite = callTest tests/gitolite.nix {};
|
||||||
tests.gocd-agent = callTest tests/gocd-agent.nix {};
|
tests.gocd-agent = callTest tests/gocd-agent.nix {};
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# run installed tests
|
||||||
|
import ./make-test.nix ({ pkgs, ... }: {
|
||||||
|
name = "fwupd";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
maintainers = pkgs.fwupd.meta.maintainers;
|
||||||
|
};
|
||||||
|
|
||||||
|
machine = { config, pkgs, ... }: {
|
||||||
|
services.fwupd.enable = true;
|
||||||
|
environment.systemPackages = with pkgs; [ gnome-desktop-testing ];
|
||||||
|
environment.variables.XDG_DATA_DIRS = [ "${pkgs.fwupd.installedTests}/share" ];
|
||||||
|
virtualisation.memorySize = 768;
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
$machine->succeed("gnome-desktop-testing-runner");
|
||||||
|
'';
|
||||||
|
})
|
|
@ -1,12 +1,14 @@
|
||||||
{ stdenv, fetchurl, fetchpatch, gtk_doc, pkgconfig, gobjectIntrospection, intltool
|
{ stdenv, fetchurl, fetchpatch, gtk_doc, pkgconfig, gobjectIntrospection, intltool
|
||||||
, libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking
|
, libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking
|
||||||
, libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales
|
, libsoup, docbook2x, gpgme, libxslt, elfutils, libsmbios, efivar, glibcLocales
|
||||||
, fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord
|
, fwupdate, libyaml, valgrind, meson, libuuid, colord
|
||||||
, pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook, json_glib
|
, ninja, gcab, gnutls, python3, wrapGAppsHook, json_glib
|
||||||
, shared_mime_info, umockdev
|
, shared_mime_info, umockdev
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
version = "1.0.4";
|
version = "1.0.4";
|
||||||
|
python = python3.withPackages (p: with p; [ pygobject3 pycairo pillow ]);
|
||||||
|
installedTestsPython = python3.withPackages (p: with p; [ pygobject3 requests ]);
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "fwupd-${version}";
|
name = "fwupd-${version}";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
|
@ -18,11 +20,11 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales shared_mime_info
|
meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales shared_mime_info
|
||||||
valgrind gcab docbook2x libxslt pygobject3 python3Packages.pycairo wrapGAppsHook
|
valgrind gcab docbook2x libxslt python wrapGAppsHook
|
||||||
];
|
];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml
|
polkit appstream-glib gusb sqlite libarchive libsoup elfutils libsmbios fwupdate libyaml
|
||||||
libgudev colord gpgme libuuid pillow gnutls glib_networking efivar json_glib umockdev
|
libgudev colord gpgme libuuid gnutls glib_networking efivar json_glib umockdev
|
||||||
];
|
];
|
||||||
|
|
||||||
LC_ALL = "en_US.UTF-8"; # For po/make-images
|
LC_ALL = "en_US.UTF-8"; # For po/make-images
|
||||||
|
@ -34,8 +36,18 @@ in stdenv.mkDerivation {
|
||||||
url = https://github.com/hughsie/fwupd/commit/bd6082574989e4f48b66c7270bb408d439b77a06.patch;
|
url = https://github.com/hughsie/fwupd/commit/bd6082574989e4f48b66c7270bb408d439b77a06.patch;
|
||||||
sha256 = "17pixyizkmn6wlsjmr1wwya17ivn770hdv9mp769vifxinya8w9y";
|
sha256 = "17pixyizkmn6wlsjmr1wwya17ivn770hdv9mp769vifxinya8w9y";
|
||||||
})
|
})
|
||||||
|
# https://github.com/hughsie/fwupd/issues/405
|
||||||
|
(fetchpatch {
|
||||||
|
url = https://github.com/hughsie/fwupd/pull/407.patch;
|
||||||
|
sha256 = "1dxhqps12x7bz0s974xk5hfpk4nwn1gs29vl0dfi9j54wy18f688";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
# needs a different set of modules than po/make-images
|
||||||
|
escapedInterpreterLine=$(echo "${installedTestsPython}/bin/python3" | sed 's|\\|\\\\|g')
|
||||||
|
sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" data/installed-tests/hardware.py
|
||||||
|
|
||||||
patchShebangs .
|
patchShebangs .
|
||||||
substituteInPlace data/installed-tests/fwupdmgr.test.in --subst-var-by installedtestsdir "$installedTests/share/installed-tests/fwupd"
|
substituteInPlace data/installed-tests/fwupdmgr.test.in --subst-var-by installedtestsdir "$installedTests/share/installed-tests/fwupd"
|
||||||
'';
|
'';
|
||||||
|
@ -48,6 +60,7 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
"-Dman=false"
|
"-Dman=false"
|
||||||
|
"-Dplugin_dummy=true"
|
||||||
"-Dgtkdoc=false"
|
"-Dgtkdoc=false"
|
||||||
"-Dbootdir=/boot"
|
"-Dbootdir=/boot"
|
||||||
"-Dudevdir=lib/udev"
|
"-Dudevdir=lib/udev"
|
||||||
|
@ -57,6 +70,8 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
moveToOutput share/installed-tests "$installedTests"
|
moveToOutput share/installed-tests "$installedTests"
|
||||||
|
wrapProgram $installedTests/share/installed-tests/fwupd/hardware.py \
|
||||||
|
--prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0:${libsoup}/lib/girepository-1.0"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
|
@ -12728,7 +12728,7 @@ with pkgs;
|
||||||
fscrypt-experimental = callPackage ../os-specific/linux/fscrypt { };
|
fscrypt-experimental = callPackage ../os-specific/linux/fscrypt { };
|
||||||
fscryptctl-experimental = callPackage ../os-specific/linux/fscryptctl { };
|
fscryptctl-experimental = callPackage ../os-specific/linux/fscryptctl { };
|
||||||
|
|
||||||
fwupd = callPackage ../os-specific/linux/firmware/fwupd { inherit (gnome2) gtk_doc; inherit (python3Packages) pygobject3 pillow; };
|
fwupd = callPackage ../os-specific/linux/firmware/fwupd { inherit (gnome2) gtk_doc; };
|
||||||
|
|
||||||
fwupdate = callPackage ../os-specific/linux/firmware/fwupdate { };
|
fwupdate = callPackage ../os-specific/linux/firmware/fwupdate { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue