summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/gtod.exp
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-01-29 16:55:06 -0500
committerWilliam Cohen <wcohen@redhat.com>2009-01-29 16:55:06 -0500
commit9fbda39bf7687ceeee28813f30f6e3ec5c72fc5d (patch)
tree591d46a22865cb745e368ca4325bf95ad93e7f70 /testsuite/systemtap.base/gtod.exp
parent8da0793017c9871b96cb9695ab10e9fa040c0a03 (diff)
downloadsystemtap-steved-9fbda39bf7687ceeee28813f30f6e3ec5c72fc5d.tar.gz
systemtap-steved-9fbda39bf7687ceeee28813f30f6e3ec5c72fc5d.tar.xz
systemtap-steved-9fbda39bf7687ceeee28813f30f6e3ec5c72fc5d.zip
Move some systemtap.sample tests to systemtap.base.
Diffstat (limited to 'testsuite/systemtap.base/gtod.exp')
-rw-r--r--testsuite/systemtap.base/gtod.exp40
1 files changed, 40 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/gtod.exp b/testsuite/systemtap.base/gtod.exp
new file mode 100644
index 00000000..a8f3c9d6
--- /dev/null
+++ b/testsuite/systemtap.base/gtod.exp
@@ -0,0 +1,40 @@
+# test for checking monotonic timer (PR3916)
+set test "gtod"
+if {![installtest_p]} { untested $test; continue }
+
+set wd [pwd]
+set filename "$srcdir/$subdir/gtod.c"
+
+target_compile $filename $wd/gtod executable ""
+
+# non interval (check timer drift in short range)
+spawn $srcdir/$subdir/gtod.sh $srcdir/$subdir/gtod.stp $wd/gtod
+set ok 0
+expect {
+ -timeout 120
+ -re {^[0-9]+ \:([0-9]+) appl\r\n[0-9]+ \:\1 kern\r\n[0-9]+ \:\1 prog\r\n} { incr ok; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+wait
+#10ms interval (check timer drift in middle range)
+spawn $srcdir/$subdir/gtod.sh $srcdir/$subdir/gtod.stp $wd/gtod 10000
+expect {
+ -timeout 120
+ -re {^[0-9]+ \:([0-9]+) appl\r\n[0-9]+ \:\1 kern\r\n[0-9]+ \:\1 prog\r\n} { incr ok; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+wait
+#100ms interval (calm down processors and CPU freq might be changed)
+spawn $srcdir/$subdir/gtod.sh $srcdir/$subdir/gtod.stp $wd/gtod 100000
+expect {
+ -timeout 120
+ -re {^[0-9]+ \:([0-9]+) appl\r\n[0-9]+ \:\1 kern\r\n[0-9]+ \:\1 prog\r\n} { incr ok; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+wait
+exec rm -f $wd/gtod
+if {$ok == 300} { pass "$test ($ok)" } { fail "$test ($ok)" }
+