Skip to content

Commit

Permalink
Merge pull request #390 from vshn/272EnhanceE2EBackupVerification
Browse files Browse the repository at this point in the history
Verify the correctness of a backup
  • Loading branch information
cimnine authored Mar 9, 2021
2 parents c076240 + 317f882 commit 5f73273
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 5f73273

Please sign in to comment.