From 317f882a03fc10db145e6b659c297a5736622367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Tue, 9 Mar 2021 15:47:07 +0100 Subject: [PATCH] Verify the correctness of the backup created Co-authored-by: Chris --- e2e/definitions/subject/deployment.yaml | 11 ++++++----- e2e/test-01-backup.bats | 8 ++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/e2e/definitions/subject/deployment.yaml b/e2e/definitions/subject/deployment.yaml index 17cd8815e..d14183e4e 100644 --- a/e2e/definitions/subject/deployment.yaml +++ b/e2e/definitions/subject/deployment.yaml @@ -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: diff --git a/e2e/test-01-backup.bats b/e2e/test-01-backup.bats index 8660434b6..0d86a0b83 100644 --- a/e2e/test-01-backup.bats +++ b/e2e/test-01-backup.bats @@ -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)" ] }