You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Background
When attempting to run the Azure Key Vault PowerShell tests via the
`RunKeyVaultTests.ps1` script, the following 5 tests would fail:
```
Test_ImportByokWithDefaultAttributes
Test_ImportByokWith1024BitKey
Test_ImportByokWithCustomAttributes
Test_GetAllKeys
Test_GetKeyVersions
```
The first 3 BYOK tests failed because they test against dummy `.byok`
files that were generated with a specific subscription ID that may not
match the subscription ID of whomever is running the tests. The last 2
tests failed because they attempt to reference
`[Microsoft.WindowsAzure.Testing.TestUtilities]`, which cannot be found.
Moreover, this PowerShell script was difficult to use if we didn't want
to provide our own vault to test against for both the data plane and the
control plane, but we instead wanted the script to generate its own
temporary vault. Also, we sometimes would like to programmatically skip
Active Directory related tests for certain environments (instead of
having it hardcoded to always skip for Fairfax environments). Finally,
the PowerShell script could use some cleanup with respect to formatting
whitespace, fleshing out docstrings, and general organization.
## The Change
This change addresses the above issues by:
- Guarding the 3 BYOK tests with an if condition that tests the
subscription ID.
- Replacing `Wait($timeout * 1000)` with
`Start-Sleep -Seconds $timeout`.
- Saving/restoring temporary vault state for both the control plane and
data plane tests.
- Exposing the `$NoADCmdLetMode` parameter.
- Generally improving the coding style.
0 commit comments