2022-05-08 11:20:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
2022-06-23 14:40:29 +02:00
|
|
|
. ../util.sh
|
|
|
|
current_test=$(basename $(pwd))
|
|
|
|
|
2022-05-08 11:20:38 +02:00
|
|
|
mkdir -p local
|
|
|
|
|
2023-01-07 18:50:27 +01:00
|
|
|
docker compose up -d
|
2022-05-08 11:20:38 +02:00
|
|
|
sleep 5
|
2023-01-07 18:50:27 +01:00
|
|
|
docker compose exec backup backup
|
2022-05-08 11:20:38 +02:00
|
|
|
|
2023-01-07 18:50:27 +01:00
|
|
|
docker compose down --volumes
|
2022-05-08 11:20:38 +02:00
|
|
|
|
|
|
|
out=$(mktemp -d)
|
|
|
|
sudo tar --same-owner -xvf ./local/test.tar.gz -C "$out"
|
|
|
|
|
|
|
|
if [ ! -f "$out/backup/data/me.txt" ]; then
|
2022-06-23 14:40:29 +02:00
|
|
|
fail "Expected file was not found."
|
2022-05-08 11:20:38 +02:00
|
|
|
fi
|
2022-06-23 14:40:29 +02:00
|
|
|
pass "Expected file was found."
|
2022-05-08 11:20:38 +02:00
|
|
|
|
|
|
|
if [ -f "$out/backup/data/skip.me" ]; then
|
2022-06-23 14:40:29 +02:00
|
|
|
fail "Ignored file was found."
|
2022-05-08 11:20:38 +02:00
|
|
|
fi
|
2022-06-23 14:40:29 +02:00
|
|
|
pass "Ignored file was not found."
|