* hotfix rapdijson for gcc14
[t2sde.git] / tests / 921-inst-kexec.exp
blob686c57c99f83edfaf5bf5f48c84f999533722646
1 #!/usr/bin/expect -f
3 set qemu [lindex $argv 0]
4 set kernel [lindex $argv 1]
5 set initrd [lindex $argv 2]
6 set append [lindex $argv 3]
7 set argv [lreplace $argv 0 3]
9 # Wait enough (forever) until a long-time boot
10 set timeout 45
11 #timeout {exit 1}
12 set send_slow {8 .1}
14 # Start the guest VM
15 spawn $qemu -kernel $kernel -initrd $initrd -nographic -append "$append" {*}$argv
17 expect {
18 timeout {exit 1}
19 "T2 SDE installer first stage*"
22 expect {
23 timeout {exit 1}
24 "* hit enter otherwise. (default:*"
27 send "\n"
28 expect {
29 timeout {exit 1}
30 "install:/#"
34 send "mount \$ROCK_INSTALL_SOURCE_DEV /media\n"
35 expect {
36 timeout {exit 1}
37 "*mounted read-only*"
40 send "kernel=$kernel initrd=$initrd\n"
41 send "kexec -l /media/boot/\${kernel##*/} --initrd=/media/boot/\${initrd##*/} --command-line=\$(< /proc/cmdline)\n"
42 send "\[ \$? != 0 \] && echo FA''IL\n"
43 send "kexec -e\n"
46 set timeout 20
48 expect {
49 timeout {exit 1}
50 "FAIL" {exit 1}
51 "Nothing has been loaded" {exit 1}
52 "T2 SDE installer first stage*"
55 set timeout 45
58 expect {
59 timeout {exit 1}
60 "* hit enter otherwise. (default:*"
63 send "\n"
64 expect {
65 timeout {exit 1}
66 "install:/#"
70 send "echo o > /proc/sysrq-trigger\n"
71 expect {
72 timeout {exit 1}
73 "reboot: Power down"