Skip to content

Commit a917317

Browse files
committed
improve expect script
1 parent 3b2dd55 commit a917317

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

execute.exp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/expect -f
2+
3+
spawn bash -c "cd poky && source oe-init-build-env && runqemu qemuarm nographic"
4+
5+
set timeout 60
6+
7+
expect {
8+
-re ".*login: " {
9+
send "root\r"
10+
}
11+
timeout {
12+
puts "ERROR: Login prompt not received"
13+
exit 1
14+
}
15+
}
16+
17+
expect {
18+
-re {root@.*# } {
19+
# got shell prompt after login
20+
}
21+
timeout {
22+
puts "ERROR: Timeout waiting for root shell prompt after login"
23+
exit 1
24+
}
25+
}
26+
27+
send "hello-world\r"
28+
29+
expect {
30+
-re {root@.*# } {
31+
# got shell prompt after command
32+
}
33+
timeout {
34+
puts "ERROR: Timeout waiting for shell prompt after command"
35+
exit 1
36+
}
37+
}
38+
39+
# Optional: interact to keep session open
40+
#interact
41+

execute.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)