aboutsummaryrefslogtreecommitdiffstats
path: root/atf-sh/atf_check_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'atf-sh/atf_check_test.sh')
-rw-r--r--atf-sh/atf_check_test.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/atf-sh/atf_check_test.sh b/atf-sh/atf_check_test.sh
index 163e905f1ab0..9e3cfb955f68 100644
--- a/atf-sh/atf_check_test.sh
+++ b/atf-sh/atf_check_test.sh
@@ -164,18 +164,22 @@ equal_body()
grep '^failed: \${x} != \${y} (a != b)$' resfile
}
-atf_test_case flush_stdout_on_timeout
-flush_stdout_on_timeout_body()
+atf_test_case flush_stdout_on_death
+flush_stdout_on_death_body()
{
- "$(atf_get_srcdir)/misc_helpers" -s "$(atf_get_srcdir)" atf_check_timeout \
- >out 2>err &
+ CONTROL_FILE="$(pwd)/done" "$(atf_get_srcdir)/misc_helpers" \
+ -s "$(atf_get_srcdir)" atf_check_flush_stdout >out 2>err &
pid="${!}"
- sleep 1
- kill "${pid}"
+ while [ ! -f ./done ]; do
+ echo "Still waiting for helper to create control file"
+ ls
+ sleep 1
+ done
+ kill -9 "${pid}"
grep 'Executing command.*true' out \
|| atf_fail 'First command not in output'
- grep 'Executing command.*sleep 42' out \
+ grep 'Executing command.*false' out \
|| atf_fail 'Second command not in output'
}
@@ -187,7 +191,7 @@ atf_init_test_cases()
atf_add_test_case null_stdout
atf_add_test_case null_stderr
atf_add_test_case equal
- atf_add_test_case flush_stdout_on_timeout
+ atf_add_test_case flush_stdout_on_death
}
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4