mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-12 01:26:48 +08:00
tests: attempt to use lockfile-create if it exists
This commit is contained in:
+13
-5
@@ -4,6 +4,14 @@ else
|
|||||||
DOCKER=/usr/bin/docker.io
|
DOCKER=/usr/bin/docker.io
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test -x /usr/bin/lockfile-create;then
|
||||||
|
LOCKFILE="lockfile-create docker"
|
||||||
|
UNLOCKFILE="lockfile-remove docker"
|
||||||
|
else
|
||||||
|
LOCKFILE="lockfile docker.lock"
|
||||||
|
UNLOCKFILE="rm -f docker.lock"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! test -x $DOCKER;then
|
if ! test -x $DOCKER;then
|
||||||
echo "The docker program is needed to perform this test"
|
echo "The docker program is needed to perform this test"
|
||||||
exit 77
|
exit 77
|
||||||
@@ -24,7 +32,7 @@ if test -z $FEDORA && test -z $DEBIAN;then
|
|||||||
exit 77
|
exit 77
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lockfile docker.lock
|
$LOCKFILE
|
||||||
if test "$UNIX" = 1;then
|
if test "$UNIX" = 1;then
|
||||||
$DOCKER stop test_unix >/dev/null 2>&1
|
$DOCKER stop test_unix >/dev/null 2>&1
|
||||||
$DOCKER rm test_unix >/dev/null 2>&1
|
$DOCKER rm test_unix >/dev/null 2>&1
|
||||||
@@ -38,7 +46,7 @@ if test "$FEDORA" = 1;then
|
|||||||
$DOCKER pull fedora:21
|
$DOCKER pull fedora:21
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "Cannot pull docker image"
|
echo "Cannot pull docker image"
|
||||||
rm -f docker.lock
|
$UNLOCKFILE
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if test "$UNIX" = 1;then
|
if test "$UNIX" = 1;then
|
||||||
@@ -51,7 +59,7 @@ else #DEBIAN
|
|||||||
$DOCKER pull debian:jessie
|
$DOCKER pull debian:jessie
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "Cannot pull docker image"
|
echo "Cannot pull docker image"
|
||||||
rm -f docker.lock
|
$UNLOCKFILE
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if test "$UNIX" = 1;then
|
if test "$UNIX" = 1;then
|
||||||
@@ -67,8 +75,8 @@ echo "Creating image $IMAGE"
|
|||||||
$DOCKER build -t $IMAGE docker-ocserv/
|
$DOCKER build -t $IMAGE docker-ocserv/
|
||||||
if test $? != 0;then
|
if test $? != 0;then
|
||||||
echo "Cannot build docker image"
|
echo "Cannot build docker image"
|
||||||
rm -f docker.lock
|
$UNLOCKFILE
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f docker.lock
|
$UNLOCKFILE
|
||||||
|
|||||||
Reference in New Issue
Block a user