Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.sbin/execsnoop Show the stderr from execsnoop so t...



details:   https://anonhg.NetBSD.org/src/rev/6e1ea6e65497
branches:  trunk
changeset: 1022610:6e1ea6e65497
user:      gson <gson%NetBSD.org@localhost>
date:      Tue Jul 27 15:29:22 2021 +0000

description:
Show the stderr from execsnoop so that we can see why it fails on arm.

diffstat:

 tests/usr.sbin/execsnoop/t_execsnoop.sh |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 39e469f359eb -r 6e1ea6e65497 tests/usr.sbin/execsnoop/t_execsnoop.sh
--- a/tests/usr.sbin/execsnoop/t_execsnoop.sh   Tue Jul 27 12:40:07 2021 +0000
+++ b/tests/usr.sbin/execsnoop/t_execsnoop.sh   Tue Jul 27 15:29:22 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_execsnoop.sh,v 1.9 2021/07/27 11:05:39 skrll Exp $
+# $NetBSD: t_execsnoop.sh,v 1.10 2021/07/27 15:29:22 gson Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,7 +27,8 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 #
-tmp="execsnoop.out"
+stdout="execsnoop.out"
+stderr="execsnoop.stderr"
 
 atf_test_case basic cleanup
 basic_head() {
@@ -38,7 +39,7 @@
 
 basic_body() {
        n=10
-       atf_check -s exit:0 -o ignore -e empty -x "execsnoop > $tmp &"
+       atf_check -s exit:0 -o ignore -e empty -x "execsnoop >$stdout 2>$stderr &"
        sleep 5
 
        while [ $n -gt 0 ]; do
@@ -48,7 +49,9 @@
 
        sleep 5
 
-       if [ ! $(cat $tmp | grep "whoami" | wc -l) -eq 10 ]; then
+       cat $stderr >&2
+
+       if [ ! $(cat $stdout | grep "whoami" | wc -l) -eq 10 ]; then
                atf_fail "execsnoop does not work"
        fi
 



Home | Main Index | Thread Index | Old Index