From 0d9af1017bc2a8820eb55198eacf3a44251bc277 Mon Sep 17 00:00:00 2001 From: danfengl Date: Tue, 14 Jun 2022 08:14:12 +0000 Subject: [PATCH] Fix wrong bucket issue in BSL deletion E2E test Signed-off-by: danfengl --- test/e2e/bsl-mgmt/deletion.go | 4 ++-- test/e2e/util/providers/common.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/bsl-mgmt/deletion.go b/test/e2e/bsl-mgmt/deletion.go index b60531346..e5dd0a6b5 100644 --- a/test/e2e/bsl-mgmt/deletion.go +++ b/test/e2e/bsl-mgmt/deletion.go @@ -221,7 +221,7 @@ func BslDeletionTest(useVolumeSnapshots bool) { snapshotCheckPoint, err = GetSnapshotCheckPoint(client, VeleroCfg, 1, bslDeletionTestNs, backupName_1, []string{podName_1}) Expect(err).NotTo(HaveOccurred(), "Fail to get Azure CSI snapshot checkpoint") Expect(SnapshotsShouldBeCreatedInCloud(VeleroCfg.CloudProvider, - VeleroCfg.CloudCredentialsFile, VeleroCfg.AdditionalBSLBucket, + VeleroCfg.CloudCredentialsFile, VeleroCfg.BSLBucket, VeleroCfg.BSLConfig, backupName_1, snapshotCheckPoint)).To(Succeed()) }) By(fmt.Sprintf("Snapshot of bsl %s should be created in cloud object store", backupLocation_2), func() { @@ -231,7 +231,7 @@ func BslDeletionTest(useVolumeSnapshots bool) { if VeleroCfg.CloudProvider == "vsphere" { BSLCredentials = VeleroCfg.AdditionalBSLCredentials BSLConfig = VeleroCfg.AdditionalBSLConfig - } else { + } else { // Snapshotting with non-vSphere provider has nothing to do with BSL BSLCredentials = VeleroCfg.CloudCredentialsFile BSLConfig = VeleroCfg.BSLConfig } diff --git a/test/e2e/util/providers/common.go b/test/e2e/util/providers/common.go index 4ca8ac143..2a4e2218b 100644 --- a/test/e2e/util/providers/common.go +++ b/test/e2e/util/providers/common.go @@ -36,9 +36,9 @@ type ObjectsInStorage interface { func ObjectsShouldBeInBucket(cloudProvider, cloudCredentialsFile, bslBucket, bslPrefix, bslConfig, backupName, subPrefix string) error { fmt.Printf("|| VERIFICATION || - %s %s should exist in storage [%s]\n", subPrefix, backupName, bslPrefix) - exist, _ := IsObjectsInBucket(cloudProvider, cloudCredentialsFile, bslBucket, bslPrefix, bslConfig, backupName, subPrefix) + exist, err := IsObjectsInBucket(cloudProvider, cloudCredentialsFile, bslBucket, bslPrefix, bslConfig, backupName, subPrefix) if !exist { - return errors.New(fmt.Sprintf("|| UNEXPECTED ||Backup object %s is not exist in object store after backup as expected\n", backupName)) + return errors.Wrap(err, fmt.Sprintf("|| UNEXPECTED ||Backup object %s is not exist in object store after backup as expected\n", backupName)) } fmt.Printf("|| EXPECTED || - Backup %s exist in object storage bucket %s\n", backupName, bslBucket) return nil