docker-volume-backup/test/swarm/run.sh
Frederik Ring 06bb25c980
Defining test sandbox in compose file allows testing against multi node swarm setup (#591)
* Defining test sandbox in compose file allows swapping with multi node swarm setup

* Test cases can request a multi node swarm cluster

* Docker healthchecks can be used for awaiting ready state

* Compose profiles can be used
2025-06-06 17:46:25 +02:00

27 lines
543 B
Bash
Executable file

#!/bin/sh
set -e
cd $(dirname $0)
. ../util.sh
current_test=$(basename $(pwd))
docker stack deploy --compose-file=docker-compose.yml test_stack
while [ -z $(docker ps -q -f name=backup) ]; do
info "Backup container not ready yet. Retrying."
sleep 1
done
sleep 20
docker exec $(docker ps -q -f name=backup) backup
docker run --rm \
-v backup_data:/data alpine \
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/pg_data/PG_VERSION'
pass "Found relevant files in untared backup."
sleep 5
expect_running_containers "5"