2023-04-02 11:12:10 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd $(dirname $0)
|
|
|
|
. ../util.sh
|
|
|
|
current_test=$(basename $(pwd))
|
|
|
|
|
2023-08-27 19:19:11 +02:00
|
|
|
docker compose up -d --quiet-pull
|
2023-04-02 11:12:10 +02:00
|
|
|
|
|
|
|
user_name=testuser
|
|
|
|
docker exec user-alpine-1 adduser --disabled-password "$user_name"
|
|
|
|
|
|
|
|
docker compose exec backup backup
|
|
|
|
|
|
|
|
tar -xvf ./local/test.tar.gz
|
|
|
|
if [ ! -f ./backup/data/whoami.txt ]; then
|
|
|
|
fail "Could not find file written by pre command."
|
|
|
|
fi
|
|
|
|
pass "Found expected file."
|
|
|
|
|
|
|
|
tar -xvf ./local/test.tar.gz
|
|
|
|
if [ "$(cat ./backup/data/whoami.txt)" != "$user_name" ]; then
|
|
|
|
fail "Could not find expected user name."
|
|
|
|
fi
|
|
|
|
pass "Found expected user."
|
|
|
|
|
2023-08-28 22:11:39 +02:00
|
|
|
docker compose down --volumes --timeout 3
|
2023-04-02 11:12:10 +02:00
|
|
|
sudo rm -rf ./local
|
|
|
|
|