1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

hack: fail tests if there are leftover temp files before or after

This commit is contained in:
Solomon Hykes 2013-10-18 02:32:13 +00:00
parent d034aafac7
commit 5cd7de5de8

View file

@ -31,4 +31,26 @@ find_test_dirs() {
sort -u
}
check_test_garbage() {
nGarbage=`find /tmp/ -name 'docker-*' | wc -l`
if [ $nGarbage -gt 0 ]; then
(
cat <<EOF
Error: there are $nGarbage docker-related files in /tmp. Please clean them up and try again.
--------------------------------------------------------------------------------------------
EOF
find /tmp -name 'docker-*'
cat <<EOF
--------------------------------------------------------------------------------------------
If the error persists, your tests might leak temporary files. This is considered a test fail.
EOF
exit 1
) 2>&1
fi
}
check_test_garbage
bundle_test
check_test_garbage