-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·46 lines (39 loc) · 870 Bytes
/
test.sh
File metadata and controls
executable file
·46 lines (39 loc) · 870 Bytes
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
38
39
40
41
42
43
44
45
46
#!/bin/bash
set -xe
DATA_DIR=./test
# Preparing the image
docker-compose build ssync
# # Cleaning up
function clean_up() {
docker-compose down -v 2> /dev/null
rm -rf ${DATA_DIR}
mkdir -p ${DATA_DIR}
}
function start_services() {
docker-compose up -d
sleep 0.5
docker-compose ps
}
# Simple test run
clean_up
echo 123 > ${DATA_DIR}/test.file
docker-compose run ssync run
RESULT=$(docker-compose run app cat test.file | tr -d '\r')
[ $RESULT -eq 123 ]
# Watch test
clean_up
start_services
echo 456 > ${DATA_DIR}/test.file
sleep 0.1
RESULT=$(docker-compose run app cat test.file | tr -d '\r')
[ $RESULT -eq 456 ]
# UID Rests
clean_up
export SYNC_UID=1000
echo 0 > ${DATA_DIR}/test.file
docker-compose run ssync run
docker-compose run app find -user 1000 | grep test.file
echo "All tests completed sucessfully"
echo -n "Cleanin up..."
clean_up
echo "Done"