Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157967093
D57213.id178495.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D57213.id178495.diff
View Options
diff --git a/bin/pwd/tests/pwd_test.sh b/bin/pwd/tests/pwd_test.sh
--- a/bin/pwd/tests/pwd_test.sh
+++ b/bin/pwd/tests/pwd_test.sh
@@ -75,14 +75,9 @@
{
pwd=$(which pwd)
[ -f "$pwd" ] || atf_skip "unable to distinguish binary from builtin"
- (
- trap "" PIPE
- # Give true(1) some time to exit.
- sleep 1
- $pwd 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ $pwd >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/asa/tests/asa_test.sh b/usr.bin/asa/tests/asa_test.sh
--- a/usr.bin/asa/tests/asa_test.sh
+++ b/usr.bin/asa/tests/asa_test.sh
@@ -68,13 +68,9 @@
atf_set descr "Failure to write to stdout"
}
stdout_body() {
- (
- trap "" PIPE
- sleep 1
- echo " $a $b" | asa 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ echo " $a $b" | asa >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh
--- a/usr.bin/cmp/tests/cmp_test2.sh
+++ b/usr.bin/cmp/tests/cmp_test2.sh
@@ -136,13 +136,9 @@
# Helper for stdout test case
atf_check_stdout()
{
- (
- trap "" PIPE
- sleep 1
- cmp "$@" 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"2\n" cat result
+ cmp "$@" >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 2 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh
--- a/usr.bin/du/tests/du_test.sh
+++ b/usr.bin/du/tests/du_test.sh
@@ -306,13 +306,9 @@
}
stdout_body()
{
- (
- trap "" PIPE
- sleep 1
- du 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ du >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/env/tests/env_test.sh b/usr.bin/env/tests/env_test.sh
--- a/usr.bin/env/tests/env_test.sh
+++ b/usr.bin/env/tests/env_test.sh
@@ -137,13 +137,9 @@
}
stdout_body()
{
- (
- trap "" PIPE
- sleep 1
- env 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ env >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/ident/tests/ident_test.sh b/usr.bin/ident/tests/ident_test.sh
--- a/usr.bin/ident/tests/ident_test.sh
+++ b/usr.bin/ident/tests/ident_test.sh
@@ -70,13 +70,9 @@
stdout_body()
{
local dir=$(atf_get_srcdir)
- (
- trap "" PIPE
- sleep 1
- ident "${dir}"/test.in 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ ident "${dir}"/test.in >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/printenv/tests/printenv_test.sh b/usr.bin/printenv/tests/printenv_test.sh
--- a/usr.bin/printenv/tests/printenv_test.sh
+++ b/usr.bin/printenv/tests/printenv_test.sh
@@ -79,13 +79,9 @@
stdout_body()
{
local dir=$(atf_get_srcdir)
- (
- trap "" PIPE
- sleep 1
- printenv 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ printenv >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/uniq/tests/uniq_test.sh b/usr.bin/uniq/tests/uniq_test.sh
--- a/usr.bin/uniq/tests/uniq_test.sh
+++ b/usr.bin/uniq/tests/uniq_test.sh
@@ -197,14 +197,9 @@
atf_set descr "error writing to stdout"
}
stdout_body() {
- (
- trap "" PIPE
- # Give true(1) some time to exit.
- sleep 1
- echo a | uniq 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ echo a | uniq >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
diff --git a/usr.bin/yes/tests/yes_test.sh b/usr.bin/yes/tests/yes_test.sh
--- a/usr.bin/yes/tests/yes_test.sh
+++ b/usr.bin/yes/tests/yes_test.sh
@@ -66,14 +66,9 @@
}
stdout_body()
{
- (
- trap "" PIPE
- # Give true(1) some time to exit.
- sleep 1
- yes 2>stderr
- echo $? >result
- ) | true
- atf_check -o inline:"1\n" cat result
+ yes >/dev/full 2>stderr
+ result=$?
+ atf_check_equal 1 "$result"
atf_check -o match:"stdout" cat stderr
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 28, 12:18 AM (14 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33570353
Default Alt Text
D57213.id178495.diff (4 KB)
Attached To
Mode
D57213: tests: Cause a write error using /dev/full instead of broken pipe
Attached
Detach File
Event Timeline
Log In to Comment