Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(IAM Policy Management): Update check for authorization policy subject and add test coverage #5144

Merged
merged 3 commits into from Mar 4, 2024

Conversation

swcolley
Copy link
Contributor

@swcolley swcolley commented Feb 20, 2024

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #2212

This adds test cases to make sure stringMatch is valid as well as fixes an input check for authorization policy.

Output from acceptance testing:

All of the authorization tests:

$ go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMAuthorizationPolicy_ -timeout 700m -v
...
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	357.904s
```

Tests added for each policy type
Access group test:
```sh
$ go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMAccessGroupPolicy_StringMatch_Without_Wildcard -timeout 700m -v
...
=== RUN   TestAccIBMIAMAccessGroupPolicy_StringMatch_Without_Wildcard
--- PASS: TestAccIBMIAMAccessGroupPolicy_StringMatch_Without_Wildcard (23.43s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	26.051s

service policy test:

$ go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMServicePolicy_With_Resource_Attributes_Without_Wildcard -timeout 700m -v
=== RUN   TestAccIBMIAMServicePolicy_With_Resource_Attributes_Without_Wildcard
--- PASS: TestAccIBMIAMServicePolicy_With_Resource_Attributes_Without_Wildcard (23.87s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	25.931s

trusted profile test

=== RUN   TestAccIBMIAMTrustedProfilePolicy_With_Resource_Attributes_Without_Wildcard
--- PASS: TestAccIBMIAMTrustedProfilePolicy_With_Resource_Attributes_Without_Wildcard (28.18s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	30.317s

user policy test

--- PASS: TestAccIBMIAMUserPolicy_With_Resource_Attributes_Without_Wildcard (33.04s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	35.134s

…ject and add test coverage

Signed-off-by: Shaun Colley <shaun.colley@ibm.com>
Signed-off-by: Shaun Colley <shaun.colley@ibm.com>
@swcolley swcolley marked this pull request as ready for review February 20, 2024 15:19
Signed-off-by: Shaun Colley <shaun.colley@ibm.com>
@swcolley
Copy link
Contributor Author

User policy acceptance test ran against fixed case:

go test ./ibm/service/iampolicy/ -run=TestAccIBMIAMUserPolicy_With_Resource_Attributes_Without_Wildcard -timeout 700m -v
...
=== RUN   TestAccIBMIAMUserPolicy_With_Resource_Attributes_Without_Wildcard
--- PASS: TestAccIBMIAMUserPolicy_With_Resource_Attributes_Without_Wildcard (28.01s)
PASS
ok  	github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/iampolicy	30.253s

@hkantare hkantare merged commit c146be1 into IBM-Cloud:master Mar 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants