add test for using docker cli

This commit is contained in:
Frederik Ring
2021-07-11 13:27:01 +02:00
parent 8a385d22aa
commit da75d232f4
5 changed files with 81 additions and 11 deletions

26
test/compose/run.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
set -e
cd $(dirname $0)
docker-compose up -d
sleep 5
docker-compose exec backup backup
docker run --rm -it \
-v compose_backup_data:/data alpine \
ash -c 'tar -xf /data/backup/test.tar.gz && test -f /backup/app_data/offen.db'
echo "[TEST:PASS] Found relevant files in untared backup."
if [ "$(docker-compose ps -q | wc -l)" != "3" ]; then
echo "[TEST:FAIL] Expected all containers to be running post backup, instead seen:"
docker-compose ps
exit 1
fi
echo "[TEST:PASS] All containers running post backup."
docker-compose down --volumes