t2sde/tests/951-iso-initrd.exp
René Rebe 307cadbae9 * imported unit tests from int repo
git-svn-id: https://svn.exactcode.de/t2/trunk@69305 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
2024-06-04 14:42:09 +00:00

55 lines
825 B
Plaintext

#!/usr/bin/expect -f
set qemu [lindex $argv 0]
set argv [lreplace $argv 0 0]
# Wait enough (forever) until a long-time boot
set timeout 30
#timeout {exit 1}
# Start the guest VM
spawn $qemu -nographic {*}$argv
# TODO: detect grub and send \n to avoid delay
if { [string match "*-*86*" $qemu] } {
expect {
timeout {exit 1}
"*GNU GRUB*"
}
set send_slow {3 .1}
# edit grub entry w/ arrow key escapes and C-x
send "e"
send -s "\033\[B\033\[B\033\[B\033\[D"
#after 10
send -s " console=ttyS0\030"
}
set send_slow {8 .1}
expect {
timeout {exit 1}
"T2 SDE installer first stage*"
}
expect {
timeout {exit 1}
"* hit enter otherwise. (default:*"
}
send "\n"
expect {
timeout {exit 1}
"install:/#"
}
send "echo o > /proc/sysrq-trigger\n"
expect {
timeout {exit 1}
"reboot: Power down"
}