From f249edcd5f135278e15ccafb497be520c325a5e4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 5 Aug 2009 16:55:24 -0700 Subject: Don't spawn uprobes tests with sudo Using spawn with sudo doesn't work well, because the password prompt won't go to the correct TTY. The only reason that the uprobes tests needed to do this is so uprobes.ko could be built as root. Now instead, I've added a pre-check that will directly call the uprobes make with sudo (via the as_root proc). * testsuite/lib/systemtap.exp (uprobes_p): Check and build uprobes.ko. * testsuite/systemtap.base/uprobes.exp: Use uprobes_p; don't spawn sudo. * testsuite/systemtap.base/bz6850.exp: Ditto. * testsuite/systemtap.base/bz10078.exp: Ditto. * testsuite/systemtap.base/bz6905.exp: sudo isn't needed for -p2. --- testsuite/lib/systemtap.exp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 76fd57bd..82afb6b7 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -26,6 +26,29 @@ proc utrace_p {} { } +proc uprobes_p {} { + global env + if {! [utrace_p]} { + return 0 + } + set uprobes $env(SYSTEMTAP_RUNTIME)/uprobes + set res [catch "exec make -q -C $uprobes uprobes.ko" output] + if {$res != 0} { + if {! [installtest_p]} { + # build as user in the source tree + verbose -log "exec make -C $uprobes" + set res [catch "exec make -C $uprobes" output] + verbose -log "OUT $output" + verbose -log "RC $res" + } else { + # build as root in the installed location + set res [as_root "make -C $uprobes"] + } + } + if {$res == 0} { return 1 } else { return 0 } +} + + proc print_systemtap_version {} { set version [exec /bin/uname -r] set location "/boot/vmlinux-$version" -- cgit