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

[Resource] PolicySet test will not re-record and does not unwrap service error #6008

Closed
tjprescott opened this issue Apr 4, 2018 · 3 comments
Assignees
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Test Framework
Milestone

Comments

@tjprescott
Copy link
Member

tjprescott commented Apr 4, 2018

The test test_resource_policyset will not re-record. It fails on Bad Request when trying to create the policy assignment with the newly created set-definition. The test has been marked with @live_only to unblock unrelated changes in Network.

There are two issues:

  1. The policy assignment create step in the test fails.
  2. The command does not properly unwrap the error from the service. Running the command manually with --debug I got the following error trace:
msrest.http_logger : b'{"error":{"code":"InvalidPolicySku","message":"The policy assignment \'<null>\' is 
invalid because it references a policy set definition (\'/subscriptions/0b1f6471-1bf0-4dda-aec3-
cb9272f09590/providers/Microsoft.Authorization/policySetDefinitions/test-policy1\') and has missing or 
unsupported Sku: \'{\\"name\\":\\"A0\\",\\"tier\\":\\"Free\\"}\'. To assign a policy set definition, use one 
of the following SKUs which support this feature: \'[{\\"name\\":\\"A1\\",\\"tier\\":\\"Standard\\"}]\'."}}'
msrest.exceptions : Operation returned an invalid status code 'Bad Request'

So the test should be fixed, but also the exception handler should be fixed to unwrap and expose this error.


Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

@tjprescott tjprescott changed the title [Resource] PolicySet test will not re-record [Resource] PolicySet test will not re-record and does not unwrap service error Apr 4, 2018
@mozehgir mozehgir added ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group and removed Resource Manager labels Aug 14, 2019
@Juliehzl
Copy link
Contributor

Thanks for your feedback. I will look into it soon.

@haroldrandom haroldrandom added ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Test Framework labels Oct 25, 2019
@Juliehzl Juliehzl removed their assignment Dec 23, 2019
@yonzhan yonzhan added this to the S165 milestone Dec 26, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 26, 2019

add to S165.

@zhoxing-ms
Copy link
Contributor

I ran the test again and found that the problem could not be repeated. I will remove @live_only to add this test case to the CI process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Test Framework
Projects
None yet
Development

No branches or pull requests

8 participants