mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Merge remote-tracking branch 'origin/master' into lfs
This commit is contained in:
commit
6d0043902a
251 changed files with 1001 additions and 5288 deletions
|
@ -37,7 +37,8 @@ in {
|
|||
{ config, pkgs, ... }:
|
||||
{ services.openssh.enable = true;
|
||||
services.openssh.settings.PermitRootLogin = "yes";
|
||||
users.users.root.password = "foobar";
|
||||
users.users.root.hashedPasswordFile = null;
|
||||
users.users.root.password = "foobar";
|
||||
virtualisation.writableStore = true;
|
||||
virtualisation.additionalPaths = [ pkgB pkgC ];
|
||||
};
|
||||
|
@ -64,7 +65,7 @@ in {
|
|||
# Copy the closure of package A from the client to the server using password authentication,
|
||||
# and check that all prompts are visible
|
||||
server.fail("nix-store --check-validity ${pkgA}")
|
||||
client.send_chars("nix copy --to ssh://server ${pkgA} >&2; echo done\n")
|
||||
client.send_chars("nix copy --to ssh://server ${pkgA} >&2; echo -n do; echo ne\n")
|
||||
client.wait_for_text("continue connecting")
|
||||
client.send_chars("yes\n")
|
||||
client.wait_for_text("Password:")
|
||||
|
|
|
@ -34,6 +34,8 @@ let
|
|||
}
|
||||
'';
|
||||
|
||||
supportsBadShell = lib.versionAtLeast config.nodes.client.nix.package.version "2.25pre";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -82,7 +84,7 @@ in
|
|||
nix.settings.substituters = lib.mkForce [ ];
|
||||
programs.ssh.extraConfig = "ConnectTimeout 30";
|
||||
environment.systemPackages = [
|
||||
# `bad-shell` is used to make sure Nix works an environment with a misbehaving shell.
|
||||
# `bad-shell` is used to make sure Nix works in an environment with a misbehaving shell.
|
||||
#
|
||||
# More realistically, a bad shell would still run the command ("echo started")
|
||||
# but considering that our solution is to avoid this shell (set via $SHELL), we
|
||||
|
@ -125,13 +127,15 @@ in
|
|||
'echo hello world on $(hostname)' >&2
|
||||
""")
|
||||
|
||||
${lib.optionalString supportsBadShell ''
|
||||
# Check that SSH uses SHELL for LocalCommand, as expected, and check that
|
||||
# our test setup here is working. The next test will use this bad SHELL.
|
||||
client.succeed(f"SHELL=$(which bad-shell) ssh -oLocalCommand='true' -oPermitLocalCommand=yes {builder1.name} 'echo hello world' | grep -F 'Hello, I am a broken shell'")
|
||||
''}
|
||||
|
||||
# Perform a build and check that it was performed on the builder.
|
||||
out = client.succeed(
|
||||
"SHELL=$(which bad-shell) nix-build ${expr nodes.client 1} 2> build-output",
|
||||
"${lib.optionalString supportsBadShell "SHELL=$(which bad-shell)"} nix-build ${expr nodes.client 1} 2> build-output",
|
||||
"grep -q Hello build-output"
|
||||
)
|
||||
builder1.succeed(f"test -e {out}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue