From 4329d79dbab9f9ae6654c59ac428b8935eb7f7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20M=C3=B6ller?= Date: Sun, 23 Jan 2022 21:08:10 +0100 Subject: [PATCH] nixos/tests: link tests to their packages --- pkgs/applications/blockchains/go-ethereum/default.nix | 4 +++- pkgs/applications/editors/emacs/generic.nix | 3 ++- pkgs/applications/editors/rstudio/default.nix | 6 +++++- .../graphics/sane/backends/brscan5/default.nix | 4 +++- pkgs/applications/networking/cluster/k3s/default.nix | 3 +++ pkgs/applications/networking/soapui/default.nix | 4 +++- pkgs/development/libraries/science/math/fenics/default.nix | 2 ++ .../tools/continuous-integration/jenkins/default.nix | 2 +- pkgs/misc/emulators/wine/base.nix | 7 +++++-- pkgs/os-specific/linux/multipath-tools/default.nix | 4 +++- pkgs/os-specific/linux/open-iscsi/default.nix | 4 +++- pkgs/servers/dns/doh-proxy-rust/default.nix | 4 +++- pkgs/servers/gerbera/default.nix | 3 +++ pkgs/servers/isso/default.nix | 4 +++- pkgs/servers/mediatomb/default.nix | 4 +++- pkgs/servers/nosql/riak/2.2.0.nix | 4 +++- pkgs/servers/web-apps/pict-rs/default.nix | 3 +++ pkgs/tools/security/haka/default.nix | 4 +++- 18 files changed, 54 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/blockchains/go-ethereum/default.nix b/pkgs/applications/blockchains/go-ethereum/default.nix index a934589e6872..3aa3f622024f 100644 --- a/pkgs/applications/blockchains/go-ethereum/default.nix +++ b/pkgs/applications/blockchains/go-ethereum/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit }: +{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc, IOKit, nixosTests }: let # A list of binaries to put into separate outputs @@ -50,6 +50,8 @@ in buildGoModule rec { propagatedBuildInputs = lib.optionals stdenv.isDarwin [ libobjc IOKit ]; + passthru.tests = { inherit (nixosTests) geth; }; + meta = with lib; { homepage = "https://geth.ethereum.org/"; description = "Official golang implementation of the Ethereum protocol"; diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index 49ecbbab4a3c..b6d556b445a0 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -10,7 +10,7 @@ , Xaw3d, libXcursor, pkg-config, gettext, libXft, dbus, libpng, libjpeg, giflib , libtiff, librsvg, gconf, libxml2, imagemagick, gnutls, libselinux , alsa-lib, cairo, acl, gpm, AppKit, GSS, ImageIO, m17n_lib, libotf -, sigtool, jansson, harfbuzz, sqlite +, sigtool, jansson, harfbuzz, sqlite, nixosTests , dontRecurseIntoAttrs ,emacsPackagesFor , libgccjit, targetPlatform, makeWrapper # native-comp params , systemd ? null @@ -208,6 +208,7 @@ let emacs = stdenv.mkDerivation (lib.optionalAttrs nativeComp { passthru = { inherit nativeComp; pkgs = dontRecurseIntoAttrs (emacsPackagesFor emacs); + tests = { inherit (nixosTests) emacs-daemon; }; }; meta = with lib; { diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index b230218e332b..04b688622be0 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -34,6 +34,7 @@ , server ? false # build server version , sqlite , pam +, nixosTests }: let @@ -209,7 +210,10 @@ in platforms = platforms.linux; }; - passthru = { inherit server; }; + passthru = { + inherit server; + tests = { inherit (nixosTests) rstudio-server; }; + }; } // lib.optionalAttrs (!server) { qtWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ gnumake ]}" diff --git a/pkgs/applications/graphics/sane/backends/brscan5/default.nix b/pkgs/applications/graphics/sane/backends/brscan5/default.nix index 17e9972cbe9f..9771384a5d1a 100644 --- a/pkgs/applications/graphics/sane/backends/brscan5/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan5/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb1, avahi-compat, glib, libredirect }: +{ stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb1, avahi-compat, glib, libredirect, nixosTests }: let myPatchElf = file: with lib; '' patchelf --set-interpreter \ @@ -88,6 +88,8 @@ stdenv.mkDerivation rec { dontPatchELF = true; + passthru.tests = { inherit (nixosTests) brscan5; }; + meta = { description = "Brother brscan5 sane backend driver"; homepage = "https://www.brother.com"; diff --git a/pkgs/applications/networking/cluster/k3s/default.nix b/pkgs/applications/networking/cluster/k3s/default.nix index f3b5e4cd70c9..34fe2bfb9d02 100644 --- a/pkgs/applications/networking/cluster/k3s/default.nix +++ b/pkgs/applications/networking/cluster/k3s/default.nix @@ -18,6 +18,7 @@ , fetchzip , fetchgit , zstd +, nixosTests }: with lib; @@ -289,5 +290,7 @@ stdenv.mkDerivation rec { passthru.updateScript = ./update.sh; + passthru.tests = { inherit (nixosTests) k3s-single-node k3s-single-node-docker; }; + meta = baseMeta; } diff --git a/pkgs/applications/networking/soapui/default.nix b/pkgs/applications/networking/soapui/default.nix index 96d3de98d891..6839b6be6729 100644 --- a/pkgs/applications/networking/soapui/default.nix +++ b/pkgs/applications/networking/soapui/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, lib, stdenv, writeText, jdk, makeWrapper }: +{ fetchurl, lib, stdenv, writeText, jdk, makeWrapper, nixosTests }: stdenv.mkDerivation rec { pname = "soapui"; @@ -46,6 +46,8 @@ stdenv.mkDerivation rec { '') ]; + passthru.tests = { inherit (nixosTests) soapui; }; + meta = with lib; { description = "The Most Advanced REST & SOAP Testing Tool in the World"; homepage = "https://www.soapui.org/"; diff --git a/pkgs/development/libraries/science/math/fenics/default.nix b/pkgs/development/libraries/science/math/fenics/default.nix index b65ab0bf63db..2690d544c2c8 100644 --- a/pkgs/development/libraries/science/math/fenics/default.nix +++ b/pkgs/development/libraries/science/math/fenics/default.nix @@ -26,6 +26,7 @@ , zlib , blas , lapack +, nixosTests }: let version = "2019.1.0"; @@ -260,6 +261,7 @@ let pythonPackages.pybind11 ]; doCheck = false; # Tries to orte_ess_init and call ssh to localhost + passthru.tests = { inherit (nixosTests) fenics; }; meta = { description = "Python bindings for the DOLFIN FEM compiler"; homepage = "https://fenicsproject.org/"; diff --git a/pkgs/development/tools/continuous-integration/jenkins/default.nix b/pkgs/development/tools/continuous-integration/jenkins/default.nix index 5823b5dac054..3a04ba2f8660 100644 --- a/pkgs/development/tools/continuous-integration/jenkins/default.nix +++ b/pkgs/development/tools/continuous-integration/jenkins/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { ''; passthru = { - tests = { inherit (nixosTests) jenkins; }; + tests = { inherit (nixosTests) jenkins jenkins-cli; }; updateScript = writeScript "update.sh" '' #!${stdenv.shell} diff --git a/pkgs/misc/emulators/wine/base.nix b/pkgs/misc/emulators/wine/base.nix index fa5c4afdc298..aad355048a18 100644 --- a/pkgs/misc/emulators/wine/base.nix +++ b/pkgs/misc/emulators/wine/base.nix @@ -1,7 +1,7 @@ { stdenv, lib, pkgArches, callPackage, name, version, src, mingwGccs, monos, geckos, platforms, bison, flex, fontforge, makeWrapper, pkg-config, - autoconf, hexdump, perl, + autoconf, hexdump, perl, nixosTests, supportFlags, patches, buildScript ? null, configureFlags ? [] @@ -144,7 +144,10 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify" ++ lib.optional (supportFlags.mingwSupport) "format"; - passthru = { inherit pkgArches; }; + passthru = { + inherit pkgArches; + tests = { inherit (nixosTests) wine; }; + }; meta = { inherit version platforms; homepage = "https://www.winehq.org/"; diff --git a/pkgs/os-specific/linux/multipath-tools/default.nix b/pkgs/os-specific/linux/multipath-tools/default.nix index 45ffa8896ae7..184d2e1fe6eb 100644 --- a/pkgs/os-specific/linux/multipath-tools/default.nix +++ b/pkgs/os-specific/linux/multipath-tools/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, pkg-config, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c, kmod }: +{ lib, stdenv, fetchurl, fetchpatch, pkg-config, perl, lvm2, libaio, gzip, readline, systemd, liburcu, json_c, kmod, nixosTests }: stdenv.mkDerivation rec { pname = "multipath-tools"; @@ -53,6 +53,8 @@ stdenv.mkDerivation rec { "SYSTEMDPATH=lib" ]; + passthru.tests = { inherit (nixosTests) iscsi-multipath-root; }; + meta = with lib; { description = "Tools for the Linux multipathing driver"; homepage = "http://christophe.varoqui.free.fr/"; diff --git a/pkgs/os-specific/linux/open-iscsi/default.nix b/pkgs/os-specific/linux/open-iscsi/default.nix index 0640316b627a..a4f6565f0c70 100644 --- a/pkgs/os-specific/linux/open-iscsi/default.nix +++ b/pkgs/os-specific/linux/open-iscsi/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, gettext -, util-linux, open-isns, openssl, kmod, perl, systemd, pkgconf +, util-linux, open-isns, openssl, kmod, perl, systemd, pkgconf, nixosTests }: stdenv.mkDerivation rec { @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { sed -i "s|/sbin/iscsiadm|$out/bin/iscsiadm|" $out/bin/iscsi_fw_login ''; + passthru.tests = { inherit (nixosTests) iscsi-root iscsi-multipath-root; }; + meta = with lib; { description = "A high performance, transport independent, multi-platform implementation of RFC3720"; license = licenses.gpl2Plus; diff --git a/pkgs/servers/dns/doh-proxy-rust/default.nix b/pkgs/servers/dns/doh-proxy-rust/default.nix index fb87e3b19484..221ae7ce7243 100644 --- a/pkgs/servers/dns/doh-proxy-rust/default.nix +++ b/pkgs/servers/dns/doh-proxy-rust/default.nix @@ -1,4 +1,4 @@ -{ lib, rustPlatform, fetchCrate, stdenv, Security, libiconv }: +{ lib, rustPlatform, fetchCrate, stdenv, Security, libiconv, nixosTests }: rustPlatform.buildRustPackage rec { pname = "doh-proxy-rust"; @@ -14,6 +14,8 @@ rustPlatform.buildRustPackage rec { buildInputs = lib.optionals stdenv.isDarwin [ Security libiconv ]; + passthru.tests = { inherit (nixosTests) doh-proxy-rust; }; + meta = with lib; { homepage = "https://github.com/jedisct1/doh-server"; description = "Fast, mature, secure DoH server proxy written in Rust"; diff --git a/pkgs/servers/gerbera/default.nix b/pkgs/servers/gerbera/default.nix index 368f2f494151..afad6e90dc20 100644 --- a/pkgs/servers/gerbera/default.nix +++ b/pkgs/servers/gerbera/default.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , cmake , pkg-config +, nixosTests # required , libiconv , libupnp @@ -96,6 +97,8 @@ stdenv.mkDerivation rec { zlib ] ++ flatten (builtins.catAttrs "packages" (builtins.filter (e: e.enable) options)); + passthru.tests = { inherit (nixosTests) mediatomb; }; + meta = with lib; { homepage = "https://docs.gerbera.io/"; description = "UPnP Media Server for 2020"; diff --git a/pkgs/servers/isso/default.nix b/pkgs/servers/isso/default.nix index 6550659898e0..f02fc8df3b1b 100644 --- a/pkgs/servers/isso/default.nix +++ b/pkgs/servers/isso/default.nix @@ -1,4 +1,4 @@ -{ pkgs, nodejs, lib, python3Packages, fetchFromGitHub }: +{ pkgs, nodejs, lib, python3Packages, fetchFromGitHub, nixosTests }: let nodeEnv = import ./node-env.nix { inherit (pkgs) stdenv lib python2 runCommand writeTextFile; @@ -53,6 +53,8 @@ with python3Packages; buildPythonApplication rec { ${python.interpreter} setup.py nosetests ''; + passthru.tests = { inherit (nixosTests) isso; }; + meta = with lib; { description = "A commenting server similar to Disqus"; homepage = "https://posativ.org/isso/"; diff --git a/pkgs/servers/mediatomb/default.nix b/pkgs/servers/mediatomb/default.nix index aa1304bf8922..3f5ac6530e16 100644 --- a/pkgs/servers/mediatomb/default.nix +++ b/pkgs/servers/mediatomb/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchgit , sqlite, expat, mp4v2, flac, spidermonkey_68, taglib, libexif, curl, ffmpeg, file -, pkg-config, autoreconfHook }: +, pkg-config, autoreconfHook, nixosTests }: stdenv.mkDerivation rec { pname = "mediatomb"; @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { buildInputs = [ sqlite expat spidermonkey_68 taglib libexif curl ffmpeg file mp4v2 flac pkg-config autoreconfHook ]; + passthru.tests = { inherit (nixosTests) mediatomb; }; + meta = with lib; { homepage = "http://mediatomb.cc"; repositories.git = "git://mediatomb.git.sourceforge.net/gitroot/mediatomb/mediatomb"; diff --git a/pkgs/servers/nosql/riak/2.2.0.nix b/pkgs/servers/nosql/riak/2.2.0.nix index 6cbdab1b59fe..3be8d95b139c 100644 --- a/pkgs/servers/nosql/riak/2.2.0.nix +++ b/pkgs/servers/nosql/riak/2.2.0.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, unzip, erlang, which, pam }: +{ stdenv, lib, fetchurl, unzip, erlang, which, pam, nixosTests }: let solrName = "solr-4.10.4-yz-2.tgz"; @@ -90,6 +90,8 @@ stdenv.mkDerivation { runHook postInstall ''; + passthru.tests = { inherit (nixosTests) riak; }; + meta = with lib; { maintainers = with maintainers; [ cstrahan mdaiter ]; description = "Dynamo inspired NoSQL DB by Basho"; diff --git a/pkgs/servers/web-apps/pict-rs/default.nix b/pkgs/servers/web-apps/pict-rs/default.nix index 6338b6195455..739ff2280e17 100644 --- a/pkgs/servers/web-apps/pict-rs/default.nix +++ b/pkgs/servers/web-apps/pict-rs/default.nix @@ -8,6 +8,7 @@ , imagemagick , ffmpeg , exiftool +, nixosTests }: rustPlatform.buildRustPackage rec { @@ -36,6 +37,8 @@ rustPlatform.buildRustPackage rec { --prefix PATH : "${lib.makeBinPath [ imagemagick ffmpeg exiftool ]}" ''; + passthru.tests = { inherit (nixosTests) pict-rs; }; + meta = with lib; { description = "A simple image hosting service"; homepage = "https://git.asonix.dog/asonix/pict-rs"; diff --git a/pkgs/tools/security/haka/default.nix b/pkgs/tools/security/haka/default.nix index 809902e88976..3ea38e060407 100644 --- a/pkgs/tools/security/haka/default.nix +++ b/pkgs/tools/security/haka/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cmake, swig, wireshark, check, rsync, libpcap, gawk, libedit, pcre }: +{ lib, stdenv, fetchurl, cmake, swig, wireshark, check, rsync, libpcap, gawk, libedit, pcre, nixosTests }: let version = "0.3.0"; in @@ -24,6 +24,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; buildInputs = [ swig wireshark check rsync libpcap gawk libedit pcre ]; + passthru.tests = { inherit (nixosTests) haka; }; + meta = { description = "A collection of tools that allows capturing TCP/IP packets and filtering them based on Lua policy files"; homepage = "http://www.haka-security.org/";