mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user