|
16 | 16 | };
|
17 | 17 | testScript = ''
|
18 | 18 | start_all()
|
| 19 | + installer.fail("test -f /tmp/hw/config.nix") |
19 | 20 | installer.succeed("echo super-secret > /tmp/disk-1.key")
|
20 | 21 | output = installer.succeed("""
|
21 | 22 | nixos-anywhere \
|
|
25 | 26 | --disk-encryption-keys /tmp/disk-1.key /tmp/disk-1.key \
|
26 | 27 | --disk-encryption-keys /tmp/disk-2.key <(echo another-secret) \
|
27 | 28 | --phases kexec,disko \
|
28 |
| - --generate-hardware-config nixos-generate-config /tmp/config.nix \ |
| 29 | + --generate-hardware-config nixos-generate-config /tmp/hw/config.nix \ |
29 | 30 | --store-paths /etc/nixos-anywhere/disko /etc/nixos-anywhere/system-to-install \
|
30 | 31 | root@installed >&2
|
31 | 32 | echo "disk-1.key: '$(ssh -i /root/.ssh/install_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
|
|
34 | 35 | root@installed cat /tmp/disk-2.key)'"
|
35 | 36 | """)
|
36 | 37 |
|
37 |
| - installer.succeed("cat /tmp/config.nix >&2") |
38 |
| - installer.succeed("nix-instantiate --parse /tmp/config.nix") |
| 38 | + installer.succeed("cat /tmp/hw/config.nix >&2") |
| 39 | + installer.succeed("nix-instantiate --parse /tmp/hw/config.nix") |
39 | 40 |
|
40 | 41 | assert "disk-1.key: 'super-secret'" in output, f"output does not contain expected values: {output}"
|
41 | 42 | assert "disk-2.key: 'another-secret'" in output, f"output does not contain expected values: {output}"
|
42 | 43 |
|
| 44 | + installer.fail("test -f /test/hw/config.json") |
| 45 | +
|
43 | 46 | output = installer.succeed("""
|
44 | 47 | nixos-anywhere \
|
45 | 48 | -i /root/.ssh/install_key \
|
|
48 | 51 | --disk-encryption-keys /tmp/disk-1.key /tmp/disk-1.key \
|
49 | 52 | --disk-encryption-keys /tmp/disk-2.key <(echo another-secret) \
|
50 | 53 | --phases kexec,disko \
|
51 |
| - --generate-hardware-config nixos-facter /tmp/config.json \ |
| 54 | + --generate-hardware-config nixos-facter /tmp/hw/config.json \ |
52 | 55 | --store-paths /etc/nixos-anywhere/disko /etc/nixos-anywhere/system-to-install \
|
53 | 56 | installed >&2
|
54 | 57 | echo "disk-1.key: '$(ssh -i /root/.ssh/install_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
|
|
57 | 60 | root@installed cat /tmp/disk-2.key)'"
|
58 | 61 | """)
|
59 | 62 |
|
60 |
| - installer.succeed("cat /tmp/config.json >&2") |
61 |
| - installer.succeed("jq < /tmp/config.json") |
| 63 | + installer.succeed("cat /tmp/hw/config.json >&2") |
| 64 | + installer.succeed("jq < /tmp/hw/config.json") |
62 | 65 |
|
63 | 66 | assert "disk-1.key: 'super-secret'" in output, f"output does not contain expected values: {output}"
|
64 | 67 | assert "disk-2.key: 'another-secret'" in output, f"output does not contain expected values: {output}"
|
|
0 commit comments