forked from ome/omero-server-docker
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_dropbox.sh
executable file
·37 lines (32 loc) · 881 Bytes
/
test_dropbox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
set -u
set -x
# Must be exported by the caller:
# OMERO_USER OMERO_PASS PREFIX
OMERO=/opt/omero/server/OMERO.server/bin/omero
FILENAME=$(date +%Y%m%d-%H%M%S-%N).fake
docker exec $PREFIX-master sh -c \
"mkdir -p /OMERO/DropBox/root && touch /OMERO/DropBox/root/$FILENAME"
echo -n "Checking for imported DropBox image $FILENAME "
# Retry for 4 mins
i=0
result=
while [ $i -lt 60 ]; do
sleep 4
result=$(docker exec $PREFIX-master $OMERO hql -q -s localhost -u $OMERO_USER -w $OMERO_PASS "SELECT COUNT (*) FROM Image WHERE name='$FILENAME'" --style plain)
if [ "$result" = "0,1" ]; then
echo
echo "Found image: $result"
exit 0
fi
if [ "$result" != "0,0" ]; then
echo
echo "Unexpected query result: $result"
exit 2
fi
echo -n "."
let ++i
done
echo "Failed to find image"
exit 2