diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-06-26 16:36:58 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-06-26 16:36:58 +0200 |
commit | f0d57904d70d912ca3fc82eeaaacccdac0307a87 (patch) | |
tree | 72885a25ea15c152c1cc64533ad09b514cde25f7 /testsuite/systemtap.base/strftime.exp | |
parent | c65358e84b38bc84951a4e3c5e8e4f3cace9f63e (diff) | |
download | systemtap-steved-f0d57904d70d912ca3fc82eeaaacccdac0307a87.tar.gz systemtap-steved-f0d57904d70d912ca3fc82eeaaacccdac0307a87.tar.xz systemtap-steved-f0d57904d70d912ca3fc82eeaaacccdac0307a87.zip |
PR10335 systemtap.base/strftime.exp hangs.
This only happened if there was a lot of cruft in the testsuite dir since
expect wasn't "draining" the output of the spawned ls command for some
reason. Work around it by just using tcl file globs to match.
* testsuite/systemtap.base/strftime.exp: Test with glob and file exists.
Diffstat (limited to 'testsuite/systemtap.base/strftime.exp')
-rw-r--r-- | testsuite/systemtap.base/strftime.exp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/testsuite/systemtap.base/strftime.exp b/testsuite/systemtap.base/strftime.exp index ad9e471d..decd7a65 100644 --- a/testsuite/systemtap.base/strftime.exp +++ b/testsuite/systemtap.base/strftime.exp @@ -7,15 +7,9 @@ system "rm -f %*" set format %%%S_%T exec stap -o $format -we {probe begin {println("hello");exit()}} -spawn ls -1 -set ok 0 -expect { - -re {%([0-9][0-9])_[0-9][0-9]:[0-9][0-9]:\1} {incr ok} - eof { } -} -wait +set file [glob -nocomplain -types f %\[0-9\]\[0-9\]_\[0-9\]\[0-9\]:\[0-9\]\[0-9\]:\[0-9\]\[0-9\]] -if {$ok == 1} { +if {[llength $file] == 1} { pass "$test (%S and %T)" } else { fail "$test (%S and %T)" @@ -27,19 +21,8 @@ set format %%,%C,%Y,%y,%m,%d,%e,%F,%H,%I,%j,%k,%l,%M,%R,%u,%w set date1 [exec date +$format] # run stapio with strftime exec stap -o $format -we {probe begin {println("hello");exit()}} -# check whether stap outputs stapio pid -set date2 [exec date +$format] - -spawn ls -1 -set ok 0 -expect { - $date1 {incr ok} - $date2 {incr ok} - eof { } -} -wait -if {$ok == 1} { +if {[file exists $date1]} { pass "$test (except %S and %T)" } else { fail "$test (except %S and %T)" |