]> sourceware.org Git - systemtap.git/commitdiff
PR 6930: fix flightrec2.exp to handle filesize correctly
authorMasami Hiramatsu <mhiramat@redhat.com>
Tue, 28 Apr 2009 15:18:06 +0000 (11:18 -0400)
committerMasami Hiramatsu <mhiramat@redhat.com>
Tue, 28 Apr 2009 15:18:06 +0000 (11:18 -0400)
* testsuite/systemtap.base/flightrec2.exp: Use stat instead of ls for checking
  file size.
* testsuite/systemtap.base/flightrec2.stp: Increase timer interval for some
  architecture on which the minimum interval is more than 1 ms (e.g. xen)

testsuite/systemtap.base/flightrec2.exp
testsuite/systemtap.base/flightrec2.stp

index a22ef41575e1ae810b438c2f45ecd140610ec356..d4481db4ebbaa67e8b4bacc15ab97ef1d90f70bd 100644 (file)
@@ -26,13 +26,12 @@ exec sleep 4
 set scnt 0
 set cnt1 0
 # wait for log files
-spawn ls -sk1
+eval spawn stat -c %s [glob flightlog.out.*]
 expect {
   -timeout 100
-  -re {([0-9]+) flightlog\.out\.[0-9]+} {
+  -re {[0-9]+} {
       incr cnt1;
-      if {$expect_out(1,string) <= 1028} {incr scnt}
-      # 1024 + 4(for inode blocks?)
+      if {$expect_out(buffer) <= 1048576 } {incr scnt}
       exp_continue}
   timeout { fail "$test (logfile timeout)"}
 }
@@ -40,12 +39,12 @@ wait
 exec sleep 3
 set cnt2 0
 # wait for log files
-spawn ls -sk1
+eval spawn stat -c %s [glob flightlog.out.*]
 expect {
   -timeout 100
-  -re {([0-9]+) flightlog\.out\.[0-9]+} {
+  -re {[0-9]+} {
       incr cnt2;
-      if {$expect_out(1,string) <= 1028} {incr scnt}
+      if {$expect_out(buffer) <= 1048576 } {incr scnt}
       exp_continue}
   timeout { fail "$test (logfile timeout)"}
 }
@@ -57,10 +56,10 @@ if {$cnt1 == 3 && $cnt2 == 3} {
   fail "$test (log file numbers ($cnt1, $cnt2))"
 }
 # check logfile size
-if {$scnt == 6} {
+if {$scnt == $cnt1 + $cnt2 } {
     pass "$test (log file size limitation)"
 } else {
-  fail "$test (log file size ($scnt))"
+  fail "$test (log file size ($scnt != $cnt1 + $cnt2))"
 }
 exec kill -TERM $pid
 # wait for exiting...
index 9d745f4b03a413d5fbc8dda3878e09b39fb18e32..f42c9b8e2f36090184c4517fdfda76db6bd36f10 100644 (file)
@@ -1,5 +1,5 @@
-probe timer.ms(1)
+probe timer.ms(10)
 {
-  for (j = 0; j < 100; j++)
+  for (j = 0; j < 1000; j++)
     printf("1234567890\n")
 }
This page took 0.02883 seconds and 5 git commands to generate.