File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 22
22
start_all()
23
23
installer.succeed("mkdir -p /tmp/extra-files/var/lib/secrets")
24
24
installer.succeed("echo value > /tmp/extra-files/var/lib/secrets/key")
25
+ ssh_key_path = "/etc/ssh/ssh_host_ed25519_key.pub"
26
+ ssh_key_output = installer.wait_until_succeeds(f"""
27
+ ssh -i /root/.ssh/install_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
28
+ root@installed cat {ssh_key_path}
29
+ """)
25
30
installer.succeed("""
26
31
nixos-anywhere \
27
32
-i /root/.ssh/install_key \
43
48
assert "nixos-anywhere" == hostname, f"'nixos-anywhere' != '{hostname}'"
44
49
content = new_machine.succeed("cat /var/lib/secrets/key").strip()
45
50
assert "value" == content, f"secret does not have expected value: {content}"
51
+ ssh_key_content = new_machine.succeed(f"cat {ssh_key_path}").strip()
52
+ assert ssh_key_content in ssh_key_output, "SSH host identity changed"
46
53
'' ;
47
54
}
You can’t perform that action at this time.
0 commit comments