forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial stab at making the multiple registry support work * Update TODO * update TODO * merge fixes * add logic to find registry credentials * Code cleanup and adding unit tests * updates to the registry class * In Progress work * Working publish * Move _push_image_from_local_registry and copy_image into the registry class * tidy up changes * Namespace and style fixes * Minor input config change * unit tests * Do not push image namespace to target ACR * Make sure not to break the nexus part of the code * Update CHANGELOG * initial commit for integration tests * Fix error not being caught correctly * Minor comment change * Fix integration tests * Moving files around * Working vnf integration test * Comment out test that is not working * Clean up the structure of the integration tests * Delete unnecessary tests * Fix CNF test and move a util function * fix other integration tests * Delete the broken tests folder * Fix the vnf test * move files around * Improve the update_input_file function * improve the nsd test * Move files around and improve the nsd output * remove unnecessary line * Update recording processors and recordings * Fix linting issues * bad merge change * Update the nsd output with Open CGVs * Fix few unit tests broken by merge * Markups --------- Co-authored-by: Andy Churchard <[email protected]> Co-authored-by: Jordan <[email protected]>
- Loading branch information
1 parent
0c90032
commit 6ed34e0
Showing
85 changed files
with
7,788 additions
and
2,090 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
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
...st/integration_tests/integration_test_mocks/mock_input_templates/cnf_input_template.jsonc
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,30 @@ | ||
{ | ||
// Azure location to use when creating resources. | ||
"location": "uksouth", | ||
// Name of the Publisher resource you want your definition published to. | ||
// Will be created if it does not exist. | ||
"publisher_name": "automated-cli-tests-nginx-publisher", | ||
// Optional. Resource group for the Publisher resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"publisher_resource_group_name": "{{publisher_resource_group_name}}", | ||
// Optional. Name of the ACR Artifact Store resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"acr_artifact_store_name": "nginx-acr", | ||
// Name of NF definition. | ||
"nf_name": "nginx", | ||
// Version of the NF definition in A.B.C format. | ||
"version": "1.0.0", | ||
// List of registries from which to pull the image(s). | ||
// For example [sourceacr.azurecr.io/test, myacr2.azurecr.io]. | ||
"image_sources": ["docker.io"], | ||
|
||
// List of Helm packages to be included in the CNF. | ||
"helm_packages": [ | ||
{ | ||
"name": "nginxdemo", | ||
"path_to_chart": "{{path_to_chart}}", | ||
"default_values": "", | ||
"depends_on": [] | ||
} | ||
] | ||
} |
20 changes: 20 additions & 0 deletions
20
...ntegration_tests/integration_test_mocks/mock_input_templates/cnf_nsd_input_template.jsonc
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,20 @@ | ||
{ | ||
"publisher_name": "automated-cli-tests-nginx-publisher", | ||
"publisher_resource_group_name": "{{publisher_resource_group_name}}", | ||
"acr_artifact_store_name": "nginx-nsd-acr", | ||
"location": "uksouth", | ||
"network_functions": [ | ||
{ | ||
"publisher": "automated-cli-tests-nginx-publisher", | ||
"publisher_resource_group": "{{publisher_resource_group_name}}", | ||
"name": "nginx-nfdg", | ||
"version": "1.0.0", | ||
"publisher_offering_location": "uksouth", | ||
"type": "cnf", | ||
"multiple_instances": false | ||
} | ||
], | ||
"nsd_name": "nginx-nsdg", | ||
"nsd_version": "1.0.0", | ||
"nsdv_description": "Deploys a basic NGINX CNF" | ||
} |
52 changes: 52 additions & 0 deletions
52
...st/integration_tests/integration_test_mocks/mock_input_templates/input_multi_nf_nsd.jsonc
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,52 @@ | ||
{ | ||
"location": "uksouth", | ||
"publisher_name": "automated-cli-tests-ubuntu-publisher", | ||
"publisher_resource_group_name": "cli_test_nsd", | ||
"acr_artifact_store_name": "ubuntu-acr", | ||
"resource_element_templates": [ | ||
{ | ||
"resource_element_type": "NF", | ||
"properties": { | ||
// The name of the existing publisher for the NSD. | ||
"publisher": "automated-cli-tests-ubuntu-publisher", | ||
// The resource group that the publisher is hosted in. | ||
"publisher_resource_group": "cli_test_nsd", | ||
// The name of the existing Network Function Definition Group to deploy using this NSD. | ||
"name": "ubuntu-vm", | ||
// The version of the existing Network Function Definition to base this NSD on. | ||
// This NSD will be able to deploy any NFDV with deployment parameters compatible with this version. | ||
"version": "1.0.0", | ||
// The region that the NFDV is published to. | ||
"publisher_offering_location": "uksouth", | ||
// Type of Network Function. Valid values are 'cnf' or 'vnf'. | ||
"type": "vnf", | ||
// Set to true or false. Whether the NSD should allow arbitrary numbers of this type of NF. If false only a single instance will be allowed. Only supported on VNFs, must be set to false on CNFs. | ||
"multiple_instances": "false" | ||
} | ||
}, | ||
{ | ||
"resource_element_type": "NF", | ||
"properties": { | ||
// The name of the existing publisher for the NSD. | ||
"publisher": "automated-cli-tests-ubuntu-publisher", | ||
// The resource group that the publisher is hosted in. | ||
"publisher_resource_group": "cli_test_nsd", | ||
// The name of the existing Network Function Definition Group to deploy using this NSD. | ||
"name": "nginx", | ||
// The version of the existing Network Function Definition to base this NSD on. | ||
// This NSD will be able to deploy any NFDV with deployment parameters compatible with this version. | ||
"version": "1.0.0", | ||
// The region that the NFDV is published to. | ||
"publisher_offering_location": "uksouth", | ||
// Type of Network Function. Valid values are 'cnf' or 'vnf'. | ||
"type": "cnf", | ||
// Set to true or false. Whether the NSD should allow arbitrary numbers of this type of NF. If false only a single instance will be allowed. Only supported on VNFs, must be set to false on CNFs. | ||
"multiple_instances": "false" | ||
} | ||
} | ||
], | ||
"nfvi_type": "AzureCore", | ||
"nsd_name": "multi-nf", | ||
"nsd_version": "1.0.0", | ||
"nsdv_description": "Plain ubuntu VM" | ||
} |
32 changes: 32 additions & 0 deletions
32
...egration_tests/integration_test_mocks/mock_input_templates/input_multiple_instances.jsonc
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,32 @@ | ||
{ | ||
"location": "uksouth", | ||
"publisher_name": "automated-cli-tests-ubuntu-publisher", | ||
"publisher_resource_group_name": "cli_test_nsd", | ||
"acr_artifact_store_name": "ubuntu-acr", | ||
"resource_element_templates": [ | ||
{ | ||
"resource_element_type": "NF", | ||
"properties": { | ||
// The name of the existing publisher for the NSD. | ||
"publisher": "automated-cli-tests-ubuntu-publisher", | ||
// The resource group that the publisher is hosted in. | ||
"publisher_resource_group": "cli_test_nsd", | ||
// The name of the existing Network Function Definition Group to deploy using this NSD. | ||
"name": "ubuntu-vm", | ||
// The version of the existing Network Function Definition to base this NSD on. | ||
// This NSD will be able to deploy any NFDV with deployment parameters compatible with this version. | ||
"version": "1.0.0", | ||
// The region that the NFDV is published to. | ||
"publisher_offering_location": "uksouth", | ||
// Type of Network Function. Valid values are 'cnf' or 'vnf'. | ||
"type": "vnf", | ||
// Set to true or false. Whether the NSD should allow arbitrary numbers of this type of NF. If false only a single instance will be allowed. Only supported on VNFs, must be set to false on CNFs. | ||
"multiple_instances": "true" | ||
} | ||
} | ||
], | ||
"nfvi_type": "AzureCore", | ||
"nsd_name": "ubuntu", | ||
"nsd_version": "1.0.0", | ||
"nsdv_description": "Plain ubuntu VM" | ||
} |
32 changes: 32 additions & 0 deletions
32
...latest/integration_tests/integration_test_mocks/mock_input_templates/nsd_core_input.jsonc
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,32 @@ | ||
{ | ||
"location": "uksouth", | ||
"publisher_name": "automated-cli-tests-ubuntu-publisher", | ||
"publisher_resource_group_name": "test_publisher_name", | ||
"acr_artifact_store_name": "ubuntu-acr", | ||
"resource_element_templates": [ | ||
{ | ||
"resource_element_type": "NF", | ||
"properties": { | ||
// The name of the existing publisher for the NSD. | ||
"publisher": "automated-cli-tests-ubuntu-publisher", | ||
// The resource group that the publisher is hosted in. | ||
"publisher_resource_group": "test_publisher_name", | ||
// The name of the existing Network Function Definition Group to deploy using this NSD. | ||
"name": "ubuntu-vm", | ||
// The version of the existing Network Function Definition to base this NSD on. | ||
// This NSD will be able to deploy any NFDV with deployment parameters compatible with this version. | ||
"version": "1.0.0", | ||
// The region that the NFDV is published to. | ||
"publisher_offering_location": "uksouth", | ||
// Type of Network Function. Valid values are 'cnf' or 'vnf'. | ||
"type": "vnf", | ||
// Set to true or false. Whether the NSD should allow arbitrary numbers of this type of NF. If false only a single instance will be allowed. Only supported on VNFs, must be set to false on CNFs. | ||
"multiple_instances": "false" | ||
} | ||
} | ||
], | ||
"nfvi_type": "AzureCore", | ||
"nsd_name": "ubuntu", | ||
"nsd_version": "1.0.0", | ||
"nsdv_description": "Plain ubuntu VM" | ||
} |
33 changes: 33 additions & 0 deletions
33
...st/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_template.jsonc
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,33 @@ | ||
{ | ||
// Azure location to use when creating resources. | ||
"location": "uksouth", | ||
// Name of the Publisher resource you want your definition published to. | ||
// Will be created if it does not exist. | ||
"publisher_name": "automated-cli-tests-ubuntu-publisher", | ||
// Optional. Resource group for the Publisher resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"publisher_resource_group_name": "{{publisher_resource_group_name}}", | ||
// Optional. Name of the ACR Artifact Store resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"acr_artifact_store_name": "ubuntu-acr", | ||
// Name of NF definition. | ||
"nf_name": "ubuntu-vm", | ||
// Version of the NF definition in A.B.C format. | ||
"version": "1.0.0", | ||
// Optional. Name of the storage account Artifact Store resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"blob_artifact_store_name": "ubuntu-blob-store", | ||
// ARM template configuration. | ||
"arm_templates": [ | ||
{ | ||
"artifact_name": "automated-cli-tests-artifact", | ||
"file_path": "{{arm_template_path}}", | ||
"version": "1.0.0" | ||
} | ||
], | ||
"vhd": { | ||
"artifact_name": "automated-cli-tests-vhd", | ||
"file_path": "{{vhd_path}}", | ||
"version": "1-0-0" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...tests/integration_test_mocks/mock_input_templates/vnf_input_with_sas_token_template.jsonc
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,46 @@ | ||
{ | ||
// Azure location to use when creating resources. | ||
"location": "uksouth", | ||
// Name of the Publisher resource you want your definition published to. | ||
// Will be created if it does not exist. | ||
"publisher_name": "automated-cli-tests-ubuntu-publisher", | ||
// Optional. Resource group for the Publisher resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"publisher_resource_group_name": "{{publisher_resource_group_name}}", | ||
// Optional. Name of the ACR Artifact Store resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"acr_artifact_store_name": "ubuntu-acr", | ||
// Name of NF definition. | ||
"nf_name": "ubuntu-vm", | ||
// Version of the NF definition in A.B.C format. | ||
"version": "1.0.0", | ||
// Optional. Name of the storage account Artifact Store resource. | ||
// Will be created if it does not exist (with a default name if none is supplied). | ||
"blob_artifact_store_name": "ubuntu-blob-store", | ||
// ARM template configuration. | ||
"arm_templates": [ | ||
{ | ||
"artifact_name": "automated-cli-tests-artifact", | ||
"file_path": "{{arm_template_path}}", | ||
"version": "1.0.0" | ||
} | ||
], | ||
// VHD image configuration. | ||
"vhd": { | ||
// Version of the artifact in A-B-C format. Note the '-' (dash) not '.' (dot). | ||
"version": "1-0-0", | ||
// Supply either file_path or blob_sas_url, not both. | ||
// SAS URL of the blob artifact you wish to copy to your Artifact Store. | ||
// Leave as empty string if not required. Use Linux slash (/) file separator even if running on Windows. | ||
"blob_sas_url": "https://a/dummy/sas-url", | ||
// Optional. Specifies the size of empty data disks in gigabytes. | ||
// This value cannot be larger than 1023 GB. Delete if not required. | ||
"image_disk_size_GB": "30", | ||
// Optional. Specifies the HyperVGenerationType of the VirtualMachine created from the image. | ||
// Valid values are V1 and V2. V1 is the default if not specified. Delete if not required. | ||
"image_hyper_v_generation": "V1", | ||
// Optional. The ARM API version used to create the Microsoft.Compute/images resource. | ||
// Delete if not required. | ||
"image_api_version": "2023-03-01" | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ntegration_tests/integration_test_mocks/mock_input_templates/vnf_nsd_input_template.jsonc
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,32 @@ | ||
{ | ||
"location": "uksouth", | ||
"publisher_name": "automated-cli-tests-ubuntu-publisher", | ||
"publisher_resource_group_name": "{{publisher_resource_group_name}}", | ||
"acr_artifact_store_name": "ubuntu-acr", | ||
"resource_element_templates": [ | ||
{ | ||
"resource_element_type": "NF", | ||
"properties": { | ||
// The name of the existing publisher for the NSD. | ||
"publisher": "automated-cli-tests-ubuntu-publisher", | ||
// The resource group that the publisher is hosted in. | ||
"publisher_resource_group": "{{publisher_resource_group_name}}", | ||
// The name of the existing Network Function Definition Group to deploy using this NSD. | ||
"name": "ubuntu-vm", | ||
// The version of the existing Network Function Definition to base this NSD on. | ||
// This NSD will be able to deploy any NFDV with deployment parameters compatible with this version. | ||
"version": "1.0.0", | ||
// The region that the NFDV is published to. | ||
"publisher_offering_location": "uksouth", | ||
// Type of Network Function. Valid values are 'cnf' or 'vnf'. | ||
"type": "vnf", | ||
// Set to true or false. Whether the NSD should allow arbitrary numbers of this type of NF. If false only a single instance will be allowed. Only supported on VNFs, must be set to false on CNFs. | ||
"multiple_instances": "false" | ||
} | ||
} | ||
], | ||
"nfvi_type": "AzureCore", | ||
"nsd_name": "ubuntu", | ||
"nsd_version": "1.0.0", | ||
"nsdv_description": "Plain ubuntu VM" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...zext_aosm/tests/latest/integration_tests/nsd_output/test_build/all_deploy.parameters.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,10 @@ | ||
{ | ||
"location": "uksouth", | ||
"publisherName": "automated-cli-tests-ubuntu-publisher", | ||
"publisherResourceGroupName": "test_publisher_name", | ||
"acrArtifactStoreName": "ubuntu-acr", | ||
"acrManifestName": "ubuntu-nsd-manifest-1-0-0", | ||
"nsDesignGroup": "ubuntu", | ||
"nsDesignVersion": "1.0.0", | ||
"nfviSiteName": "ubuntu_NFVI" | ||
} |
40 changes: 40 additions & 0 deletions
40
...t_aosm/tests/latest/integration_tests/nsd_output/test_build/artifactManifest/deploy.bicep
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,40 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
|
||
// This file creates an Artifact Manifest for a NSD | ||
param location string | ||
@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') | ||
param publisherName string | ||
@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') | ||
param acrArtifactStoreName string | ||
@description('Name of the Artifact Manifest to create') | ||
param acrManifestName string | ||
|
||
// The publisher resource is the top level AOSM resource under which all other designer resources | ||
// are created. | ||
// If using publish command, this is created from deploying the nsdbase.bicep | ||
resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { | ||
name: publisherName | ||
} | ||
|
||
// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. | ||
// If using publish command, this is created from deploying the nsdbase.bicep | ||
resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { | ||
parent: publisher | ||
name: acrArtifactStoreName | ||
} | ||
|
||
// Artifact manifest from ARMTemplate and NF RET artifacts | ||
resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = { | ||
parent: acrArtifactStore | ||
name: acrManifestName | ||
location: location | ||
properties: { | ||
artifacts: [ | ||
{ | ||
artifactName: 'ubuntu' | ||
artifactType: 'OCIArtifact' | ||
artifactVersion: '1.0.0' | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.