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
|
|
|
|
2023-09-02 15:17:46 +02:00
|
|
|
export LOCAL_DIR=$(mktemp -d)
|
2022-03-04 13:51:26 +01:00
|
|
|
|
2023-08-27 19:19:11 +02:00
|
|
|
docker compose up -d --quiet-pull
|
2022-03-04 13:51:26 +01:00
|
|
|
|
|
|
|
# sleep until a backup is guaranteed to have happened on the 1 minute schedule
|
|
|
|
sleep 100
|
|
|
|
|
2024-02-09 10:24:28 +01:00
|
|
|
docker compose logs backup
|
|
|
|
|
2023-09-02 15:17:46 +02:00
|
|
|
if [ ! -f "$LOCAL_DIR/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
|
|
|
|
2024-02-21 19:34:57 +01:00
|
|
|
if [ ! -f "$LOCAL_DIR/override-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
|
|
|
|
2023-09-02 15:17:46 +02:00
|
|
|
if [ -f "$LOCAL_DIR/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."
|