tests: use common function to check for file existence

This addresses issue with "docker cp" in some systems.
This commit is contained in:
Nikos Mavrogiannopoulos
2015-05-20 15:51:25 +02:00
parent 76f2c91e6b
commit f4e9b2e698
6 changed files with 79 additions and 114 deletions

View File

@@ -111,25 +111,16 @@ kill $PID
sleep 4
#check whether /tmp/disconnect/ok was created
rm -f ./not-ok
$DOCKER cp test_unix:/tmp/disconnect/not-ok ./
if test -f ./not-ok;then
echo "There was an issue getting stats"
check_for_file /tmp/disconnect/not-ok
if test $? = 0;then
echo "There was an issue"
stop
fi
rm -f ./not-ok
ret=0
rm -f ./tmp-unix/ok
$DOCKER cp test_unix:/tmp/disconnect/ok ./tmp-unix/
if ! test -f ./tmp-unix/ok;then
echo "Don't know if stats were received"
check_for_file /tmp/disconnect/ok
if test $? != 0;then
echo "There was an issue getting stats"
ret=77
else
echo -n "stats: "
echo `cat ./tmp-unix/ok`
rm -rf ./tmp-unix/
fi
$DOCKER stop test_unix