Skip to content
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

openssh: put tests into passthru #277579

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
openssh: put tests into passthru
openssh tests are very slow (they take ~30 mins because they are not
parallelized). This makes rebuilding (esp. after changes e.g. to
systemd) painful. Putting the tests into a separate derivation solves
this without losing any testing capability.

Debian does the same: https://packages.debian.org/sid/openssh-tests
  • Loading branch information
nikstur committed Jun 14, 2024
commit 867751755870b1a6926f553208936768ee9f5a08
2 changes: 2 additions & 0 deletions nixos/release-small.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ in rec {
nginx
nodejs
openssh
opensshTest
php
postgresql
python
Expand Down Expand Up @@ -139,6 +140,7 @@ in rec {
"nixos.tests.simple"
"nixpkgs.jdk"
"nixpkgs.tests-stdenv-gcc-stageCompare"
"nixpkgs.opensshTest"
])
];
};
Expand Down
12 changes: 8 additions & 4 deletions pkgs/tools/networking/openssh/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
, isNixos ? stdenv.hostPlatform.isLinux
}:

stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
inherit pname version src;

patches = [
Expand Down Expand Up @@ -111,7 +111,7 @@ stdenv.mkDerivation {

hardeningEnable = [ "pie" ];

doCheck = true;
doCheck = false;
enableParallelChecking = false;
nativeCheckInputs = [ openssl ] ++ lib.optional (!stdenv.isDarwin) hostname;
preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
Expand Down Expand Up @@ -181,7 +181,11 @@ stdenv.mkDerivation {
inherit withKerberos;
tests = {
borgbackup-integration = nixosTests.borgbackup;
openssh = nixosTests.openssh;
nixosTest = nixosTests.openssh;
openssh = finalAttrs.finalPackage.overrideAttrs (previousAttrs: {
pname = previousAttrs.pname + "-test";
doCheck = true;
});
};
};

Expand All @@ -194,4 +198,4 @@ stdenv.mkDerivation {
maintainers = (extraMeta.maintainers or []) ++ (with maintainers; [ eelco aneeshusa ]);
mainProgram = "ssh";
} // extraMeta;
}
})
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11328,6 +11328,8 @@ with pkgs;
etcDir = "/etc/ssh";
};

opensshTest = openssh.tests.openssh;

opensshWithKerberos = openssh.override {
withKerberos = true;
};
Expand Down