summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorDavid Smith <dsmith@redhat.com>2009-10-22 09:03:44 -0500
committerDavid Smith <dsmith@redhat.com>2009-10-22 09:03:44 -0500
commit712d12ca4c74b824e7afbb273c0975eb0a30847c (patch)
tree115fb4d565414a0ec082cd1de1eda34e34bc3341 /testsuite
parent991bd3ba708b467a6b1de0788e0e1e558a087b0d (diff)
downloadsystemtap-steved-712d12ca4c74b824e7afbb273c0975eb0a30847c.tar.gz
systemtap-steved-712d12ca4c74b824e7afbb273c0975eb0a30847c.tar.xz
systemtap-steved-712d12ca4c74b824e7afbb273c0975eb0a30847c.zip
PR 10822 fixed by waiting for the procfs file.
* testsuite/systemtap.base/onoffprobe.exp: Wait for up to 10 seconds for the procfs file to be created.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/systemtap.base/onoffprobe.exp20
1 files changed, 19 insertions, 1 deletions
diff --git a/testsuite/systemtap.base/onoffprobe.exp b/testsuite/systemtap.base/onoffprobe.exp
index 1b39dab5..c6d83d5d 100644
--- a/testsuite/systemtap.base/onoffprobe.exp
+++ b/testsuite/systemtap.base/onoffprobe.exp
@@ -10,9 +10,27 @@ proc advance {} {
global expect_out
global ok
global modname
+ set procfs_file "/proc/systemtap/$modname/switch"
+
pass "$test $expect_out(1,string)"
+
+ # If this is the first time, wait until the procfs file exists
+ # (for up to 10 seconds).
+ if {$ok == 0} {
+ set i 0
+ while {![file exists $procfs_file]} {
+ sleep 1
+ incr i
+ if {$i >= 10} { break }
+ }
+ # If the procfs file still doesn't exist, fail.
+ if {![file exists $procfs_file]} {
+ fail "$test (missing procfs file)"
+ }
+ }
+
incr ok
- exec echo $ok > /proc/systemtap/$modname/switch
+ if {[file exists $procfs_file]} { exec echo $ok > $procfs_file }
exec echo dummy > /dev/null
exp_continue
}