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:
parent
d034aafac7
commit
5cd7de5de8
1 changed files with 22 additions and 0 deletions
|
@ -31,4 +31,26 @@ find_test_dirs() {
|
||||||
sort -u
|
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
|
bundle_test
|
||||||
|
check_test_garbage
|
||||||
|
|
Loading…
Add table
Reference in a new issue