2022-03-04 13:51:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
2022-06-23 14:40:29 +02:00
|
|
|
. ../util.sh
|
|
|
|
current_test=$(basename $(pwd))
|
2022-03-04 13:51:26 +01:00
|
|
|
|
|
|
|
mkdir -p local
|
|
|
|
|
|
|
|
docker-compose up -d
|
|
|
|
|
|
|
|
# sleep until a backup is guaranteed to have happened on the 1 minute schedule
|
|
|
|
sleep 100
|
|
|
|
|
|
|
|
docker-compose down --volumes
|
|
|
|
|
|
|
|
if [ ! -f ./local/conf.tar.gz ]; then
|
2022-06-23 14:40:29 +02:00
|
|
|
fail "Config from file was not used."
|
2022-03-04 13:51:26 +01:00
|
|
|
fi
|
2022-06-23 14:40:29 +02:00
|
|
|
pass "Config from file was used."
|
2022-03-04 13:51:26 +01:00
|
|
|
|
2022-03-25 18:26:34 +01:00
|
|
|
if [ ! -f ./local/other.tar.gz ]; then
|
2022-06-23 14:40:29 +02:00
|
|
|
fail "Run on same schedule did not succeed."
|
2022-03-25 18:26:34 +01:00
|
|
|
fi
|
2022-06-23 14:40:29 +02:00
|
|
|
pass "Run on same schedule succeeded."
|
2022-03-25 18:26:34 +01:00
|
|
|
|
2022-03-04 13:51:26 +01:00
|
|
|
if [ -f ./local/never.tar.gz ]; then
|
2022-06-23 14:40:29 +02:00
|
|
|
fail "Unexpected file was found."
|
2022-03-04 13:51:26 +01:00
|
|
|
fi
|
2022-06-23 14:40:29 +02:00
|
|
|
pass "Unexpected cron did not run."
|