7 changed files with 68 additions and 68 deletions
@ -1,8 +1,6 @@
|
||||
.travis.yml |
||||
Dockerfile.* |
||||
Makefile |
||||
Readme.md |
||||
docker-compose.yaml |
||||
docker-compose-test-s3.yml |
||||
test.sh |
||||
itest.sh |
||||
test-s3.sh |
||||
tests/ |
||||
|
@ -1,47 +0,0 @@
|
||||
#! /bin/bash |
||||
set -e |
||||
|
||||
echo "Performing backup tests" |
||||
|
||||
echo "Verify cron and crontab exist" |
||||
type cron |
||||
type crontab |
||||
|
||||
echo "Create test data..." |
||||
mkdir -p /data && echo Test > /data/test.txt |
||||
|
||||
echo "Making backup..." |
||||
/backup.sh |
||||
|
||||
echo "Verify backup..." |
||||
/verify.sh |
||||
|
||||
echo "Delete test data..." |
||||
rm -fr /data/* |
||||
|
||||
echo "Verify deleted..." |
||||
test -f /data/test.txt && exit 1 || echo "Gone" |
||||
|
||||
echo "Restore backup..." |
||||
/restore.sh |
||||
|
||||
echo "Verify backup..." |
||||
/verify.sh |
||||
|
||||
echo "Delete test data again..." |
||||
rm -fr /data/* |
||||
|
||||
echo "Verify deleted..." |
||||
test -f /data/test.txt && exit 1 || echo "Gone" |
||||
|
||||
echo "Simulate a restart with RESTORE_ON_EMPTY_START..." |
||||
RESTORE_ON_EMPTY_START=true /entrypoint.sh |
||||
|
||||
echo "Verify restore happened..." |
||||
test -f /data/test.txt |
||||
|
||||
echo "Verify restore with incorrect passphrase fails..." |
||||
export PASSPHRASE=Incorrect.Mule.Solar.Paperclip |
||||
|
||||
echo "Fail to restore backup..." |
||||
/restore.sh && exit 1 || echo "OK" |
@ -1,10 +0,0 @@
|
||||
#! /bin/bash |
||||
|
||||
image=$1 |
||||
|
||||
# Run the test script within the container |
||||
docker run --rm \ |
||||
-e SKIP_ON_START=true \ |
||||
-v "$(pwd)/itest.sh:/itest.sh" \ |
||||
$image \ |
||||
bash -c "/itest.sh" |
@ -0,0 +1,58 @@
|
||||
#! /bin/bash |
||||
|
||||
image=$1 |
||||
|
||||
if [ "$IN_CONTAINER" != "true" ] ; then |
||||
# Run the test script within the container |
||||
docker run --rm \ |
||||
-e IN_CONTAINER=true \ |
||||
-e SKIP_ON_START=true \ |
||||
-v "$(pwd)/test.sh:/test.sh" \ |
||||
$image \ |
||||
bash -c "/test.sh" |
||||
else |
||||
echo "Performing backup tests" |
||||
|
||||
echo "Verify cron and crontab exist" |
||||
type cron |
||||
type crontab |
||||
|
||||
echo "Create test data..." |
||||
mkdir -p /data && echo Test > /data/test.txt |
||||
|
||||
echo "Making backup..." |
||||
/backup.sh |
||||
|
||||
echo "Verify backup..." |
||||
/verify.sh |
||||
|
||||
echo "Delete test data..." |
||||
rm -fr /data/* |
||||
|
||||
echo "Verify deleted..." |
||||
test -f /data/test.txt && exit 1 || echo "Gone" |
||||
|
||||
echo "Restore backup..." |
||||
/restore.sh |
||||
|
||||
echo "Verify backup..." |
||||
/verify.sh |
||||
|
||||
echo "Delete test data again..." |
||||
rm -fr /data/* |
||||
|
||||
echo "Verify deleted..." |
||||
test -f /data/test.txt && exit 1 || echo "Gone" |
||||
|
||||
echo "Simulate a restart with RESTORE_ON_EMPTY_START..." |
||||
RESTORE_ON_EMPTY_START=true /entrypoint.sh |
||||
|
||||
echo "Verify restore happened..." |
||||
test -f /data/test.txt |
||||
|
||||
echo "Verify restore with incorrect passphrase fails..." |
||||
export PASSPHRASE=Incorrect.Mule.Solar.Paperclip |
||||
|
||||
echo "Fail to restore backup..." |
||||
/restore.sh && exit 1 || echo "OK" |
||||
fi |
Loading…
Reference in new issue