mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 22:12:43 +01:00
libstore: Correct getUri methods for all stores
Previously `getUri` didn't include store query parameters, `ssh-ng` didn't include any information at all and the local store didn't have the path: ``` $ nix store info --store "local?root=/tmp/aaa&require-sigs=false" Store URL: local Version: 2.31.0 Trusted: 1 $ nix store info --store "ssh-ng://localhost?remote-program=nix-daemon" Store URL: ssh-ng:// Version: 2.31.0 Trusted: 1 $ nix store info --store "ssh://localhost?remote-program=nix-store" Store URL: ssh://localhost ``` This commit changes this to: ``` $ nix store info --store "local?root=/tmp/aaa&require-sigs=false" Store URL: local?require-sigs=false&root=/tmp/aaa Version: 2.31.0 Trusted: 1 $ nix store info --store "ssh-ng://localhost?remote-program=nix-daemon" Store URL: ssh-ng://localhost?remote-program=nix-daemon Version: 2.31.0 Trusted: 1 $ nix store info --store "ssh://localhost?remote-program=nix-store" Store URL: ssh://localhost?remote-program=nix-store ```
This commit is contained in:
parent
73ebdf2497
commit
41af531392
7 changed files with 58 additions and 16 deletions
|
|
@ -6,21 +6,27 @@ namespace nix {
|
|||
|
||||
TEST(LegacySSHStore, constructConfig)
|
||||
{
|
||||
LegacySSHStoreConfig config{
|
||||
initLibStore(/*loadConfig=*/false);
|
||||
|
||||
auto config = make_ref<LegacySSHStoreConfig>(
|
||||
"ssh",
|
||||
"localhost",
|
||||
"me@localhost:2222",
|
||||
StoreConfig::Params{
|
||||
{
|
||||
"remote-program",
|
||||
// TODO #11106, no more split on space
|
||||
"foo bar",
|
||||
},
|
||||
}};
|
||||
});
|
||||
|
||||
EXPECT_EQ(
|
||||
config.remoteProgram.get(),
|
||||
config->remoteProgram.get(),
|
||||
(Strings{
|
||||
"foo",
|
||||
"bar",
|
||||
}));
|
||||
|
||||
auto store = config->openStore();
|
||||
EXPECT_EQ(store->getUri(), "ssh://me@localhost:2222?remote-program=foo%20bar");
|
||||
}
|
||||
} // namespace nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue