From 6d6502c80878c030be4f79a78b41c8b79df254dd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 18 Nov 2021 22:14:35 +0000 Subject: [PATCH] Allow testing `ssh://` and `ssh-ng://` across versions too We want to make sure both protocols don't break. Also recall ssh-ng:// will be slightly different than unix:// because the former transfers files over the protocol too. Add env vars for the remote (ssh/ssh-ng) store programs, we will use them in the test suite soon. (cherry picked from commit 4bf2dd52a6da6b264d6c0f7d244108ac503fb003) --- src/libstore/legacy-ssh-store.cc | 7 ++++++- src/libstore/ssh-store.cc | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/libstore/legacy-ssh-store.cc b/src/libstore/legacy-ssh-store.cc index d5fbdd25aa47..28d95bb691c9 100644 --- a/src/libstore/legacy-ssh-store.cc +++ b/src/libstore/legacy-ssh-store.cc @@ -16,7 +16,12 @@ struct LegacySSHStore : public Store const Setting maxConnections{this, 1, "max-connections", "maximum number of concurrent SSH connections"}; const Setting sshKey{this, "", "ssh-key", "path to an SSH private key"}; const Setting compress{this, false, "compress", "whether to compress the connection"}; - const Setting remoteProgram{this, "nix-store", "remote-program", "path to the nix-store executable on the remote system"}; + const Setting remoteProgram{ + this, + getEnv("_NIX_TEST_LEGACY_SSH_REMOTE_PROGRAM", "nix-store"), + "remote-program", + "path to the nix-store executable on the remote system", + }; const Setting remoteStore{this, "", "remote-store", "URI of the store on the remote system"}; // Hack for getting remote build log output. diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc index 21813f22bc46..3810599d41f9 100644 --- a/src/libstore/ssh-store.cc +++ b/src/libstore/ssh-store.cc @@ -16,8 +16,13 @@ class SSHStore : public RemoteStore const Setting sshKey{(Store*) this, "", "ssh-key", "path to an SSH private key"}; const Setting compress{(Store*) this, false, "compress", "whether to compress the connection"}; - const Setting remoteProgram{this, "nix-daemon", "remote-program", "path to the nix-daemon executable on the remote system"}; - const Setting remoteStore{this, "", "remote-store", "URI of the store on the remote system"}; + const Setting remoteProgram{ + (Store *) this, + getEnv("_NIX_TEST_SSH_REMOTE_PROGRAM", "nix-daemon"), + "remote-program", + "path to the nix-daemon executable on the remote system", + }; + const Setting remoteStore{(Store *) this, "", "remote-store", "URI of the store on the remote system"}; SSHStore(const std::string & host, const Params & params) : Store(params)