Source-Changes-HG archive

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

[src/trunk]: src/tests Instead of doing 'atf_check ... sh -c foo', just do 'a...



details:   https://anonhg.NetBSD.org/src/rev/b1b8ef20629a
branches:  trunk
changeset: 764970:b1b8ef20629a
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Sat May 14 17:42:28 2011 +0000

description:
Instead of doing 'atf_check ... sh -c foo', just do 'atf_check ... -x foo'.

diffstat:

 tests/dev/cgd/t_cgd.sh              |  16 ++++++++--------
 tests/dev/md/t_md.sh                |   6 +++---
 tests/dev/raidframe/t_raid.sh       |   6 +++---
 tests/lib/librumphijack/t_tcpip.sh  |   6 +++---
 tests/net/route/t_change.sh         |   8 ++++----
 tests/usr.bin/rump_server/t_disk.sh |   4 ++--
 tests/util/grep/t_grep.sh           |  10 +++++-----
 7 files changed, 28 insertions(+), 28 deletions(-)

diffs (199 lines):

diff -r 8b84917301bf -r b1b8ef20629a tests/dev/cgd/t_cgd.sh
--- a/tests/dev/cgd/t_cgd.sh    Sat May 14 17:12:28 2011 +0000
+++ b/tests/dev/cgd/t_cgd.sh    Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_cgd.sh,v 1.8 2011/03/22 16:16:30 jmmv Exp $
+#      $NetBSD: t_cgd.sh,v 1.9 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -45,9 +45,9 @@
            ${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
 
        export RUMP_SERVER=unix://csock
-       atf_check -s exit:0 sh -c "echo 12345 | \
+       atf_check -s exit:0 -x "echo 12345 | \
            rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "dd if=${d}/t_cgd count=2 | rump.dd of=${rawcgd}"
        atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
        atf_check -s exit:0 -e ignore -o file:testfile \
@@ -76,14 +76,14 @@
            ${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
 
        export RUMP_SERVER=unix://csock
-       atf_check -s exit:0 sh -c "echo 12345 | \
+       atf_check -s exit:0 -x "echo 12345 | \
            rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "dd if=${d}/t_cgd | rump.dd of=${rawcgd} count=2"
 
        # unconfig and reconfig cgd
        atf_check -s exit:0 rump.cgdconfig -u cgd0
-       atf_check -s exit:0 sh -c "echo 54321 | \
+       atf_check -s exit:0 -x "echo 54321 | \
            rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
 
        atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
@@ -112,11 +112,11 @@
            ${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
 
        export RUMP_SERVER=unix://csock
-       atf_check -s exit:0 sh -c "echo 12345 | \
+       atf_check -s exit:0 -x "echo 12345 | \
            rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile"
 
        atf_expect_fail "PR kern/44515"
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "echo die hard | rump.dd of=${rawcgd} bs=123 conv=sync"
 }
 
diff -r 8b84917301bf -r b1b8ef20629a tests/dev/md/t_md.sh
--- a/tests/dev/md/t_md.sh      Sat May 14 17:12:28 2011 +0000
+++ b/tests/dev/md/t_md.sh      Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_md.sh,v 1.6 2011/02/04 19:44:00 pooka Exp $
+#      $NetBSD: t_md.sh,v 1.7 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -45,9 +45,9 @@
        atf_check -s exit:0 $(atf_get_srcdir)/h_mdserv ${rawmd}
 
        export RUMP_SERVER=unix://commsock
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "dd if=/bin/ls count=10 | rump.dd of=${rawmd} seek=100"
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "rump.dd if=${rawmd} skip=100 count=10 | dd of=testfile"
        atf_check -s exit:0 -e ignore -o file:testfile dd if=/bin/ls count=10
 }
diff -r 8b84917301bf -r b1b8ef20629a tests/dev/raidframe/t_raid.sh
--- a/tests/dev/raidframe/t_raid.sh     Sat May 14 17:12:28 2011 +0000
+++ b/tests/dev/raidframe/t_raid.sh     Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_raid.sh,v 1.7 2011/03/01 22:52:54 riz Exp $
+#      $NetBSD: t_raid.sh,v 1.8 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -96,7 +96,7 @@
        # put some data there
        atf_check -s exit:0 -e ignore \
            dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "dd if=testfile | rump.dd of=${rawraid} conv=sync"
 
        # restart server with failed component
@@ -183,7 +183,7 @@
        # put some data there
        atf_check -s exit:0 -e ignore \
            dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "dd if=testfile | rump.dd of=${rawraid} conv=sync"
 
        # restart server with failed component
diff -r 8b84917301bf -r b1b8ef20629a tests/lib/librumphijack/t_tcpip.sh
--- a/tests/lib/librumphijack/t_tcpip.sh        Sat May 14 17:12:28 2011 +0000
+++ b/tests/lib/librumphijack/t_tcpip.sh        Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: t_tcpip.sh,v 1.10 2011/03/29 16:03:32 jmmv Exp $
+#       $NetBSD: t_tcpip.sh,v 1.11 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -173,12 +173,12 @@
        atf_check -s exit:0 mkdir /rump/etc
        atf_check -s exit:0 mkdir /rump/export
 
-       atf_check -s exit:0 sh -c       \
+       atf_check -s exit:0 -x \
            'echo "/export -noresvport -noresvmnt 10.1.1.100" | \
                dd of=/rump/etc/exports 2> /dev/null'
 
        atf_check -s exit:0 -e ignore mount_ffs /dk /rump/export
-       atf_check -s exit:0 sh -c "echo ${magicstr} > /rump/export/im_alive"
+       atf_check -s exit:0 -x "echo ${magicstr} > /rump/export/im_alive"
 
        # start rpcbind.  we want /var/run/rpcbind.sock
        export RUMPHIJACK='blanket=/var/run,socket=all' 
diff -r 8b84917301bf -r b1b8ef20629a tests/net/route/t_change.sh
--- a/tests/net/route/t_change.sh       Sat May 14 17:12:28 2011 +0000
+++ b/tests/net/route/t_change.sh       Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_change.sh,v 1.2 2011/02/10 07:47:50 kefren Exp $
+#      $NetBSD: t_change.sh,v 1.3 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -43,12 +43,12 @@
 
        atf_check -s exit:0 -o ignore \
            rump.route add 207.46.197.32 127.0.0.1 -reject
-       atf_check -s exit:0 -o match:UGHR sh -c \
+       atf_check -s exit:0 -o match:UGHR -x \
            "rump.route -n show -inet | grep ^207.46"
        atf_check -s exit:0 -o ignore \
            rump.route change 207.46.197.32 127.0.0.1 -blackhole
-       atf_check -s exit:0 -o match:' UGHBS ' -e ignore \
-           sh -c "rump.netstat -rn -f inet | grep ^207.46| grep ^207.46"
+       atf_check -s exit:0 -o match:' UGHBS ' -e ignore -x \
+           "rump.netstat -rn -f inet | grep ^207.46| grep ^207.46"
 }
 
 reject2blackhole_cleanup()
diff -r 8b84917301bf -r b1b8ef20629a tests/usr.bin/rump_server/t_disk.sh
--- a/tests/usr.bin/rump_server/t_disk.sh       Sat May 14 17:12:28 2011 +0000
+++ b/tests/usr.bin/rump_server/t_disk.sh       Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_disk.sh,v 1.3 2011/02/17 16:08:48 pooka Exp $
+#      $NetBSD: t_disk.sh,v 1.4 2011/05/14 17:42:28 jmmv Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -76,7 +76,7 @@
 data()
 {
        echo 'test string' | dd of=testfile ibs=512 count=1 conv=sync
-       atf_check -s exit:0 -e ignore sh -c \
+       atf_check -s exit:0 -e ignore -x \
            "dd if=testfile | rump.dd of=/img bs=512 count=1"
 
        # cheap fsync
diff -r 8b84917301bf -r b1b8ef20629a tests/util/grep/t_grep.sh
--- a/tests/util/grep/t_grep.sh Sat May 14 17:12:28 2011 +0000
+++ b/tests/util/grep/t_grep.sh Sat May 14 17:42:28 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_grep.sh,v 1.4 2010/11/07 17:51:23 jmmv Exp $
+# $NetBSD: t_grep.sh,v 1.5 2011/05/14 17:42:29 jmmv Exp $
 #
 # Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -32,8 +32,8 @@
 }
 basic_body()
 { 
-       atf_check -o file:"$(atf_get_srcdir)/d_basic.out" \
-           sh -c 'jot 10000 | grep 123'
+       atf_check -o file:"$(atf_get_srcdir)/d_basic.out" -x \
+           'jot 10000 | grep 123'
 }
 
 atf_test_case binary
@@ -166,8 +166,8 @@
 }
 file_exp_body()
 {
-       atf_check -o file:"$(atf_get_srcdir)/d_file_exp.out" \
-           sh -c 'jot 21 -1 1.00 | grep -f '"$(atf_get_srcdir)"'/d_file_exp.in'
+       atf_check -o file:"$(atf_get_srcdir)/d_file_exp.out" -x \
+           'jot 21 -1 1.00 | grep -f '"$(atf_get_srcdir)"'/d_file_exp.in'
 }
 
 atf_test_case egrep



Home | Main Index | Thread Index | Old Index