-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-tests.exp
64 lines (52 loc) · 1.36 KB
/
run-tests.exp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/expect -f
set guest [lindex $argv 0]
set port [lindex $argv 1]
spawn telnet localhost $port
set exit_code 0
source logging.exp
set timeout 180
set first_run 1
# You may want lower values here on less powerful systems (like models)
set hackbench_groups 200
set hackbench_loops 100
send "\r"
expect {
timeout {
report_fail 1 "Not seeing login prompt or incorrect username/password"
}
"Last login:" { exp_continue }
"login:" { send "root\n"; exp_continue }
"Password:" { send "kvm\n"; exp_continue }
"root@*:*# $" {
send "./hackbench $hackbench_groups process $hackbench_loops\n"
expect {
timeout { report_fail 2 "Did not see hackbench finish. Error." }
"./hackbench: No such file or directory" {
send "halt -p\n"
report_fail 3 "Missing hackbench in guest filesystem"
}
"error" {
send "halt -p\n"
report_fail 4 "Error executing hackbench. Too many processes?"
}
"Running with" { exp_continue }
"Time:*\n" { exp_continue }
"root@*:*#"
}
status_output "hackbench successfully completed"
send "cyclictest -t `nproc` -l 10000 -q\n"
expect {
timeout { report_fail 6 "Never saw prompt after cyclictest" }
"root@*:*#"
}
status_output "cyclictest successfully completed"
if { $first_run == 1 } {
set first_run 0
send "reboot\n"
exp_continue
} else {
send "halt -p\n"
}
}
}
exit $exit_code