From 66dbc0fdeebf509c5d919e9c12b2645136d6deeb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Jul 2014 01:50:29 +0200 Subject: Add a test for the SSH substituter --- tests/nix-copy-closure.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/nix-copy-closure.nix b/tests/nix-copy-closure.nix index bfd708404d..1418c65897 100644 --- a/tests/nix-copy-closure.nix +++ b/tests/nix-copy-closure.nix @@ -4,7 +4,7 @@ with import { inherit system; }; -makeTest (let pkgA = pkgs.aterm; pkgB = pkgs.wget; in { +makeTest (let pkgA = pkgs.aterm; pkgB = pkgs.wget; pkgC = pkgs.hello; in { nodes = { client = @@ -12,13 +12,14 @@ makeTest (let pkgA = pkgs.aterm; pkgB = pkgs.wget; in { { virtualisation.writableStore = true; virtualisation.pathsInNixDB = [ pkgA ]; nix.package = nix; + nix.binaryCaches = [ ]; }; server = { config, pkgs, ... }: { services.openssh.enable = true; virtualisation.writableStore = true; - virtualisation.pathsInNixDB = [ pkgB ]; + virtualisation.pathsInNixDB = [ pkgB pkgC ]; nix.package = nix; }; }; @@ -49,6 +50,14 @@ makeTest (let pkgA = pkgs.aterm; pkgB = pkgs.wget; in { $client->fail("nix-store --check-validity ${pkgB}"); $client->succeed("nix-copy-closure --from server --gzip ${pkgB} >&2"); $client->succeed("nix-store --check-validity ${pkgB}"); + + # Copy the closure of package C via the SSH substituter. + $client->fail("nix-store -r ${pkgC}"); + $client->succeed( + "nix-store --option use-ssh-substituter true" + . " --option ssh-substituter-hosts root\@server" + . " -r ${pkgC} >&2"); + $client->succeed("nix-store --check-validity ${pkgC}"); ''; }) -- cgit 1.4.1