#!/usr/bin/expect -f
set dir [lindex $argv 0]
spawn report-cli -e report_CentOSBugTracker $dir
set timeout 100
set workflow_no 3
# timeout handler
proc itstime {args} {
puts "!! expect timeout !!"
exit 1
}
while {1} {
expect {
eof {break}
timeout { itstime }
-regexp {[[:space:]]+([[:digit:]]+)[[:space:]]+Report to CentOS Bug Tracker} {
set workflow_no $expect_out(1,string)
}
"Ok to upload core dump? (It may contain sensitive data)." {
send "N\n"
}
"This problem was already reported to CentOS Bug Tracker" {
send "y\n"
}
-re "Downloading.*Continue?.*" {
send "N\n"
}
"CentOS Bug Tracker Password" {
send "aaa\n"
}
"CentOS Bug Tracker User name" {
send "aaa\n"
}
"Select a workflow to run" {
send "$workflow_no\n"
}
}
}