mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 09:14:28 +00:00
nix-serve: Make test reusable and expose linked nix
in passthru
(#342778)
This commit is contained in:
commit
85dee2c70e
@ -685,7 +685,7 @@ in {
|
||||
nix-misc = handleTest ./nix/misc.nix {};
|
||||
nix-upgrade = handleTest ./nix/upgrade.nix {inherit (pkgs) nixVersions;};
|
||||
nix-required-mounts = runTest ./nix-required-mounts;
|
||||
nix-serve = handleTest ./nix-serve.nix {};
|
||||
nix-serve = runTest ./nix-serve.nix;
|
||||
nix-serve-ssh = handleTest ./nix-serve-ssh.nix {};
|
||||
nixops = handleTest ./nixops/default.nix {};
|
||||
nixos-generate-config = handleTest ./nixos-generate-config.nix {};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import ./make-test-python.nix ({ pkgs, ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
name = "nix-serve";
|
||||
nodes.machine = { pkgs, ... }: {
|
||||
@ -9,7 +9,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
};
|
||||
testScript = let
|
||||
pkgHash = builtins.head (
|
||||
builtins.match "${builtins.storeDir}/([^-]+).+" (toString pkgs.hello)
|
||||
builtins.match "${builtins.storeDir}/([^-]+).+" (toString config.node.pkgs.hello)
|
||||
);
|
||||
in ''
|
||||
start_all()
|
||||
@ -19,4 +19,4 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
||||
"curl --fail -g http://0.0.0.0:5000/nar/${pkgHash}.nar -o /tmp/hello.nar"
|
||||
)
|
||||
'';
|
||||
})
|
||||
}
|
||||
|
@ -35,6 +35,9 @@ stdenv.mkDerivation {
|
||||
--add-flags $out/libexec/nix-serve/nix-serve.psgi
|
||||
'';
|
||||
|
||||
/** The nix package that nix-serve got its nix perl bindings from. */
|
||||
passthru.nix = nix;
|
||||
|
||||
passthru.tests = {
|
||||
nix-serve = nixosTests.nix-serve;
|
||||
nix-serve-ssh = nixosTests.nix-serve-ssh;
|
||||
|
Loading…
Reference in New Issue
Block a user