2022-05-08 17:20:38 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
2022-06-23 20:40:29 +08:00
|
|
|
. ../util.sh
|
|
|
|
current_test=$(basename $(pwd))
|
|
|
|
|
2023-09-02 21:17:46 +08:00
|
|
|
export LOCAL_DIR=$(mktemp -d)
|
2022-05-08 17:20:38 +08:00
|
|
|
|
2023-08-28 01:19:11 +08:00
|
|
|
docker compose up -d --quiet-pull
|
2022-05-08 17:20:38 +08:00
|
|
|
sleep 5
|
2023-01-08 01:50:27 +08:00
|
|
|
docker compose exec backup backup
|
2022-05-08 17:20:38 +08:00
|
|
|
|
2023-09-02 21:17:46 +08:00
|
|
|
TMP_DIR=$(mktemp -d)
|
|
|
|
tar --same-owner -xvf "$LOCAL_DIR/test.tar.gz" -C "$TMP_DIR"
|
2022-05-08 17:20:38 +08:00
|
|
|
|
2023-09-02 21:17:46 +08:00
|
|
|
if [ ! -f "$TMP_DIR/backup/data/me.txt" ]; then
|
2022-06-23 20:40:29 +08:00
|
|
|
fail "Expected file was not found."
|
2022-05-08 17:20:38 +08:00
|
|
|
fi
|
2022-06-23 20:40:29 +08:00
|
|
|
pass "Expected file was found."
|
2022-05-08 17:20:38 +08:00
|
|
|
|
2023-09-02 21:17:46 +08:00
|
|
|
if [ -f "$TMP_DIR/backup/data/skip.me" ]; then
|
2022-06-23 20:40:29 +08:00
|
|
|
fail "Ignored file was found."
|
2022-05-08 17:20:38 +08:00
|
|
|
fi
|
2022-06-23 20:40:29 +08:00
|
|
|
pass "Ignored file was not found."
|