forked from LnL7/nix
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure we can construct remote store configs in isolation
Progress towards NixOS#10766 I thought that NixOS#10768 achieved, but when I went to use this stuff (in Hydra), turns out it did not. (Those `using FooConfig;` lines were not working --- they are so finicky!) This PR gets the job done, and adds some trivial unit tests to make sure I did what I intended. I had to add add a header to expose `SSHStoreConfig`, after which the preexisting `ssh-store-config.*` were very confusingly named files, so I renamed them to `common-ssh-store-config.hh` to match the type defined therein.
- Loading branch information
1 parent
9d7397c
commit 4b8204e
Showing
10 changed files
with
110 additions
and
25 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/libstore/ssh-store-config.cc → src/libstore/common-ssh-store-config.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
///@file | ||
|
||
#include "common-ssh-store-config.hh" | ||
#include "store-api.hh" | ||
#include "remote-store.hh" | ||
|
||
namespace nix { | ||
|
||
struct SSHStoreConfig : virtual RemoteStoreConfig, virtual CommonSSHStoreConfig | ||
{ | ||
using RemoteStoreConfig::RemoteStoreConfig; | ||
using CommonSSHStoreConfig::CommonSSHStoreConfig; | ||
|
||
SSHStoreConfig( | ||
std::string_view scheme, | ||
std::string_view host, | ||
const Params & params); | ||
|
||
const Setting<Strings> remoteProgram{this, {"nix-daemon"}, "remote-program", | ||
"Path to the `nix-daemon` executable on the remote machine."}; | ||
|
||
const std::string name() override { return "Experimental SSH Store"; } | ||
|
||
std::string doc() override; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include "legacy-ssh-store.hh" | ||
|
||
namespace nix { | ||
|
||
TEST(LegacySSHStore, constructConfig) | ||
{ | ||
LegacySSHStoreConfig{ | ||
"ssh", | ||
"localhost", | ||
{ | ||
{ | ||
"remote-program", | ||
{ | ||
"foo", | ||
"bar", | ||
}, | ||
}, | ||
}}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include "ssh-store.hh" | ||
|
||
namespace nix { | ||
|
||
TEST(SSHStore, constructConfig) | ||
{ | ||
SSHStoreConfig{ | ||
"ssh", | ||
"localhost", | ||
{ | ||
{ | ||
"remote-program", | ||
{ | ||
"foo", | ||
"bar", | ||
}, | ||
}, | ||
}}; | ||
} | ||
} |