From 8d0fb77942a1bef345ccae990705f9b34193666e Mon Sep 17 00:00:00 2001 From: chaganti_rajitha Date: Fri, 10 Jan 2025 12:09:50 +0530 Subject: [PATCH 1/4] fixed UT --- service/controller.go | 3 ++- service/features/replication.feature | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/service/controller.go b/service/controller.go index 9fea16f3..91bbfe20 100644 --- a/service/controller.go +++ b/service/controller.go @@ -84,6 +84,7 @@ const ( PGSuffix = "PG" notFound = "not found" // error message from s.GetVolumeByID when volume not found cannotBeFound = "Could not find" // error message from pmax when volume not found + errorNotFound = "cannot be found" failedToValidateVolumeNameAndID = "Failed to validate combination of Volume Name and Volume ID" IscsiTransportProtocol = "ISCSI" FcTransportProtocol = "FC" @@ -3945,7 +3946,7 @@ func (s *service) DeleteStorageProtectionGroup(ctx context.Context, req *csiext. } sg, err := pmaxClient.GetProtectedStorageGroup(ctx, symID, protectionGroupID) if err != nil { - if strings.Contains(err.Error(), cannotBeFound) { + if strings.Contains(err.Error(), cannotBeFound) || strings.Contains(err.Error(), errorNotFound) { // The protected storage group is already deleted log.Info(fmt.Sprintf("DeleteStorageProtectionGroup: Could not find protected SG: %s on SymID: %s so assume it's already deleted", protectionGroupID, symID)) return &csiext.DeleteStorageProtectionGroupResponse{}, nil diff --git a/service/features/replication.feature b/service/features/replication.feature index ff3c0c21..bf805473 100644 --- a/service/features/replication.feature +++ b/service/features/replication.feature @@ -216,7 +216,7 @@ Feature: PowerMax CSI Interface Then the error contains Examples: | induced | errormsg | - | "GetProtectedStorageGroupError" | "cannot be found" | + | "GetProtectedStorageGroupError" | "can't be found" | | "RDFGroupHasPairError" | "it is not empty" | | "DeleteStorageGroupError" | "Error deleting storage group" | | "FetchResponseError" | "GetProtectedStorageGroup failed" | From e7d85aa73ec1eec8cb541c343cb22bfb0aa0c08b Mon Sep 17 00:00:00 2001 From: chaganti_rajitha Date: Fri, 10 Jan 2025 12:38:40 +0530 Subject: [PATCH 2/4] fixed UT case --- service/features/replication.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/service/features/replication.feature b/service/features/replication.feature index bf805473..170e4b03 100644 --- a/service/features/replication.feature +++ b/service/features/replication.feature @@ -216,7 +216,6 @@ Feature: PowerMax CSI Interface Then the error contains Examples: | induced | errormsg | - | "GetProtectedStorageGroupError" | "can't be found" | | "RDFGroupHasPairError" | "it is not empty" | | "DeleteStorageGroupError" | "Error deleting storage group" | | "FetchResponseError" | "GetProtectedStorageGroup failed" | From 6dc7a89c0505bf64c23c039c65d179d24888f3ba Mon Sep 17 00:00:00 2001 From: chaganti_rajitha Date: Fri, 10 Jan 2025 13:35:29 +0530 Subject: [PATCH 3/4] added empty string --- service/features/replication.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/service/features/replication.feature b/service/features/replication.feature index 170e4b03..0683234c 100644 --- a/service/features/replication.feature +++ b/service/features/replication.feature @@ -216,6 +216,7 @@ Feature: PowerMax CSI Interface Then the error contains Examples: | induced | errormsg | + | "GetProtectedStorageGroupError" | "" | | "RDFGroupHasPairError" | "it is not empty" | | "DeleteStorageGroupError" | "Error deleting storage group" | | "FetchResponseError" | "GetProtectedStorageGroup failed" | From 564d5ad9e743f991fe8b4322ebd9a19801d815ec Mon Sep 17 00:00:00 2001 From: chaganti_rajitha Date: Fri, 10 Jan 2025 14:01:42 +0530 Subject: [PATCH 4/4] added test case --- service/features/replication.feature | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/service/features/replication.feature b/service/features/replication.feature index 0683234c..c9da114f 100644 --- a/service/features/replication.feature +++ b/service/features/replication.feature @@ -205,6 +205,16 @@ Feature: PowerMax CSI Interface And I call DeleteStorageProtectionGroup on "csi-rep-sg-csi-test-13-ASYNC" Then no error was received + @srdf + @v1.6.0 + Scenario: DeleteStorageProtectionGroup with no error + Given a PowerMax service + And I call RDF enabled CreateVolume "volume1" in namespace "csi-test", mode "ASYNC" and RDFGNo 13 + And a valid CreateVolumeResponse is returned + Then I induce error "GetProtectedStorageGroupError" + And I call DeleteStorageProtectionGroup on "csi-rep-sg-csi-test-13-ASYNC" + Then no error was received + @srdf @v1.6.0 Scenario Outline: DeleteStorageProtectionGroup with different error @@ -216,7 +226,6 @@ Feature: PowerMax CSI Interface Then the error contains Examples: | induced | errormsg | - | "GetProtectedStorageGroupError" | "" | | "RDFGroupHasPairError" | "it is not empty" | | "DeleteStorageGroupError" | "Error deleting storage group" | | "FetchResponseError" | "GetProtectedStorageGroup failed" |