diff --git a/lix/nix/daemon.cc b/lix/nix/daemon.cc index 41cd23f9a..cb5be6784 100644 --- a/lix/nix/daemon.cc +++ b/lix/nix/daemon.cc @@ -225,12 +225,12 @@ static PeerInfo getPeerInfo(int remote) /** * Open a store without a path info cache. */ -static kj::Promise>> openUncachedStore() +static kj::Promise>> openUncachedStore(AllowDaemon allowDaemon = AllowDaemon::Allow) try { StoreConfig::Params params; // FIXME: get params from somewhere // Disable caching since the client already does that. params["path-info-cache-size"] = "0"; - co_return TRY_AWAIT(openStore(settings.storeUri, params, AllowDaemon::Disallow)); + co_return TRY_AWAIT(openStore(settings.storeUri, params, allowDaemon)); } catch (...) { co_return result::current_exception(); } @@ -369,7 +369,7 @@ static void daemonLoopImpl(std::optional forceTrustClientOpt) FdSource from(remote.get()); FdSink to(remote.get()); processConnection( - aio, aio.blockOn(openUncachedStore()), from, to, trusted + aio, aio.blockOn(openUncachedStore(AllowDaemon::Disallow)), from, to, trusted ); exit(0); diff --git a/tests/nixos/default.nix b/tests/nixos/default.nix index 9539249b5..6c40531bf 100644 --- a/tests/nixos/default.nix +++ b/tests/nixos/default.nix @@ -122,8 +122,6 @@ in }; }; sshUser = "test-user"; - # FIXME: - expectSuccess = false; }; # Test our Nix as a client against remotes that are older diff --git a/tests/nixos/remote-builds-ssh-ng.nix b/tests/nixos/remote-builds-ssh-ng.nix index e2a40b5d0..d60446c7f 100644 --- a/tests/nixos/remote-builds-ssh-ng.nix +++ b/tests/nixos/remote-builds-ssh-ng.nix @@ -44,14 +44,6 @@ in ''; default = "root"; }; - - expectSuccess = lib.mkOption { - type = lib.types.bool; - description = '' - Whether to expect the remote build to succeed or not. - ''; - default = true; - }; }; config = { @@ -123,9 +115,8 @@ in client.succeed(f"ssh -o StrictHostKeyChecking=no {ssh_user}@{builder.name} 'echo hello world' >&2") # Perform a build - out = client.${if test.config.expectSuccess then "succeed" else "fail"}("nix-build ${expr nodes.client 1} 2> build-output") + out = client.succeed("nix-build ${expr nodes.client 1} 2> build-output") - '' + lib.optionalString test.config.expectSuccess '' # Verify that the build was done on the builder builder.succeed(f"test -e {out.strip()}")