fix: noconfirm auto-selects first AUR match
This commit is contained in:
@@ -83,18 +83,39 @@ expect <<EOF
|
||||
log_user 1
|
||||
set timeout 240
|
||||
spawn qemu-system-x86_64 -name {Red Bear Greeter Validation} -device qemu-xhci -smp 4 -m 2048 -bios $firmware -chardev stdio,id=debug,signal=off,mux=on -serial chardev:debug -mon chardev=debug -machine q35 -device ich9-intel-hda -device hda-output -device virtio-net,netdev=net0 -netdev user,id=net0 -vga none -device virtio-gpu -drive file=$image,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL -enable-kvm -cpu host
|
||||
expect "login:"
|
||||
|
||||
proc expect_or_fail {pattern description} {
|
||||
expect {
|
||||
-nocase -re \$pattern { return }
|
||||
timeout {
|
||||
puts stderr "ERROR: timed out waiting for \$description"
|
||||
exit 1
|
||||
}
|
||||
eof {
|
||||
puts stderr "ERROR: QEMU exited while waiting for \$description"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expect_or_fail {login:} {login prompt}
|
||||
send "root\r"
|
||||
expect "assword:"
|
||||
expect_or_fail {assword:} {password prompt}
|
||||
send "password\r"
|
||||
expect "Type 'help' for available commands."
|
||||
expect_or_fail {Type 'help' for available commands\.} {shell startup banner}
|
||||
send "redbear-greeter-check\r"
|
||||
expect "Red Bear Greeter Runtime Check"
|
||||
expect "GREETER_HELLO=ok"
|
||||
expect_or_fail {Red Bear Greeter Runtime Check} {greeter check banner}
|
||||
expect_or_fail {GREETER_HELLO=ok} {greeter hello marker}
|
||||
send "redbear-greeter-check --invalid root wrong\r"
|
||||
expect "GREETER_INVALID=ok"
|
||||
expect_or_fail {GREETER_INVALID=ok} {invalid-login marker}
|
||||
send "redbear-greeter-check --valid root password\r"
|
||||
expect "GREETER_VALID=ok"
|
||||
expect_or_fail {GREETER_VALID=ok} {valid-login marker}
|
||||
send "shutdown\r"
|
||||
expect eof
|
||||
expect {
|
||||
eof { exit 0 }
|
||||
timeout {
|
||||
puts stderr "ERROR: timed out waiting for QEMU shutdown"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user