docker-volume-backup/test/default/test.sh

25 lines
457 B
Bash
Raw Normal View History

2021-07-09 08:14:35 +02:00
#!/bin/sh
set -e
2021-07-09 09:21:42 +02:00
cd $(dirname $0)
docker-compose up -d
sleep 5
docker-compose exec backup backup
docker run --rm -it \
-v default_backup_data:/data alpine \
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/app_data/offen.db'
if [ "$(docker-compose ps -q | wc -l)" != "3" ]; then
echo "Expected all containers to be running post backup, instead seen:"
docker-compose ps
exit 1
fi
2021-07-09 09:21:42 +02:00
docker-compose down --volumes
echo "Test passed"