Skip to content

Commit

Permalink
Do not add keyboard password to fido2 test asset
Browse files Browse the repository at this point in the history
It simplifies the test a little bit and avoids flooding console with
"Enter password" prompts.
  • Loading branch information
anatol committed Oct 30, 2021
1 parent ba4baa0 commit 2e5f782
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions tests/generate_asset_systemd_fido2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ sudo mount /dev/mapper/$LUKS_DEV_NAME $dir
sudo chown $USER $dir
mkdir $dir/sbin
cp assets/init $dir/sbin/init

sudo cryptsetup -v luksKillSlot $lodev 0
5 changes: 1 addition & 4 deletions tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,17 +885,14 @@ func TestBooster(t *testing.T) {
checkVMState: func(vm *vmtest.Qemu, t *testing.T) {
pin := "1111"
// there can be multiple Yubikeys, iterate over all "Enter PIN" requests
re, err := regexp.Compile(`(Enter PIN for /dev/hidraw|Hello, booster!|Enter passphrase for luks-b12cbfef-da87-429f-ac96-7dda7232c189:)`)
re, err := regexp.Compile(`(Enter PIN for /dev/hidraw|Hello, booster!)`)
require.NoError(t, err)
loop:
for {
matches, err := vm.ConsoleExpectRE(re)
require.NoError(t, err)

switch matches[0] {
case "Enter passphrase for luks-b12cbfef-da87-429f-ac96-7dda7232c189:":
require.NoError(t, vm.ConsoleWrite("fakepassword\n")) // print something to make this prompt go away
continue loop
case "Enter PIN for /dev/hidraw":
require.NoError(t, vm.ConsoleWrite(pin+"\n"))
case "Hello, booster!":
Expand Down

0 comments on commit 2e5f782

Please sign in to comment.