Skip to content

Commit 6d6502c

Browse files
committed
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 4bf2dd5)
1 parent 69266ad commit 6d6502c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/libstore/legacy-ssh-store.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ struct LegacySSHStore : public Store
1616
const Setting<int> maxConnections{this, 1, "max-connections", "maximum number of concurrent SSH connections"};
1717
const Setting<Path> sshKey{this, "", "ssh-key", "path to an SSH private key"};
1818
const Setting<bool> compress{this, false, "compress", "whether to compress the connection"};
19-
const Setting<Path> remoteProgram{this, "nix-store", "remote-program", "path to the nix-store executable on the remote system"};
19+
const Setting<Path> remoteProgram{
20+
this,
21+
getEnv("_NIX_TEST_LEGACY_SSH_REMOTE_PROGRAM", "nix-store"),
22+
"remote-program",
23+
"path to the nix-store executable on the remote system",
24+
};
2025
const Setting<std::string> remoteStore{this, "", "remote-store", "URI of the store on the remote system"};
2126

2227
// Hack for getting remote build log output.

src/libstore/ssh-store.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ class SSHStore : public RemoteStore
1616

1717
const Setting<Path> sshKey{(Store*) this, "", "ssh-key", "path to an SSH private key"};
1818
const Setting<bool> compress{(Store*) this, false, "compress", "whether to compress the connection"};
19-
const Setting<Path> remoteProgram{this, "nix-daemon", "remote-program", "path to the nix-daemon executable on the remote system"};
20-
const Setting<std::string> remoteStore{this, "", "remote-store", "URI of the store on the remote system"};
19+
const Setting<Path> remoteProgram{
20+
(Store *) this,
21+
getEnv("_NIX_TEST_SSH_REMOTE_PROGRAM", "nix-daemon"),
22+
"remote-program",
23+
"path to the nix-daemon executable on the remote system",
24+
};
25+
const Setting<std::string> remoteStore{(Store *) this, "", "remote-store", "URI of the store on the remote system"};
2126

2227
SSHStore(const std::string & host, const Params & params)
2328
: Store(params)

0 commit comments

Comments
 (0)