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.
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 {
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
}