forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moved working tests to new folder structure; added empty tests for processors and build * added empty generate cofnig tests; fixed and moved bicep,artifact and definitino folder builder tests * added nexus arm tests; removed outdated vnf mocks * added azure core tests for every function (including base) * fixed up core and nexus arm processor * fixed up arm processors; added logging to tests * added arm template tests * added test from copilot learning day * changed assert * removed build folder; added json dump to artifact and definition tests; improved arm processor testing * removed mock open and replaced with new templates * fixed linting --------- Co-authored-by: Jordan <[email protected]>
- Loading branch information
Showing
35 changed files
with
820 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
src/aosm/azext_aosm/tests/latest/mock_arm_templates/no-params-template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.15.31.15270", | ||
"templateHash": "1656082395923655778" | ||
} | ||
}, | ||
"variables": { | ||
"imageResourceGroup": "[resourceGroup().name]", | ||
"subscriptionId": "[subscription().subscriptionId]", | ||
"vmSizeSku": "Standard_D2s_v3" | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Network/networkInterfaces", | ||
"apiVersion": "2021-05-01", | ||
"name": "[format('{0}_nic', parameters('ubuntuVmName'))]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"ipConfigurations": [ | ||
{ | ||
"name": "ipconfig1", | ||
"properties": { | ||
"subnet": { | ||
"id": "[format('{0}/subnets/{1}', parameters('virtualNetworkId'), parameters('subnetName'))]" | ||
}, | ||
"primary": true, | ||
"privateIPAddressVersion": "IPv4" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.Compute/virtualMachines", | ||
"apiVersion": "2021-07-01", | ||
"name": "[parameters('ubuntuVmName')]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"hardwareProfile": { | ||
"vmSize": "[variables('vmSizeSku')]" | ||
}, | ||
"storageProfile": { | ||
"imageReference": { | ||
"id": "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', parameters('imageName'))]" | ||
}, | ||
"osDisk": { | ||
"osType": "Linux", | ||
"name": "[format('{0}_disk', parameters('ubuntuVmName'))]", | ||
"createOption": "FromImage", | ||
"caching": "ReadWrite", | ||
"writeAcceleratorEnabled": false, | ||
"managedDisk": "[json('{\"storageAccountType\": \"Premium_LRS\"}')]", | ||
"deleteOption": "Delete", | ||
"diskSizeGB": 30 | ||
} | ||
}, | ||
"osProfile": { | ||
"computerName": "[parameters('ubuntuVmName')]", | ||
"adminUsername": "azureuser", | ||
"linuxConfiguration": { | ||
"disablePasswordAuthentication": true, | ||
"ssh": { | ||
"publicKeys": [ | ||
{ | ||
"path": "/home/azureuser/.ssh/authorized_keys", | ||
"keyData": "[parameters('sshPublicKeyAdmin')]" | ||
} | ||
] | ||
}, | ||
"provisionVMAgent": true, | ||
"patchSettings": { | ||
"patchMode": "ImageDefault", | ||
"assessmentMode": "ImageDefault" | ||
} | ||
}, | ||
"secrets": [], | ||
"allowExtensionOperations": true | ||
}, | ||
"networkProfile": { | ||
"networkInterfaces": [ | ||
{ | ||
"id": "[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" | ||
} | ||
] | ||
} | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" | ||
] | ||
} | ||
] | ||
} |
102 changes: 102 additions & 0 deletions
102
src/aosm/azext_aosm/tests/latest/mock_arm_templates/simple-template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.15.31.15270", | ||
"templateHash": "1656082395923655778" | ||
} | ||
}, | ||
"parameters": { | ||
"location": { | ||
"type": "string", | ||
"defaultValue": "[resourceGroup().location]" | ||
} | ||
}, | ||
"variables": { | ||
"imageResourceGroup": "[resourceGroup().name]", | ||
"subscriptionId": "[subscription().subscriptionId]", | ||
"vmSizeSku": "Standard_D2s_v3" | ||
}, | ||
"resources": [ | ||
{ | ||
"type": "Microsoft.Network/networkInterfaces", | ||
"apiVersion": "2021-05-01", | ||
"name": "[format('{0}_nic', parameters('ubuntuVmName'))]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"ipConfigurations": [ | ||
{ | ||
"name": "ipconfig1", | ||
"properties": { | ||
"subnet": { | ||
"id": "[format('{0}/subnets/{1}', parameters('virtualNetworkId'), parameters('subnetName'))]" | ||
}, | ||
"primary": true, | ||
"privateIPAddressVersion": "IPv4" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "Microsoft.Compute/virtualMachines", | ||
"apiVersion": "2021-07-01", | ||
"name": "[parameters('ubuntuVmName')]", | ||
"location": "[parameters('location')]", | ||
"properties": { | ||
"hardwareProfile": { | ||
"vmSize": "[variables('vmSizeSku')]" | ||
}, | ||
"storageProfile": { | ||
"imageReference": { | ||
"id": "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', parameters('imageName'))]" | ||
}, | ||
"osDisk": { | ||
"osType": "Linux", | ||
"name": "[format('{0}_disk', parameters('ubuntuVmName'))]", | ||
"createOption": "FromImage", | ||
"caching": "ReadWrite", | ||
"writeAcceleratorEnabled": false, | ||
"managedDisk": "[json('{\"storageAccountType\": \"Premium_LRS\"}')]", | ||
"deleteOption": "Delete", | ||
"diskSizeGB": 30 | ||
} | ||
}, | ||
"osProfile": { | ||
"computerName": "[parameters('ubuntuVmName')]", | ||
"adminUsername": "azureuser", | ||
"linuxConfiguration": { | ||
"disablePasswordAuthentication": true, | ||
"ssh": { | ||
"publicKeys": [ | ||
{ | ||
"path": "/home/azureuser/.ssh/authorized_keys", | ||
"keyData": "[parameters('sshPublicKeyAdmin')]" | ||
} | ||
] | ||
}, | ||
"provisionVMAgent": true, | ||
"patchSettings": { | ||
"patchMode": "ImageDefault", | ||
"assessmentMode": "ImageDefault" | ||
} | ||
}, | ||
"secrets": [], | ||
"allowExtensionOperations": true | ||
}, | ||
"networkProfile": { | ||
"networkInterfaces": [ | ||
{ | ||
"id": "[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" | ||
} | ||
] | ||
} | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" | ||
] | ||
} | ||
] | ||
} |
File renamed without changes.
18 changes: 0 additions & 18 deletions
18
src/aosm/azext_aosm/tests/latest/mock_vnf_OUTDATED/input_with_filepath.json
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/aosm/azext_aosm/tests/latest/mock_vnf_OUTDATED/input_with_fp.json
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/aosm/azext_aosm/tests/latest/mock_vnf_OUTDATED/input_with_sas.json
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/aosm/azext_aosm/tests/latest/mock_vnf_OUTDATED/input_with_sas_token.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.