From dadf22fe5fb6f2aed396c432d3f7cc182b9ca795 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Thu, 21 Jul 2016 18:17:16 +0200 Subject: [PATCH] Don't use as_root() to run stap within tapset_functions.exp 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testsuite/systemtap.stress/tapset_functions.exp b/testsuite/systemtap.stress/tapset_functions.exp index 6acb3a1d1..25678fe1e 100644 --- a/testsuite/systemtap.stress/tapset_functions.exp +++ b/testsuite/systemtap.stress/tapset_functions.exp @@ -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 } -- 2.43.5