File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 2525 type = "luks" ;
2626 name = "crypted" ;
2727 # disable settings.keyFile if you want to use interactive password entry
28- #passwordFile = "/tmp/secret.key"; # Interactive
28+ # passwordFile = "/tmp/secret.key"; # Interactive
2929 settings = {
3030 allowDiscards = true ;
3131 keyFile = "/tmp/secret.key" ;
Original file line number Diff line number Diff line change 2222 type = "luks" ;
2323 name = "crypted" ;
2424 settings . allowDiscards = true ;
25- passwordFile = "/tmp/secret.key" ;
2625 content = {
2726 type = "filesystem" ;
2827 format = "ext4" ;
3534 } ;
3635 } ;
3736 } ;
37+
38+ # If we don't set passwordFile above, we will be interactively prompted by the
39+ # disko script to set the LUKS password. However, as passwordFile is necessary
40+ # for installTest we set it here.
41+ disko . tests . extraDiskoConfig = {
42+ devices . disk . vdb . content . partitions . luks . content . passwordFile = "/tmp/secret.key" ;
43+ } ;
3844}
Original file line number Diff line number Diff line change 11{ pkgs ? import <nixpkgs> { }
22, diskoLib ? pkgs . callPackage ../lib { }
33} :
4- diskoLib . testLib . makeDiskoTest {
4+ diskoLib . testLib . makeDiskoTest ( let
5+ disko-config = import ../example/luks-interactive-login.nix ;
6+ in {
57 inherit pkgs ;
68 name = "luks-interactive-login" ;
7- disko-config = ../example/luks-interactive-login.nix ;
9+ inherit disko-config ;
10+ inherit ( disko-config . disko . tests ) extraDiskoConfig ;
811 extraTestScript = ''
912 machine.succeed("cryptsetup isLuks /dev/vda2");
1013 '' ;
1114 bootCommands = ''
1215 machine.wait_for_console_text("vda")
1316 machine.send_console("secretsecret\n")
1417 '' ;
15- }
18+ } )
You can’t perform that action at this time.
0 commit comments