mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-10-05 20:27:20 +03:00
test --disk-encryption-keys in sudo test
This commit is contained in:
parent
c20cb13ab8
commit
1d00a9babd
@ -6,7 +6,8 @@
|
||||
};
|
||||
testScript = ''
|
||||
start_all()
|
||||
installer.succeed("""
|
||||
installer.succeed("echo super-secret > /tmp/disk-encryption-key")
|
||||
output = installer.succeed("""
|
||||
eval $(ssh-agent)
|
||||
ssh-add /etc/sshKey
|
||||
${../nixos-remote} \
|
||||
@ -14,8 +15,14 @@
|
||||
--debug \
|
||||
--kexec /etc/nixos-remote/kexec-installer \
|
||||
--stop-after-disko \
|
||||
--disk-encryption-keys /tmp/disk-encryption-key \
|
||||
--store-paths /etc/nixos-remote/disko /etc/nixos-remote/system-to-install \
|
||||
nixos@installed >&2
|
||||
key=$(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
|
||||
root@installed cat /tmp/disk-encryption-key)
|
||||
echo "encryption key: '$key'"
|
||||
""")
|
||||
|
||||
assert "encryption key: 'super-secret'" in output, f"output does not contain expected values: {output}"
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user