Skip to content

Commit

Permalink
Allow testing ssh:// and ssh-ng:// across versions too
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Ericson2314 committed Dec 9, 2021
1 parent 69266ad commit 6d6502c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/libstore/legacy-ssh-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ struct LegacySSHStore : public Store
const Setting<int> maxConnections{this, 1, "max-connections", "maximum number of concurrent SSH connections"};
const Setting<Path> sshKey{this, "", "ssh-key", "path to an SSH private key"};
const Setting<bool> compress{this, false, "compress", "whether to compress the connection"};
const Setting<Path> remoteProgram{this, "nix-store", "remote-program", "path to the nix-store executable on the remote system"};
const Setting<Path> 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<std::string> remoteStore{this, "", "remote-store", "URI of the store on the remote system"};

// Hack for getting remote build log output.
Expand Down
9 changes: 7 additions & 2 deletions src/libstore/ssh-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ class SSHStore : public RemoteStore

const Setting<Path> sshKey{(Store*) this, "", "ssh-key", "path to an SSH private key"};
const Setting<bool> compress{(Store*) this, false, "compress", "whether to compress the connection"};
const Setting<Path> remoteProgram{this, "nix-daemon", "remote-program", "path to the nix-daemon executable on the remote system"};
const Setting<std::string> remoteStore{this, "", "remote-store", "URI of the store on the remote system"};
const Setting<Path> 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<std::string> remoteStore{(Store *) this, "", "remote-store", "URI of the store on the remote system"};

SSHStore(const std::string & host, const Params & params)
: Store(params)
Expand Down

0 comments on commit 6d6502c

Please sign in to comment.