Skip to content

Commit

Permalink
Define custom platform for HSM tests
Browse files Browse the repository at this point in the history
Resolves Azure#16483
  • Loading branch information
heaths committed Feb 5, 2021
1 parent d020098 commit 319ec99
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
19 changes: 7 additions & 12 deletions sdk/keyvault/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@
"description": "Whether to enable soft delete for the Key Vault. The default is true."
}
},
"keyVaultDomainSuffix": {
"type": "string",
"defaultValue": ".vault.azure.net",
"metadata": {
"description": "Domain suffix for sovereign clouds, requires the preceding '.'. The default uses the public Azure Cloud (.vault.azure.net)"
}
},
"keyVaultSku": {
"type": "string",
"defaultValue": "premium",
Expand All @@ -73,7 +66,8 @@
}
},
"variables": {
"azureKeyVaultUrl": "[format('https://{0}{1}', parameters('baseName'), parameters('keyVaultDomainSuffix'))]",
"kvApiVersion": "2019-09-01",
"kvName": "[parameters('baseName')]",
"hsmApiVersion": "2020-04-01-preview",
"hsmName": "[concat(parameters('baseName'), 'hsm')]",
"mgmtApiVersion": "2019-04-01",
Expand All @@ -99,8 +93,8 @@
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"apiVersion": "2016-10-01",
"name": "[parameters('baseName')]",
"apiVersion": "[variables('kvApiVersion')]",
"name": "[variables('kvName')]",
"location": "[parameters('location')]",
"properties": {
"sku": {
Expand Down Expand Up @@ -165,7 +159,8 @@
"enabledForDeployment": false,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": false,
"enableSoftDelete": "[parameters('enableSoftDelete')]"
"enableSoftDelete": "[parameters('enableSoftDelete')]",
"softDeleteRetentionInDays": 7
}
},
{
Expand Down Expand Up @@ -240,7 +235,7 @@
"outputs": {
"AZURE_KEYVAULT_URL": {
"type": "string",
"value": "[variables('azureKeyVaultUrl')]"
"value": "[reference(variables('kvName')).vaultUri]"
},
"AZURE_MANAGEDHSM_URL": {
"type": "string",
Expand Down
8 changes: 8 additions & 0 deletions sdk/keyvault/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ extends:
# Runs samples with live tests.
# THIS VARIABLE IS A ONE-OFF WORKAROUND FOR KEYVAULT TESTS SPECIFICALLY, DON'T COPY IT
AZURE_KEYVAULT_TEST_MODE: Live

# Managed HSMs can be allocated 1 per subscription per region.
# Declare a custom platform to limit test runs to a single HSM.
AdditionalPlatforms:
Linux_HSM:
OSVmImage: "ubuntu-18.04"
TestTargetFramework: netcoreapp2.1
ArmTemplateParameters: "@{enableHsm = $true}"

0 comments on commit 319ec99

Please sign in to comment.