mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 05:53:28 +01:00
tests/interactive-cryptsetup: make waiting for passphrase more robust
This commit is contained in:
1 parent
21b2de0a20
commit
6bfa3a18d4
2 files changed
+9
-4
No files matched your search
@@ -54,6 +54,7 @@ let
|
|||||||
, postDisko ? ""
|
, postDisko ? ""
|
||||||
, testMode ? "module" # can be one of direct module cli
|
, testMode ? "module" # can be one of direct module cli
|
||||||
, testBoot ? true # if we actually want to test booting or just create/mount
|
, testBoot ? true # if we actually want to test booting or just create/mount
|
||||||
|
, enableOCR ? false
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
makeTest' = args:
|
makeTest' = args:
|
||||||
@@ -163,6 +164,8 @@ let
|
|||||||
in
|
in
|
||||||
makeTest' {
|
makeTest' {
|
||||||
name = "disko-${name}";
|
name = "disko-${name}";
|
||||||
|
meta.timeout = 600; # 10 minutes
|
||||||
|
inherit enableOCR;
|
||||||
|
|
||||||
nodes.machine = { pkgs, ... }: {
|
nodes.machine = { pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
{ pkgs ? import <nixpkgs> { }
|
{
|
||||||
, diskoLib ? pkgs.callPackage ../lib { }
|
pkgs ? import <nixpkgs> { },
|
||||||
|
diskoLib ? pkgs.callPackage ../lib { },
|
||||||
}:
|
}:
|
||||||
diskoLib.testLib.makeDiskoTest {
|
diskoLib.testLib.makeDiskoTest {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
name = "luks-interactive-login";
|
name = "luks-interactive-login";
|
||||||
disko-config = ../example/luks-interactive-login.nix;
|
disko-config = ../example/luks-interactive-login.nix;
|
||||||
|
enableOCR = true;
|
||||||
extraTestScript = ''
|
extraTestScript = ''
|
||||||
machine.succeed("cryptsetup isLuks /dev/vda2");
|
machine.succeed("cryptsetup isLuks /dev/vda2");
|
||||||
'';
|
'';
|
||||||
bootCommands = ''
|
bootCommands = ''
|
||||||
machine.wait_for_console_text("vda")
|
machine.wait_for_text("[Pp]assphrase for")
|
||||||
machine.send_console("secretsecret\n")
|
machine.send_chars("secretsecret\n")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user