mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
tests: use common function to check for file existence
This addresses issue with "docker cp" in some systems.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user