]> sourceware.org Git - systemtap.git/commitdiff
testsuite wakeup.*:
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 29 Sep 2015 15:14:13 +0000 (11:14 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 29 Sep 2015 15:14:13 +0000 (11:14 -0400)
On a rawhide smp box, it was possible to see corrupted lines of text
from this test's multiple concurrent outputs, and thus lose counts.
The strings are revised, and exit timing managed mroe carefully,
to make the run more repeatable.

testsuite/systemtap.base/wakeup.exp
testsuite/systemtap.base/wakeup.stp

index 19cc56c5ff3949f79bf629997859162268e84ff4..5be83fad7aae24ad719e2cd19798a3825db0d80d 100644 (file)
@@ -4,7 +4,7 @@ if {![installtest_p]} {untested $test; return}
 
 # There have been issues with kernel probes put into the wake_up path.
 # see http://sourceware.org/ml/systemtap/2011-q3/msg00163.html
-spawn stap -DMAXERRORS=8 $srcdir/$subdir/$test.stp -c {ls -laR /dev/* /proc/* > /dev/null 2>&1}
+spawn stap -DMAXERRORS=999 $srcdir/$subdir/$test.stp -c {ls -laR /dev/* /proc/* > /dev/null 2>&1}
 set systems 0
 set warns 0
 set errors 0
@@ -12,13 +12,13 @@ set prints 0
 expect {
     -timeout 180
     -re {^sleeping\r\n} { incr systems; exp_continue }
-    -re {^WARNING: wake_up\r\n} { incr warns; exp_continue }
-    -re {^ERROR: wake_down\r\n} { incr errors; exp_continue }
+    -re {^WARNING:[^\r\n]*\r\n} { incr warns; exp_continue }
+    -re {^ERROR:[^\r\n]*\r\n} { incr errors; exp_continue }
     -re {^count: 25\r\n} { incr prints; exp_continue }
     timeout { fail "$test (timeout)" }
     eof { }
 }
 wait
 
-# WARNINGs get collapsed, so only 1 expected.
-if {$systems == 8 && $warns == 1 && $errors == 8 && $prints == 1} { pass "$test" } { fail "$test ($systems,$warns,$errors,$prints)" }
+# WARNINGs get collapsed, so only 1 expected ... plus the three from staprun re. the ERROR exits.
+if {$systems == 8 && $warns == 4 && $errors == 8 && $prints == 1} { pass "$test" } { fail "$test ($systems,$warns,$errors,$prints)" }
index 253e5de78d14996e19edcfe89c280da17bf0f2da..66fbca9e6de493eaed1841d9eaa0782e11c46ea5 100644 (file)
@@ -1,13 +1,21 @@
 global count;
-probe kernel.function("__wake_up_common")
+global testing = 1
+probe kernel.function("__wake_up_common") if (testing)
 {
   count++
   if (count <= 8)
-    { system("echo sleeping") }
+    { system("echo sleeping") } /* NB: these are enqueued */
   else if (count <= 16)
-    { warn("wake_up") }
+    { warn("") } // using empty strings to avoid interjection of other strings in middle
   else if (count <= 24)
-    { error("wake_down") }
-  else
-    { printf("count: %d\n", count); exit() }
+    { error("") } // ditto
+  else // 25
+    {
+      printf("count: %d\n", count)
+      testing = 0
+    }
+}
+
+probe timer.s(10) { /* hoping that all the above activity is all done now */
+    exit()
 }
This page took 0.0328 seconds and 5 git commands to generate.