treesls/artificial_evaluation/applications/ycsb.exp

70 lines
1.9 KiB
Plaintext
Executable File

#!/usr/bin/expect -f
source ../config.exp
set timeout 120
set mode [lindex $argv 0]
if {$test_mode == "QEMU"} {
spawn -noecho rm [exec sh -c {echo "/tmp/nvm-file-$USER"}]
spawn $basedir/build/simulate.sh
expect "Welcome to ChCore shell!"
} elseif {$test_mode == "IPMI"} {
while {1} {
spawn ipmitool -H $ipmi_ip -U $username -P $passwd -I lanplus sol activate
expect {
"SOL Session operational" {
puts "ipmi connected"
send -- "shutdown.bin \r"
expect {
"Welcome to ChCore shell!" { break }
"No such binary" { continue }
timeout {
spawn ipmitool -H $ipmi_ip -U $username -P $passwd -I lanplus sol deactivate
continue
}
}
}
"SOL payload already active on another session" {
spawn ipmitool -H $ipmi_ip -U $username -P $passwd -I lanplus sol deactivate
continue
}
timeout {
puts "ipmitool failed"
exit
}
}
}
} else {
puts "Currently, we only support IPMI and QEMU mode!"
}
set mode [lindex $argv 0]
set workload [lindex $argv 1]
set threads [lindex $argv 2]
# Start the redis server
send -- "redis-server --save \"\" -h 127.0.0.1 &\r"
expect "poll fd server is not lwip"
send -- "set_poll_loop_time.bin -n $threads &\r"
expect "Launching /set_poll_loop_time.bin"
# ckpt mode: taking checkpoint while running
if {$mode == "ckpt"} {
send -- "checkpoint.bin -i %1 -l 0 -a 9 &\r"
expect "Launching /checkpoint.bin"
}
sleep 5
# Start the YCSB benchmark
set timeout 1200
send -- "ycsbc -db redis -threads $threads -P workload$workload.spec -host 127.0.0.1 -port 6379 -slaves 0 &\r"
expect "Launching"
expect "Transaction throughput (KTPS)"
expect "redis"
sleep 5