Skip to content

Commit

Permalink
OCM-10606 | test: fix id:74402
Browse files Browse the repository at this point in the history
  • Loading branch information
AkashKanni committed Aug 22, 2024
1 parent 14c6f5b commit 156495c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/e2e/test_rosacli_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ var _ = Describe("Account roles with attaching arbitrary policies",
arbitraryPoliciesToClean []string
awsClient *aws_client.AWSClient
err error
roleUrlPrefix = "https://console.aws.amazon.com/iam/home?#/roles/"
)

BeforeEach(func() {
Expand Down Expand Up @@ -605,9 +606,14 @@ var _ = Describe("Account roles with attaching arbitrary policies",
for roleName, policyArns := range accountRolePoliciesMap1 {
out, err := arbitraryPolicyService.AttachPolicy(roleName, policyArns, "--mode", "auto")
Expect(err).To(BeNil())
for _, policyArn := range policyArns {
Expect(out.String()).To(ContainSubstring("Attached policy '%s' to role '%s'", policyArn, roleName))
}
Expect(out.String()).To(
Or(
ContainSubstring(fmt.Sprintf(
"Attached policy '%s' to role '%s(%s)'", policyArns[0], roleName, roleUrlPrefix+roleName)),
ContainSubstring(fmt.Sprintf(
"Attached policy '%s' to role '%s(%s)'", policyArns[1], roleName, roleUrlPrefix+roleName)),
),
)
}

By("Detach and delete redhat managed policies from worker role")
Expand All @@ -631,7 +637,7 @@ var _ = Describe("Account roles with attaching arbitrary policies",
for _, policyArn := range policyArns {
Expect(out.String()).
To(
ContainSubstring("Attached policy '%s' to role '%s'", policyArn, roleName))
ContainSubstring("Attached policy '%s' to role '%s(%s)'", policyArn, roleName, roleUrlPrefix+roleName))
}
}
By("Upgrade account-roles in auto mode")
Expand Down

0 comments on commit 156495c

Please sign in to comment.