mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-12-23 01:20:20 +01:00
Test compose timeout option
This commit is contained in:
parent
410a0ab898
commit
0282514b2b
@ -27,7 +27,7 @@ pass "Found relevant files in untared remote backups."
|
||||
|
||||
# The second part of this test checks if backups get deleted when the retention
|
||||
# is set to 0 days (which it should not as it would mean all backups get deleted)
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
docker compose exec backup backup
|
||||
@ -40,7 +40,7 @@ pass "Remote backups have not been deleted."
|
||||
# The third part of this test checks if old backups get deleted when the retention
|
||||
# is set to 7 days (which it should)
|
||||
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create first backup with no prune"
|
||||
@ -63,4 +63,4 @@ test -f ./local/test.tar.gz
|
||||
|
||||
pass "Old remote backup has been pruned, new one is still present."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -40,4 +40,4 @@ docker run --rm \
|
||||
|
||||
pass "Found relevant files in untared remote backups."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -29,7 +29,7 @@ if [ -f ./backup/data/post.txt ]; then
|
||||
fi
|
||||
pass "Did not find unexpected file."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
sudo rm -rf ./local
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ docker compose up -d --quiet-pull
|
||||
# sleep until a backup is guaranteed to have happened on the 1 minute schedule
|
||||
sleep 100
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
||||
if [ ! -f ./local/conf.tar.gz ]; then
|
||||
fail "Config from file was not used."
|
||||
|
@ -28,7 +28,7 @@ fi
|
||||
|
||||
# The second part of this test checks if backups get deleted when the retention
|
||||
# is set to 0 days (which it should not as it would mean all backups get deleted)
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
logs=$(docker compose exec -T backup backup)
|
||||
@ -43,7 +43,7 @@ fi
|
||||
# The third part of this test checks if old backups get deleted when the retention
|
||||
# is set to 7 days (which it should)
|
||||
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create second backup and prune"
|
||||
@ -61,5 +61,5 @@ else
|
||||
fi
|
||||
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
rm user_v2_ready.yaml
|
||||
|
@ -26,4 +26,4 @@ if [ ! -f "./local/app_data/offen.db" ]; then
|
||||
fail "Could not find expected file in untared archive."
|
||||
fi
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -30,4 +30,4 @@ if [ ! -L ./local/test-latest.tar.gz.gpg ]; then
|
||||
fail "Could not find local symlink to latest encrypted backup."
|
||||
fi
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -12,7 +12,7 @@ docker compose up -d --quiet-pull
|
||||
sleep 5
|
||||
docker compose exec backup backup
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
||||
out=$(mktemp -d)
|
||||
sudo tar --same-owner -xvf ./local/test.tar.gz -C "$out"
|
||||
|
@ -41,7 +41,7 @@ pass "Found symlink to latest version in local backup."
|
||||
|
||||
# The second part of this test checks if backups get deleted when the retention
|
||||
# is set to 0 days (which it should not as it would mean all backups get deleted)
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
docker compose exec backup backup
|
||||
@ -54,7 +54,7 @@ pass "Local backups have not been deleted."
|
||||
# The third part of this test checks if old backups get deleted when the retention
|
||||
# is set to 7 days (which it should)
|
||||
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create first backup with no prune"
|
||||
@ -70,4 +70,4 @@ test -f ./local/test-hostnametoken.tar.gz
|
||||
|
||||
pass "Old remote backup has been pruned, new one is still present."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -22,9 +22,9 @@ if [ "$NUM_MESSAGES" != 0 ]; then
|
||||
fi
|
||||
pass "No notifications were sent when not configured."
|
||||
|
||||
docker compose down
|
||||
docker compose down --timeout 3
|
||||
|
||||
NOTIFICATION_URLS="gotify://gotify/${GOTIFY_TOKEN}?disableTLS=true" docker compose up -d
|
||||
NOTIFICATION_URLS="gotify://gotify/${GOTIFY_TOKEN}?disableTLS=true" docker compose up -d --timeout 3
|
||||
|
||||
docker compose exec backup backup
|
||||
|
||||
@ -47,4 +47,4 @@ if [ "$MESSAGE_BODY" != "Backing up /tmp/test.tar.gz succeeded." ]; then
|
||||
fi
|
||||
pass "Custom notification body was used."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -27,4 +27,4 @@ for file in $(sudo find $tmp_dir/backup/postgres); do
|
||||
done
|
||||
pass "All files and directories in backup preserved their ownership."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -29,7 +29,7 @@ docker run --rm \
|
||||
|
||||
# Skip s3 backend from prune
|
||||
|
||||
docker compose up -d
|
||||
docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create backup with no prune for s3 backend"
|
||||
@ -50,7 +50,7 @@ pass "Old remote backup has been pruned locally, skipped S3 backend is untouched
|
||||
|
||||
touch -r ./local/test-hostnametoken.tar.gz -d "14 days ago" ./local/test-hostnametoken-old.tar.gz
|
||||
|
||||
docker compose up -d
|
||||
docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create backup with no prune for both backends"
|
||||
@ -67,4 +67,4 @@ docker run --rm \
|
||||
|
||||
pass "Skipped all backends while pruning."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -24,7 +24,7 @@ pass "Found relevant files in untared remote backups."
|
||||
|
||||
# The second part of this test checks if backups get deleted when the retention
|
||||
# is set to 0 days (which it should not as it would mean all backups get deleted)
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
docker compose exec backup backup
|
||||
@ -39,7 +39,7 @@ pass "Remote backups have not been deleted."
|
||||
# The third part of this test checks if old backups get deleted when the retention
|
||||
# is set to 7 days (which it should)
|
||||
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create first backup with no prune"
|
||||
@ -60,4 +60,4 @@ docker run --rm \
|
||||
|
||||
pass "Old remote backup has been pruned, new one is still present."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
@ -25,6 +25,6 @@ if [ "$(cat ./backup/data/whoami.txt)" != "$user_name" ]; then
|
||||
fi
|
||||
pass "Found expected user."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
sudo rm -rf ./local
|
||||
|
||||
|
@ -24,7 +24,7 @@ pass "Found relevant files in untared remote backup."
|
||||
|
||||
# The second part of this test checks if backups get deleted when the retention
|
||||
# is set to 0 days (which it should not as it would mean all backups get deleted)
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
docker compose exec backup backup
|
||||
@ -39,7 +39,7 @@ pass "Remote backups have not been deleted."
|
||||
# The third part of this test checks if old backups get deleted when the retention
|
||||
# is set to 7 days (which it should)
|
||||
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d --timeout 3
|
||||
sleep 5
|
||||
|
||||
info "Create first backup with no prune"
|
||||
@ -62,4 +62,4 @@ docker run --rm \
|
||||
|
||||
pass "Old remote backup has been pruned, new one is still present."
|
||||
|
||||
docker compose down --volumes
|
||||
docker compose down --volumes --timeout 3
|
||||
|
Loading…
Reference in New Issue
Block a user