@@ -18,9 +18,9 @@ kill-containers() {
1818# make sure we are in this dir
1919CURRENT_DIR=$( cd $( dirname $0 ) ; pwd)
2020
21- puts-step " creating fake database credentials"
21+ puts-step " creating fake postgres credentials"
2222
23- # create fake database credentials
23+ # create fake postgres credentials
2424mkdir -p $CURRENT_DIR /tmp/creds
2525echo " testuser" > $CURRENT_DIR /tmp/creds/user
2626echo " icanttellyou" > $CURRENT_DIR /tmp/creds/password
@@ -66,11 +66,11 @@ sleep 90s
6666# display logs for debugging purposes
6767puts-step " displaying minio logs"
6868docker logs $MINIO_JOB
69- puts-step " displaying database logs"
69+ puts-step " displaying postgres logs"
7070docker logs $PG_JOB
7171
7272# check if postgres is running
73- puts-step " checking if database is running"
73+ puts-step " checking if postgres is running"
7474docker exec $PG_JOB is_running
7575
7676# check if minio has the 5 backups
@@ -80,3 +80,19 @@ if [[ ! "$NUM_BACKUPS" -eq "5" ]]; then
8080 puts-error " did not find 5 base backups, which is the default (found $NUM_BACKUPS )"
8181 exit 1
8282fi
83+
84+ # kill off postgres, then reboot and see if it's running after recovering from backups
85+ puts-step " shutting off postgres, then rebooting to test data recovery"
86+ docker rm -f $PG_JOB
87+ PG_JOB=$( docker run -d --link $MINIO_JOB :minio -e BACKUP_FREQUENCY=1s -e DATABASE_STORAGE=minio -e DEIS_MINIO_SERVICE_HOST=minio -e DEIS_MINIO_SERVICE_PORT=9000 -v $CURRENT_DIR /tmp/creds:/var/run/secrets/deis/database/creds -v $CURRENT_DIR /tmp/aws-user:/var/run/secrets/deis/objectstore/creds $1 )
88+
89+ # wait for postgres to boot
90+ puts-step " sleeping for 90s while postgres is recovering from backup..."
91+ sleep 90s
92+
93+ puts-step " displaying postgres logs"
94+ docker logs $PG_JOB
95+
96+ # check if postgres is running
97+ puts-step " checking if postgres is running"
98+ docker exec $PG_JOB is_running
0 commit comments