Skip to content

Commit

Permalink
Verify the correctness of the backup created
Browse files Browse the repository at this point in the history
Co-authored-by: Chris <github.account@chrigel.net>
  • Loading branch information
cimnine and ccremer committed Mar 9, 2021
1 parent c076240 commit 317f882
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 6 additions & 5 deletions e2e/definitions/subject/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ spec:
spec:
containers:
- name: subject-container
image: quay.io/bitnami/redis:latest
image: quay.io/prometheus/busybox:latest
imagePullPolicy: IfNotPresent
args:
- sh
- -c
- "echo MagicString > /data/expectation.txt && echo 'test file written, sleeping now' && sleep infinity"
securityContext:
runAsUser: $ID
env:
- name: REDIS_PASSWORD
value: ThePassword
volumeMounts:
- name: volume
mountPath: /bitnami/redis/data
mountPath: /data
volumes:
- name: volume
persistentVolumeClaim:
Expand Down
8 changes: 8 additions & 0 deletions e2e/test-01-backup.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ DEBUG_DETIK="true"

echo -n "Number of Snapshots >= 1? "
jq -e 'length >= 1' <<< "${output}" # Ensure that there was actually a backup created

run restic dump latest '/data/subject-pvc/expectation.txt'

echo "---BEGIN actual expectation.txt---"
echo "${output}"
echo "---END---"

[ "${output}" == "$(< debug/data/pvc-subject/expectation.txt)" ]
}

0 comments on commit 317f882

Please sign in to comment.