summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.server/client_args.exp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2010-01-11 20:19:54 -0500
committerDave Brolley <brolley@redhat.com>2010-01-11 20:19:54 -0500
commit5f03ebf5b2acccb652c9135627184479bc8d7d47 (patch)
tree431f1d3056d32ada6c9c4daf6bbcbb47b4a75537 /testsuite/systemtap.server/client_args.exp
parenta0ace4915e5d963c28fa3b54f87afef34b82b6a5 (diff)
downloadsystemtap-steved-5f03ebf5b2acccb652c9135627184479bc8d7d47.tar.gz
systemtap-steved-5f03ebf5b2acccb652c9135627184479bc8d7d47.tar.xz
systemtap-steved-5f03ebf5b2acccb652c9135627184479bc8d7d47.zip
Invalid casess can be tested for 'make check'.
Diffstat (limited to 'testsuite/systemtap.server/client_args.exp')
-rw-r--r--testsuite/systemtap.server/client_args.exp96
1 files changed, 49 insertions, 47 deletions
diff --git a/testsuite/systemtap.server/client_args.exp b/testsuite/systemtap.server/client_args.exp
index 35d418ee..1ba1e900 100644
--- a/testsuite/systemtap.server/client_args.exp
+++ b/testsuite/systemtap.server/client_args.exp
@@ -1,12 +1,57 @@
-set test "Server Client Arguments"
-
-# stap_run_exact only works for 'make installcheck'
-if {[info procs installtest_p] != "" && ![installtest_p]} { untested $test; return }
+set test "Valid Server Client Arguments"
# Test that stap on the server side will correctly accept/reject certain
# arguments in unprivileged mode.
set test_file $srcdir/systemtap.server/test.stp
+# Test invalid combinations.
+set error_regexp ".*You can't specify (-\[aBDImRr\], )*-\[aBDImRr\] when --unprivileged is specified.*"
+
+set invalid_options [list \
+ "--unprivileged --client-options -a i386" \
+ "--unprivileged --client-options -B X=Y" \
+ "--unprivileged --client-options -D X=Y" \
+ "--unprivileged --client-options -I /tmp" \
+ "--unprivileged --client-options -m test" \
+ "--unprivileged --client-options -R /tmp" \
+ "--unprivileged --client-options -r [exec uname -r]" \
+ "--unprivileged --client-options -a i386 -B X=Y -D X=Y -I /tmp -m test -R /tmp -r [exec uname -r]" \
+ "--client-options --unprivileged -a i386" \
+ "--client-options --unprivileged -B X=Y" \
+ "--client-options --unprivileged -D X=Y" \
+ "--client-options --unprivileged -I /tmp" \
+ "--client-options --unprivileged -m test" \
+ "--client-options --unprivileged -R /tmp" \
+ "--client-options --unprivileged -r [exec uname -r]" \
+ "--client-options --unprivileged -a i386 -B X=Y -D X=Y -I /tmp -m test -R /tmp -r [exec uname -r]" \
+ "--client-options -a i386 --unprivileged" \
+ "--client-options -B X=Y --unprivileged" \
+ "--client-options -D X=Y --unprivileged" \
+ "--client-options -I /tmp --unprivileged" \
+ "--client-options -m test --unprivileged" \
+ "--client-options -R /tmp --unprivileged" \
+ "--client-options -r [exec uname -r] --unprivileged" \
+ "--client-options -a i386 -B X=Y -D X=Y -I /tmp -m test -R /tmp -r [exec uname -r] --unprivileged" \
+]
+
+foreach options $invalid_options {
+ verbose -log "eval exec stap $options"
+ catch {eval exec stap $test_file -p1 $options} res_stap
+ verbose -log $res_stap
+
+ if {[regexp $error_regexp $res_stap]} {
+ pass "$test: $options"
+ } else {
+ fail "$test: $options"
+ }
+}
+
+# Test valid combinations
+# stap_run_exact (used below) only works for 'make installcheck'
+if {[info procs installtest_p] != "" && ![installtest_p]} { untested $test; return }
+
+set test "Valid Server Client Arguments"
+
set no_error_result "# parse tree dump
# file $test_file
probe begin{
@@ -15,7 +60,6 @@ exit()
"
-# First test valid combinations
set valid_options [list \
"-a i386" \
"-B X=Y" \
@@ -58,45 +102,3 @@ set ::result_string "$no_error_result"
foreach options $valid_options {
eval stap_run_exact {"$test: $options"} $test_file -p1 $options
}
-
-# Now test invalid combinations.
-set error_regexp ".*You can't specify (-\[aBDImRr\], )*-\[aBDImRr\] when --unprivileged is specified.*"
-
-set invalid_options [list \
- "--unprivileged --client-options -a i386" \
- "--unprivileged --client-options -B X=Y" \
- "--unprivileged --client-options -D X=Y" \
- "--unprivileged --client-options -I /tmp" \
- "--unprivileged --client-options -m test" \
- "--unprivileged --client-options -R /tmp" \
- "--unprivileged --client-options -r [exec uname -r]" \
- "--unprivileged --client-options -a i386 -B X=Y -D X=Y -I /tmp -m test -R /tmp -r [exec uname -r]" \
- "--client-options --unprivileged -a i386" \
- "--client-options --unprivileged -B X=Y" \
- "--client-options --unprivileged -D X=Y" \
- "--client-options --unprivileged -I /tmp" \
- "--client-options --unprivileged -m test" \
- "--client-options --unprivileged -R /tmp" \
- "--client-options --unprivileged -r [exec uname -r]" \
- "--client-options --unprivileged -a i386 -B X=Y -D X=Y -I /tmp -m test -R /tmp -r [exec uname -r]" \
- "--client-options -a i386 --unprivileged" \
- "--client-options -B X=Y --unprivileged" \
- "--client-options -D X=Y --unprivileged" \
- "--client-options -I /tmp --unprivileged" \
- "--client-options -m test --unprivileged" \
- "--client-options -R /tmp --unprivileged" \
- "--client-options -r [exec uname -r] --unprivileged" \
- "--client-options -a i386 -B X=Y -D X=Y -I /tmp -m test -R /tmp -r [exec uname -r] --unprivileged" \
-]
-
-foreach options $invalid_options {
- verbose -log "eval exec stap $options"
- catch {eval exec stap -p1 $options} res_stap
- verbose -log $res_stap
-
- if {[regexp $error_regexp $res_stap]} {
- pass "$test: $options"
- } else {
- fail "$test: $options"
- }
-}