You've already forked docker-volume-backup
mirror of
https://github.com/offen/docker-volume-backup.git
synced 2025-11-23 21:44:40 +02:00
* Current test setup is too restrictive, allow running a series of executables in different contexts instead * Split existing tests that test against swarm
40 lines
716 B
Bash
Executable File
40 lines
716 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd $(dirname $0)
|
|
. ../util.sh
|
|
current_test=$(basename $(pwd))
|
|
|
|
export LOCAL_DIR=$(mktemp -d)
|
|
|
|
docker compose up -d --quiet-pull
|
|
sleep 5
|
|
|
|
# The default configuration in docker-compose.yml should
|
|
# successfully create a backup.
|
|
docker compose exec backup backup
|
|
|
|
sleep 5
|
|
|
|
expect_running_containers "3"
|
|
|
|
if [ ! -f "$LOCAL_DIR/test.tar.gz" ]; then
|
|
fail "Archive was not created"
|
|
fi
|
|
pass "Found relevant archive file."
|
|
|
|
# Disabling POST should make the backup run fail
|
|
ALLOW_POST="0" docker compose up -d
|
|
sleep 5
|
|
|
|
set +e
|
|
docker compose exec backup backup
|
|
if [ $? = "0" ]; then
|
|
fail "Expected invocation to exit non-zero."
|
|
fi
|
|
set -e
|
|
pass "Invocation exited non-zero."
|
|
|
|
docker compose down --volumes
|