Skip to content

Commit

Permalink
Merge pull request #2492 from yuwang-RH/new0924
Browse files Browse the repository at this point in the history
OCM-11406 | test: fix id: 74225
  • Loading branch information
openshift-merge-bot[bot] authored Sep 25, 2024
2 parents daac0f7 + dac224a commit 792d558
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/test_rosacli_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
19 changes: 10 additions & 9 deletions tests/e2e/test_rosacli_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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]",
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 792d558

Please sign in to comment.