From 13b34f7f59c1e49d92d973e7c1e240c3eb644e58 Mon Sep 17 00:00:00 2001 From: Zhou Wenjian Date: Wed, 23 Dec 2015 10:33:39 -0600 Subject: [PATCH] Add more control limits test cases. * testsuite/systemtap.base/control_limits.exp: Add more control limits test cases. * testsuite/systemtap.base/control_limits.stp: Ditto. --- testsuite/systemtap.base/control_limits.exp | 87 +++++++++++++++++++++ testsuite/systemtap.base/control_limits.stp | 11 +++ 2 files changed, 98 insertions(+) diff --git a/testsuite/systemtap.base/control_limits.exp b/testsuite/systemtap.base/control_limits.exp index 4b68604de..b339725bf 100644 --- a/testsuite/systemtap.base/control_limits.exp +++ b/testsuite/systemtap.base/control_limits.exp @@ -1,6 +1,7 @@ set test "control_limits MAXNESTING" if {![installtest_p]} { untested $test; return } +# Test MAXNESTING. foreach runtime [get_runtime_list] { set test "control_limits MAXNESTING" if {$runtime != ""} { @@ -21,6 +22,27 @@ foreach runtime [get_runtime_list] { if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" } } +foreach runtime [get_runtime_list] { + set test "control_limits MAXNESTING proper" + if {$runtime != ""} { + lappend test "($runtime)" + spawn stap -u -DMAXNESTING=8 $srcdir/$subdir/control_limits.stp \ + --runtime=$runtime + } else { + spawn stap -u -DMAXNESTING=8 $srcdir/$subdir/control_limits.stp + } + set ko 0 + expect { + -timeout 150 + -re {ERROR.*MAXNESTING} { incr ko; exp_continue } + timeout { fail "$test (timeout)" } + eof { } + } + catch {close}; catch {wait} + if {$ko == 0} { pass "$test ($ko)" } { fail "$test ($ko)" } +} + +# Test MAXACTION. foreach runtime [get_runtime_list] { set test "control_limits MAXACTION" if {$runtime != ""} { @@ -42,6 +64,71 @@ foreach runtime [get_runtime_list] { if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" } } +foreach runtime [get_runtime_list] { + set test "control_limits MAXACTION proper" + if {$runtime != ""} { + lappend test "($runtime)" + spawn stap -u -DMAXACTION_INTERRUPTIBLE=502 \ + $srcdir/$subdir/control_limits.stp --runtime=$runtime + } else { + spawn stap -u -DMAXACTION_INTERRUPTIBLE=502 \ + $srcdir/$subdir/control_limits.stp + } + set ko 0 + expect { + -timeout 150 + -re {ERROR.*MAXACTION} { incr ko; exp_continue } + timeout { fail "$test (timeout)" } + eof { } + } + catch {close}; catch {wait} + if {$ko == 0} { pass "$test ($ko)" } { fail "$test ($ko)" } +} + +# Test MAXMAPENTRIES. +foreach runtime [get_runtime_list] { + set test "control_limits MAXMAPENTRIES" + if {$runtime != ""} { + lappend test "($runtime)" + spawn stap -u -D MAXMAPENTRIES=19 \ + $srcdir/$subdir/control_limits.stp --runtime=$runtime + } else { + spawn stap -u -D MAXMAPENTRIES=19 \ + $srcdir/$subdir/control_limits.stp + } + set ok 0 + expect { + -timeout 150 + -re {ERROR.*MAXMAPENTRIES} { incr ok; exp_continue } + timeout { fail "$test (timeout)" } + eof { } + } + catch {close}; catch {wait} + if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" } +} + +foreach runtime [get_runtime_list] { + set test "control_limits MAXMAPENTRIES proper" + if {$runtime != ""} { + lappend test "($runtime)" + spawn stap -u -D MAXMAPENTRIES=20 \ + $srcdir/$subdir/control_limits.stp --runtime=$runtime + } else { + spawn stap -u -D MAXMAPENTRIES=20 \ + $srcdir/$subdir/control_limits.stp + } + set ko 0 + expect { + -timeout 150 + -re {ERROR.*MAXMAPENTRIES} { incr ko; exp_continue } + timeout { fail "$test (timeout)" } + eof { } + } + catch {close}; catch {wait} + if {$ko == 0} { pass "$test ($ko)" } { fail "$test ($ko)" } +} + +# Test MAXSTRINGLEN. foreach runtime [get_runtime_list] { set test "control_limits MAXSTRINGLEN small" if {$runtime != ""} { diff --git a/testsuite/systemtap.base/control_limits.stp b/testsuite/systemtap.base/control_limits.stp index 89b0bae46..0453ac887 100644 --- a/testsuite/systemtap.base/control_limits.stp +++ b/testsuite/systemtap.base/control_limits.stp @@ -12,6 +12,17 @@ probe begin { for (i=0; i<498; i++) {} } +global array + +# for MAXMAPENTRIES testing +probe begin { + i=0 + while (i<20) { + array[i]=100 + i++ + } +} + # for MAXSTRINGLEN testing probe begin { s = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" # last 8 will be \0'd -- 2.43.5