aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-09-09 06:24:21 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-09-09 06:24:21 +0000
commit71607cbea736714f933cec7196c788d4d01da216 (patch)
tree87e8a10ea0d9071cc68c0023166bd1167e64b074 /usr.bin/tail
parent5b1cfc99cf8305463ef39738c4a8114a0adde751 (diff)
downloadsrc-71607cbea736714f933cec7196c788d4d01da216.tar.gz
src-71607cbea736714f933cec7196c788d4d01da216.zip
Unbreak :broken_pipe
- Capture exit code in pipeline and test in output. - Drop awk use in favor of `sleep 2`. This helps guarantee the EPIPE behavior without the potential race.
Notes
Notes: svn path=/head/; revision=323348
Diffstat (limited to 'usr.bin/tail')
-rwxr-xr-xusr.bin/tail/tests/tail_test.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh
index 30507836fa60..fddc4ccd998b 100755
--- a/usr.bin/tail/tests/tail_test.sh
+++ b/usr.bin/tail/tests/tail_test.sh
@@ -222,10 +222,10 @@ broken_pipe_head()
}
broken_pipe_body()
{
- atf_expect_fail "Can't seem to get testcase to work in test environment. Reproduces easily in interactive shell."
-
atf_check -o save:ints seq -f '%128g' 1 1000
- atf_check -s exit:1 -o ignore -e "inline:tail: stdout" tail -n 856 ints | awk '{ exit }'
+ atf_check -s ignore \
+ -e "inline:tail: stdout\nexit code: 1\n" \
+ -x '(tail -n 856 ints; echo exit code: $? >&2) | sleep 2'
}
@@ -243,5 +243,5 @@ atf_init_test_cases()
atf_add_test_case longfile_rc135782
atf_add_test_case longfile_rc145782_longlines
atf_add_test_case longfile_rn2500
- #atf_add_test_case broken_pipe
+ atf_add_test_case broken_pipe
}