diff --git a/tests/e2e/test_rosacli_cluster.go b/tests/e2e/test_rosacli_cluster.go index 10dac12fa..2c4e932d5 100644 --- a/tests/e2e/test_rosacli_cluster.go +++ b/tests/e2e/test_rosacli_cluster.go @@ -3237,12 +3237,12 @@ var _ = Describe("Reusing opeartor prefix and oidc config to create clsuter", la keysToUntag := []string{versionTagName} err = awsClient.UntagPolicy(operatorPolicyArn, keysToUntag) - Expect(err).To(BeNil()) + Expect(err).To(BeNil(), fmt.Sprintf("Expected no error, but got: %v", err)) tags := map[string]string{versionTagName: testingRoleVersion} err = awsClient.TagPolicy(operatorPolicyArn, tags) - Expect(err).To(BeNil()) + Expect(err).To(BeNil(), fmt.Sprintf("Expected no error, but got: %v", err)) By("Reuse operatot-role prefix and oidc config to create cluster with non-compatible version") diff --git a/tests/e2e/test_rosacli_policy.go b/tests/e2e/test_rosacli_policy.go index ebc7288f5..e04fdc73a 100644 --- a/tests/e2e/test_rosacli_policy.go +++ b/tests/e2e/test_rosacli_policy.go @@ -344,14 +344,6 @@ var _ = Describe("Validation testing", err := rosaClient.CleanResources(clusterID) Expect(err).ToNot(HaveOccurred()) - By("Delete arbitrary policies") - if len(arbitraryPoliciesToClean) > 0 { - for _, policyArn := range arbitraryPoliciesToClean { - err = awsClient.DeletePolicy(policyArn) - Expect(err).To(BeNil()) - } - } - By("Delete the testing role") if len(testingRolesToClean) > 0 { for _, roleName := range testingRolesToClean { @@ -365,6 +357,14 @@ var _ = Describe("Validation testing", Expect(err).To(BeNil()) } } + + By("Delete arbitrary policies") + if len(arbitraryPoliciesToClean) > 0 { + for _, policyArn := range arbitraryPoliciesToClean { + err = awsClient.DeletePolicy(policyArn) + Expect(err).To(BeNil()) + } + } }) It("to check the validations for attaching and detaching arbitrary policies - [id:74225]", @@ -454,7 +454,7 @@ var _ = Describe("Validation testing", policyArnsWithTen := arbitraryPoliciesToClean[0:10] out, err = arbitraryPolicyService.AttachPolicy(supportRoleName, policyArnsWithTen, "--mode", "auto") Expect(err).NotTo(BeNil()) - Expect(out.String()).To(ContainSubstring("Failed to attach policies due to quota limitations (total limit: 10")) + Expect(out.String()).To(ContainSubstring("Cannot exceed quota for PoliciesPerRole: 10")) By("role has no red-hat-managed=true tag when attach") out, err = arbitraryPolicyService.AttachPolicy(notRHManagedRoleName, policyArns, "--mode", "auto") @@ -645,6 +645,7 @@ var _ = Describe("Account roles with attaching arbitrary policies", ContainSubstring("Attached policy '%s' to role '%s(%s)'", policyArn, roleName, roleUrlPrefix+roleName)) } } + By("Upgrade account-roles in auto mode") output, err = ocmResourceService.UpgradeAccountRole( "--prefix", aRolePrefix,