summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ChangeLog39
-rwxr-xr-xtestsuite/buildok/conversions-embedded.stp13
-rwxr-xr-xtestsuite/buildok/conversions.stp13
-rwxr-xr-xtestsuite/configure20
-rw-r--r--testsuite/configure.ac2
-rw-r--r--testsuite/lib/stap_run.exp14
-rw-r--r--testsuite/lib/systemtap.exp5
-rwxr-xr-xtestsuite/semko/fortysix.stp3
-rw-r--r--testsuite/systemtap.base/cmd_parse.exp3
-rw-r--r--testsuite/systemtap.base/maxactive.exp2
-rw-r--r--testsuite/systemtap.base/probefunc.exp2
-rw-r--r--testsuite/systemtap.printf/memory1.exp16
-rw-r--r--testsuite/systemtap.printf/memory1.stp146
-rw-r--r--testsuite/systemtap.stress/conversions.exp2
-rw-r--r--testsuite/systemtap.stress/conversions.stp13
15 files changed, 231 insertions, 62 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 1596711d..44eb50a7 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,40 @@
+2008-03-27 Frank Ch. Eigler <fche@elastic.org>
+
+ * systemtap.base/cmd_parse.exp: Don't assume $SHELL=bash.
+
+2008-03-23 Frank Ch. Eigler <fche@elastic.org>
+
+ * lib/stap_run.exp (stap_run): Ignore missing debuginfo warnings.
+ Try harder to kill stap child in case of timeouts and errors.
+
+2008-03-23 Frank Ch. Eigler <fche@elastic.org>
+
+ PR 5980.
+ * lib/systemtap.exp: Set default Snapshot: value from "stap -V"
+ output.
+
+2008-03-21 Eugene Teo <eugeneteo@kernel.sg>
+
+ PR 5528
+ * systemtap.stress/conversions.stp: Test new user_* functions.
+ * buildok/conversions.stp: Test new user_* functions.
+ * buildok/conversions-embedded.stp: Test new user_* functions.
+
+2008-03-20 Frank Ch. Eigler <fche@elastic.org>
+
+ PR 5956.
+ * semko/fortyfive.stp: New test.
+
+2008-03-15 Frank Ch. Eigler <fche@elastic.org>
+
+ * systemtap.base/maxactive.exp, probefunc.exp: Standardize pass msg.
+
+2008-03-10 Dave Brolley <brolley@redhat.com>
+
+ PR5189
+ * systemtap.printf/memory1.{stp,exp}: Rewrite to reflect new %m safety checks.
+ * systemtap.stress/conversions.exp: Add a test for invalid argument to %m.
+
2008-03-05 David Smith <dsmith@redhat.com>
PR5422
@@ -30,7 +67,7 @@
2008-02-23 Frank Ch. Eigler <fche@elastic.org>
* systemtap.samples/args.exp: Remove installation-specific paths from
- pass/fail judgements.
+ pass/fail judgements.<
2008-02-23 Frank Ch. Eigler <fche@elastic.org>
diff --git a/testsuite/buildok/conversions-embedded.stp b/testsuite/buildok/conversions-embedded.stp
index 7aa5a0b4..55f6cdb7 100755
--- a/testsuite/buildok/conversions-embedded.stp
+++ b/testsuite/buildok/conversions-embedded.stp
@@ -9,5 +9,18 @@ probe begin {
print (user_string2 (0, ""))
print (user_string_warn (0))
print (user_string_quoted (0))
+
+ print (user_string_n(0, 5))
+ print (user_string_n2(0, 5, "foobar"))
+ print (user_string_n_warn(0, 0))
+ print (user_string_n_quoted(0, 0))
+ print (user_short(0))
+ print (user_short_warn(0))
+ print (user_int(0))
+ print (user_int_warn(0))
+ print (user_long(0))
+ print (user_long_warn(0))
+ print (user_char(0))
+ print (user_char_warn(0))
}
diff --git a/testsuite/buildok/conversions.stp b/testsuite/buildok/conversions.stp
index e83bd968..5f151f1d 100755
--- a/testsuite/buildok/conversions.stp
+++ b/testsuite/buildok/conversions.stp
@@ -12,4 +12,17 @@ probe begin {
print (user_string(2342))
print (user_string2(2342,"foobar"))
print (user_string_warn(2342))
+
+ print (user_string_n(2342, 5))
+ print (user_string_n2(2342, 5, "foobar"))
+ print (user_string_n_warn(2342, 5))
+ print (user_string_n_quoted(2342, 5))
+ print (user_short(2342))
+ print (user_short_warn(2342))
+ print (user_int(2342))
+ print (user_int_warn(2342))
+ print (user_long(2342))
+ print (user_long_warn(2342))
+ print (user_char(2342))
+ print (user_char_warn(2342))
}
diff --git a/testsuite/configure b/testsuite/configure
index 2e29a3d7..bafa86d8 100755
--- a/testsuite/configure
+++ b/testsuite/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for systemtap 0.6.1.
+# Generated by GNU Autoconf 2.61 for systemtap 0.6.2.
#
# Report bugs to <systemtap@sources.redhat.com>.
#
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='systemtap'
PACKAGE_TARNAME='systemtap'
-PACKAGE_VERSION='0.6.1'
-PACKAGE_STRING='systemtap 0.6.1'
+PACKAGE_VERSION='0.6.2'
+PACKAGE_STRING='systemtap 0.6.2'
PACKAGE_BUGREPORT='systemtap@sources.redhat.com'
ac_subst_vars='SHELL
@@ -1148,7 +1148,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures systemtap 0.6.1 to adapt to many kinds of systems.
+\`configure' configures systemtap 0.6.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1214,7 +1214,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of systemtap 0.6.1:";;
+ short | recursive ) echo "Configuration of systemtap 0.6.2:";;
esac
cat <<\_ACEOF
@@ -1285,7 +1285,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-systemtap configure 0.6.1
+systemtap configure 0.6.2
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1299,7 +1299,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by systemtap $as_me 0.6.1, which was
+It was created by systemtap $as_me 0.6.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -1991,7 +1991,7 @@ fi
# Define the identity of the package.
PACKAGE='systemtap'
- VERSION='0.6.1'
+ VERSION='0.6.2'
cat >>confdefs.h <<_ACEOF
@@ -2595,7 +2595,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by systemtap $as_me 0.6.1, which was
+This file was extended by systemtap $as_me 0.6.2, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2638,7 +2638,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-systemtap config.status 0.6.1
+systemtap config.status 0.6.2
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/testsuite/configure.ac b/testsuite/configure.ac
index 5eb9b151..8f924936 100644
--- a/testsuite/configure.ac
+++ b/testsuite/configure.ac
@@ -1,7 +1,7 @@
dnl configure.ac --- autoconf input file for systemtap testsuite
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([systemtap], 0.6.1, systemtap@sources.redhat.com, systemtap)
+AC_INIT([systemtap], 0.6.2, systemtap@sources.redhat.com, systemtap)
AC_PREREQ(2.59)
AC_CONFIG_AUX_DIR(..)
diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp
index c2b4e74d..42efa4f8 100644
--- a/testsuite/lib/stap_run.exp
+++ b/testsuite/lib/stap_run.exp
@@ -34,6 +34,7 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args }
expect {
-timeout 180
-re {^Warning: using '-m' disables cache support.\r\n} {exp_continue}
+ -re {^WARNING: cannot find module [^\r]*DWARF[^\r]*\r\n} {exp_continue}
-re {^Pass\ ([1234]):[^\r]*\ in\ ([0-9]+)usr/([0-9]+)sys/([0-9]+)real\ ms\.\r\n}
{set pass$expect_out(1,string) "\t$expect_out(2,string)\t$expect_out(3,string)\t$expect_out(4,string)"; exp_continue}
-re {^Pass\ ([34]): using cached [^\r]+\r\n}
@@ -73,15 +74,22 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args }
set skipped_probes $expect_out(2,string)}
}
}
- timeout { fail "$TEST_NAME shutdown (timeout)" }
+ timeout {
+ fail "$TEST_NAME shutdown (timeout)"
+ exec kill -INT -[exp_pid]
+ }
eof { fail "$TEST_NAME shutdown (eof)" }
}
}
-re "semantic error:" { fail "$TEST_NAME compilation" }
- timeout { fail "$TEST_NAME startup (timeout)"
- exec kill -INT [exp_pid] }
+ timeout {
+ fail "$TEST_NAME startup (timeout)"
+ exec kill -INT -[exp_pid]
+ }
eof { fail "$TEST_NAME startup (eof)" }
}
+ # again for good measure
+ exec kill -INT -[exp_pid]
catch close
wait
}
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp
index baed0e41..d458e98f 100644
--- a/testsuite/lib/systemtap.exp
+++ b/testsuite/lib/systemtap.exp
@@ -58,8 +58,9 @@ proc get_system_info {} {
} elseif [file exists $env(SRCDIR)/../SNAPSHOT] {
set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT]
} else {
- set Snapshot "unknown"
- }
+ regexp {version [^)]*} [exec stap -V 2>@ stdout] version
+ set Snapshot $version
+ }
set Distro "Linux"
if [file exists /etc/fedora-release] {set Distro [exec /bin/cat /etc/fedora-release]}
if [file exists /etc/redhat-release] {set Distro [exec /bin/cat /etc/redhat-release]}
diff --git a/testsuite/semko/fortysix.stp b/testsuite/semko/fortysix.stp
new file mode 100755
index 00000000..9774f31f
--- /dev/null
+++ b/testsuite/semko/fortysix.stp
@@ -0,0 +1,3 @@
+#! stap -p2
+
+probe begin { if ("foo" == NULL) log ("boo") } # check NULL as integral global
diff --git a/testsuite/systemtap.base/cmd_parse.exp b/testsuite/systemtap.base/cmd_parse.exp
index cf15698f..ff347a9d 100644
--- a/testsuite/systemtap.base/cmd_parse.exp
+++ b/testsuite/systemtap.base/cmd_parse.exp
@@ -56,7 +56,8 @@ expect {
wait
#stap -c '(((a=42+7)); echo "The answer is $a")' -e 'probe begin {}'
-spawn stap -c {(((a=42+7)); echo "The answer is $a")} -e {probe begin {}}
+# NB: not ((a=42+7)) - must not assume bash
+spawn stap -c {(a=49; echo "The answer is $a")} -e {probe begin {}}
expect {
-timeout 60
"The answer is 49" {pass "cmd_parse6"}
diff --git a/testsuite/systemtap.base/maxactive.exp b/testsuite/systemtap.base/maxactive.exp
index e2175d17..ca95ac53 100644
--- a/testsuite/systemtap.base/maxactive.exp
+++ b/testsuite/systemtap.base/maxactive.exp
@@ -49,7 +49,7 @@ set skipped2 $skipped_probes
# time of the scripts.
set test "MAXACTIVE03"
if {$skipped1 <= $skipped2} {
- pass "$test ($skipped1 skipped probes <= $skipped2 skipped probes)"
+ pass $test
} else {
fail "$test ($skipped1 skipped probes > $skipped2 skipped probes)"
}
diff --git a/testsuite/systemtap.base/probefunc.exp b/testsuite/systemtap.base/probefunc.exp
index fbb45534..e5abe22a 100644
--- a/testsuite/systemtap.base/probefunc.exp
+++ b/testsuite/systemtap.base/probefunc.exp
@@ -42,7 +42,7 @@ set prefix "probefunc:"
set output_string "\\mscheduler_tick\\M\r\n"
set probepoint "kernel.statement(0x$addr).absolute"
set script [format $systemtap_script $probepoint]
-stap_run $prefix$probepoint sleep_one_sec $output_string -g -e $script
+stap_run "${prefix}.statement.(0xaddr).absolute" sleep_one_sec $output_string -g -e $script
# test probefunc() with kernel.function()
set probepoint "kernel.function(\"scheduler_tick\")"
diff --git a/testsuite/systemtap.printf/memory1.exp b/testsuite/systemtap.printf/memory1.exp
index 2389cdc5..7b55a3d7 100644
--- a/testsuite/systemtap.printf/memory1.exp
+++ b/testsuite/systemtap.printf/memory1.exp
@@ -1,18 +1,4 @@
set test "memory1"
-set ::result_string {Memory default width and precision :m:
-Memory static precision smaller than input :my st:
-Memory dynamic precision smaller than input :my st:
-Memory static precision equal to input :my string:
-Memory dynamic precision equal to input :my string:
-Memory static width default precision : m:
-Memory dynamic width default precision : m:
-Memory static width smaller than static precision :my string:
-Memory static width larger than static precision : my string:
-Memory dynamic width smaller than static precision :my string:
-Memory dynamic width larger than static precision : my string:
-Memory static width smaller than dynamic precision :my string:
-Memory static width larger than dynamic precision : my string:
-Memory dynamic width smaller than dynamic precision :my string:
-Memory dynamic width larger than dynamic precision : my string:
+set ::result_string {Test passed
}
stap_run2 $srcdir/$subdir/$test.stp
diff --git a/testsuite/systemtap.printf/memory1.stp b/testsuite/systemtap.printf/memory1.stp
index 3b4d6d5e..f9cbf60b 100644
--- a/testsuite/systemtap.printf/memory1.stp
+++ b/testsuite/systemtap.printf/memory1.stp
@@ -1,27 +1,121 @@
-probe begin {
- five = 5;
- nine = 9;
- fifteen = 15;
- s = "my string";
-
- printf ("Memory default width and precision\t:%m:\n", s);
-
- printf ("Memory static precision smaller than input\t:%.5m:\n", s);
- printf ("Memory dynamic precision smaller than input\t:%.*m:\n", five, s);
- printf ("Memory static precision equal to input\t:%.9m:\n", s);
- printf ("Memory dynamic precision equal to input\t:%.*m:\n", nine, s);
-
- printf ("Memory static width default precision\t:%5m:\n", s);
- printf ("Memory dynamic width default precision\t:%*m:\n", five, s);
-
- printf ("Memory static width smaller than static precision\t:%5.9m:\n", s);
- printf ("Memory static width larger than static precision\t:%15.9m:\n", s);
- printf ("Memory dynamic width smaller than static precision\t:%*.9m:\n", five, s);
- printf ("Memory dynamic width larger than static precision\t:%*.9m:\n", fifteen, s);
- printf ("Memory static width smaller than dynamic precision\t:%5.*m:\n", nine, s);
- printf ("Memory static width larger than dynamic precision\t:%15.*m:\n", nine, s);
- printf ("Memory dynamic width smaller than dynamic precision\t:%*.*m:\n", five, nine, s);
- printf ("Memory dynamic width larger than dynamic precision\t:%*.*m:\n", fifteen, nine, s);
-
- exit()
+probe syscall.open {
+ actualLength = strlen (filename);
+
+ if (actualLength > 5 && actualLength < 15 && filename != "<unknown>") {
+ four = 4;
+ five = 5;
+ fifteen = 15;
+ success = 1;
+
+ expected_1_1 = sprintf ("%.1s", filename);
+ testName = "%m default width and precision";
+ result = sprintf ("%m", $filename);
+ if (result != expected_1_1) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ expected_5_5 = sprintf ("%.5s", filename);
+ testName = "%m static precision smaller than input";
+ result = sprintf ("%.5m", $filename);
+ if (result != expected_5_5) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic precision smaller than input";
+ result = sprintf ("%.*m", five, $filename);
+ if (result != expected_5_5) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic precision equal to input";
+ expected_actual_actual = filename;
+ result = sprintf ("%.*m", actualLength, $filename);
+ if (result != expected_actual_actual) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ expected_5_1 = sprintf (" %.1s", filename);
+ testName = "%m static width default precision";
+ result = sprintf ("%5m", $filename);
+ if (result != expected_5_1) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic width default precision";
+ result = sprintf ("%*m", five, $filename);
+ if (result != expected_5_1) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ expected_4_5 = expected_5_5;
+ testName = "%m static width smaller than static precision";
+ result = sprintf ("%4.5m", $filename);
+ if (result != expected_4_5) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ expected_15_5 = sprintf (" %.5s", filename);
+ testName = "%m static width larger than static precision";
+ result = sprintf ("%15.5m", $filename);
+ if (result != expected_15_5) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic width smaller than static precision";
+ result = sprintf ("%*.5m", four, $filename);
+ if (result != expected_4_5) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic width larger than static precision";
+ result = sprintf ("%*.5m", fifteen, $filename);
+ if (result != expected_15_5) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ expected_4_actual = expected_actual_actual;
+ testName = "%m static width smaller than dynamic precision";
+ result = sprintf ("%4.*m", actualLength, $filename);
+ if (result != expected_4_actual) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ expected_15_actual = sprintf ("%15s", filename);
+ testName = "%m static width larger than dynamic precision";
+ result = sprintf ("%15.*m", actualLength, $filename);
+ if (result != expected_15_actual) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic width smaller than dynamic precision";
+ result = sprintf ("%*.*m", four, actualLength, $filename);
+ if (result != expected_4_actual) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ testName = "%m dynamic width larger than dynamic precision";
+ result = sprintf ("%*.*m", fifteen, actualLength, $filename);
+ if (result != expected_15_actual) {
+ printf ("Test %s failed\n", testName);
+ success = 0;
+ }
+
+ if (success)
+ print ("Test passed\n");
+
+ exit();
+ }
}
diff --git a/testsuite/systemtap.stress/conversions.exp b/testsuite/systemtap.stress/conversions.exp
index 230904ee..34cd3889 100644
--- a/testsuite/systemtap.stress/conversions.exp
+++ b/testsuite/systemtap.stress/conversions.exp
@@ -19,6 +19,6 @@ foreach value {0 0xffffffff 0xffffffffffffffff} {
}
verbose -log "done exp $test $errs"
wait
- if {$errs == 8} { pass $test } else { fail "$test ($errs)" }
+ if {$errs == 9} { pass $test } else { fail "$test ($errs)" }
verbose -log "done $test $errs"
}
diff --git a/testsuite/systemtap.stress/conversions.stp b/testsuite/systemtap.stress/conversions.stp
index 797626ab..34bd0c28 100644
--- a/testsuite/systemtap.stress/conversions.stp
+++ b/testsuite/systemtap.stress/conversions.stp
@@ -8,8 +8,21 @@ probe begin { print (kernel_int ($1)) }
probe begin { print (kernel_short ($1)) }
probe begin { print (kernel_char ($1)) }
probe begin { print (kernel_int ($1)) }
+probe begin { printf ("%m", $1) }
probe begin { print (user_string ($1)) }
probe begin { print (user_string2 ($1,"<only suspected, not known>")) }
probe begin { print (user_string_warn ($1)) }
probe begin { print (user_string_quoted ($1)) }
+probe begin { print (user_string_n ($1, 5)) }
+probe begin { print (user_string_n2 ($1, 5, "<only suspected, not known>")) }
+probe begin { print (user_string_n_warn ($1, 5)) }
+probe begin { print (user_string_n_quoted ($1, 5)) }
+probe begin { print (user_short ($1)) }
+probe begin { print (user_short_warn ($1)) }
+probe begin { print (user_int ($1)) }
+probe begin { print (user_int_warn ($1)) }
+probe begin { print (user_long ($1)) }
+probe begin { print (user_long_warn ($1)) }
+probe begin { print (user_char ($1)) }
+probe begin { print (user_char_warn ($1)) }
probe begin(1) { print ("\n") exit () }