]> sourceware.org Git - systemtap.git/commitdiff
Don't use as_root() to run stap within tapset_functions.exp
authorMartin Cermak <mcermak@redhat.com>
Thu, 21 Jul 2016 16:17:16 +0000 (18:17 +0200)
committerMartin Cermak <mcermak@redhat.com>
Thu, 21 Jul 2016 16:17:16 +0000 (18:17 +0200)
Most of the other as_root() in the testsuite is for stuff that
genuinely has to be root, like loading some test kernel module
that we'll probe.  For running the testsuite under a regular
user, stap{user,sys,dev} group membership mechanism should be
used instead.

testsuite/systemtap.stress/tapset_functions.exp

index 6acb3a1d1e3c26cd5bc9ee38ca3f03b204e082d5..25678fe1ee2c79843fd7be33ff97b2e3553ba501 100644 (file)
@@ -241,11 +241,12 @@ foreach line [split $outputv "\n"] {
                 close $testscript
                 # Debug-mode test
                 verbose -log "testing ${fname}(${fargs})"
-                set rc [as_root "stap -g $opts testscript.stp 2>@1"]
+                set rc [catch {eval exec "stap -g $opts testscript.stp 2>@1"} msg]
                 if {$rc == 0} {
                     pass "testscript (${fname}(${fargs}))"
                 } else {
                     fail "testscript (${fname}(${fargs}))"
+                    verbose -log "$msg"
                 }
                 dmesg_check
             } else {
@@ -260,11 +261,12 @@ if { !$debugmode } {
     close $testscript
     # Non-debug-mode test
     dmesg_snap
-    set rc [as_root "stap -g $opts testscript.stp 2>@1"]
+    set rc [catch {eval exec "stap -g $opts testscript.stp 2>@1"} msg]
     if {$rc == 0} {
         pass "testscript"
     } else {
         fail "testscript"
+        verbose -log "$msg"
     }
     dmesg_check
 }
This page took 0.026224 seconds and 5 git commands to generate.