e2e: update snapshot restore e2e to check data consistency

Currently, in rbd snapshot restore and volume clone E2E we
are not checking any data consistency after doing snapshot
restore or volume clone. Hence, this PR writes the data in
the PVC and checks the checksum of the file and verify it with
the snapshot or cloned PVC.

Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
Yati Padia
2020-10-13 11:04:55 +05:30
committed by mergify[bot]
parent bad7d56ef4
commit cfb6abc067
5 changed files with 154 additions and 20 deletions

View File

@ -205,7 +205,7 @@ var _ = Describe("CephFS Upgrade Testing", func() {
e2elog.Logf("Calculating checksum of %s", filePath)
checkSum, err = calculateSHA512sum(f, app, filePath, &opt)
if err != nil {
e2elog.Failf("failed to calculate checksum of %s", filePath)
e2elog.Failf("failed to calculate checksum with error %v", err)
}
// pvc clone is only supported from v1.16+
@ -273,10 +273,9 @@ var _ = Describe("CephFS Upgrade Testing", func() {
}
mountPath := appClone.Spec.Containers[0].VolumeMounts[0].MountPath
testFilePath := filepath.Join(mountPath, "testClone")
newCheckSum, err = calculateSHA512sum(f, appClone, testFilePath, &opt)
if err != nil {
e2elog.Failf("failed to calculate checksum of %s", testFilePath)
e2elog.Failf("failed to calculate checksum with error %v", err)
}
if strings.Compare(newCheckSum, checkSum) != 0 {
@ -337,7 +336,7 @@ var _ = Describe("CephFS Upgrade Testing", func() {
testFilePath := filepath.Join(mountPath, "testClone")
newCheckSum, err = calculateSHA512sum(f, appClone, testFilePath, &opt)
if err != nil {
e2elog.Failf("failed to calculate checksum of %s", testFilePath)
e2elog.Failf("failed to calculate checksum with error %v", err)
}
if strings.Compare(newCheckSum, checkSum) != 0 {