summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-11-02 21:18:57 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2020-11-02 21:18:57 +0100
commit819b0f4bb864b21327672a5b9f2d94a75c312078 (patch)
tree3983013c232fa91f3731293b5c9a8b1695c57df1 /nixos/tests
parent92781c27bd16862e50f6e9b65a01d12d843cca59 (diff)
downloadnixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.tar
nixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.tar.gz
nixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.tar.bz2
nixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.tar.lz
nixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.tar.xz
nixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.tar.zst
nixpkgs-819b0f4bb864b21327672a5b9f2d94a75c312078.zip
nixos/initrd-network-ssh: fix test
The test relied on moving `initrd` secrets from the store into the
`initrd` which was fine here as it's only an integration test and not a
production environment.

However, this broke in 20.09 when support for this was dropped[1]. To make
sure that the snakeoil key used as hostkey for `sshd` here actually gets
copied into the VM, I added a small script for this that takes care of
this process while building the initial ramdisk.

[1] d930466b7728e5515991cb73c060fc3f32bdc001
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/initrd-network-ssh/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/tests/initrd-network-ssh/default.nix b/nixos/tests/initrd-network-ssh/default.nix
index 017de688208..0ad0563b0ce 100644
--- a/nixos/tests/initrd-network-ssh/default.nix
+++ b/nixos/tests/initrd-network-ssh/default.nix
@@ -22,6 +22,10 @@ import ../make-test-python.nix ({ lib, ... }:
             hostKeys = [ ./ssh_host_ed25519_key ];
           };
         };
+        boot.initrd.extraUtilsCommands = ''
+          mkdir -p $out/secrets/etc/ssh
+          cat "${./ssh_host_ed25519_key}" > $out/secrets/etc/ssh/sh_host_ed25519_key
+        '';
         boot.initrd.preLVMCommands = ''
           while true; do
             if [ -f fnord ]; then