From 0104f7cc5c9fe8307fa52c78cf004c4ddc9e2189 Mon Sep 17 00:00:00 2001 From: Matej Habrnal Date: Dec 09 2015 10:38:18 +0000 Subject: p_abrt-cli: improve except - select workflow number dynamically Signed-off-by: Matej Habrnal --- diff --git a/tests/p_abrt-cli/_expect b/tests/p_abrt-cli/_expect index d1248c3..da5b382 100755 --- a/tests/p_abrt-cli/_expect +++ b/tests/p_abrt-cli/_expect @@ -5,6 +5,7 @@ set dir [lindex $argv 0] spawn abrt-cli report $dir set timeout 10 +set workflow_no 3 # timeout handler proc itstime {args} { @@ -19,6 +20,10 @@ while {1} { 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" } @@ -38,7 +43,7 @@ while {1} { send "\n" } "Select a workflow to run" { - send "3\n" + send "$workflow_no\n" } } } diff --git a/tests/p_abrt-cli/_expect_report b/tests/p_abrt-cli/_expect_report index e144634..423dd3e 100755 --- a/tests/p_abrt-cli/_expect_report +++ b/tests/p_abrt-cli/_expect_report @@ -5,6 +5,7 @@ set dir [lindex $argv 0] spawn report-cli -e report_CentOSBugTracker $dir set timeout 100 +set workflow_no 3 # timeout handler proc itstime {args} { @@ -19,6 +20,10 @@ while {1} { 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" } @@ -35,7 +40,7 @@ while {1} { send "aaa\n" } "Select a workflow to run" { - send "3\n" + send "$workflow_no\n" } } }