mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-10 08:40:27 +01:00
ad4e2af83f
* Skip backends while pruning * Add pruning test step and silence download log for better readability * Add test cases for pruning in all backends Also add -q or --quiet-pull to all tests. * Add test case for skipping backends while pruning * Adjusted test logging, generate new test spec file * Gitignore for temp test file
31 lines
736 B
Bash
31 lines
736 B
Bash
#!/bin/sh
|
|
# This test refers to https://github.com/offen/docker-volume-backup/issues/71
|
|
|
|
set -e
|
|
|
|
cd $(dirname $0)
|
|
. ../util.sh
|
|
current_test=$(basename $(pwd))
|
|
|
|
mkdir -p local
|
|
|
|
docker compose up -d --quiet-pull
|
|
sleep 5
|
|
|
|
docker compose exec backup backup
|
|
|
|
tmp_dir=$(mktemp -d)
|
|
sudo tar --same-owner -xvf ./local/backup.tar.gz -C $tmp_dir
|
|
|
|
sudo find $tmp_dir/backup/postgres > /dev/null
|
|
pass "Backup contains files at expected location"
|
|
|
|
for file in $(sudo find $tmp_dir/backup/postgres); do
|
|
if [ "$(sudo stat -c '%u:%g' $file)" != "70:70" ]; then
|
|
fail "Unexpected file ownership for $file: $(sudo stat -c '%u:%g' $file)"
|
|
fi
|
|
done
|
|
pass "All files and directories in backup preserved their ownership."
|
|
|
|
docker compose down --volumes
|