From 6ed34e03f5ad24ddd14ec11cb7c7c5a616be58eb Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:20:30 +0000 Subject: [PATCH] Fix integration tests (#163) * 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 Co-authored-by: Jordan --- src/aosm/azext_aosm/common/artifact.py | 3 +- src/aosm/azext_aosm/common/utils.py | 11 +- .../builder/artifact_builder.py | 5 +- .../cnf_mocks/nginxdemo-0.1.0.tgz | Bin .../cnf_input_template.jsonc | 30 + .../cnf_nsd_input_template.jsonc | 20 + .../input_multi_nf_nsd.jsonc | 52 + .../input_multiple_instances.jsonc | 32 + .../mock_input_templates/nsd_core_input.jsonc | 32 + .../vnf_input_template.jsonc | 33 + .../vnf_input_with_sas_token_template.jsonc | 46 + .../vnf_nsd_input_template.jsonc | 32 + .../vnf_mocks/ubuntu.vhd | 0 .../vnf_mocks/ubuntu_template.json | 0 .../{ => integration_tests}/metaschema.json | 0 .../metaschema_modified.json | 0 .../test_build/all_deploy.parameters.json | 10 + .../test_build/artifactManifest/deploy.bicep | 40 + .../test_build/artifacts/artifacts.json | 9 + .../test_build/artifacts/ubuntu-vm.bicep | 42 + .../nsd_output/test_build/base/deploy.bicep | 34 + .../nsd_output/test_build/index.json | 22 + .../nsdDefinition/config-group-schema.json} | 22 +- .../test_build/nsdDefinition/deploy.bicep} | 23 +- .../nsdDefinition/ubuntu-mappings.json | 12 + .../all_deploy.parameters.json | 10 + .../artifactManifest/deploy.bicep | 40 + .../artifacts/artifacts.json | 9 + .../artifacts/ubuntu-vm.bicep | 42 + .../base/deploy.bicep | 34 + .../test_build_multiple_instances/index.json | 22 + .../nsdDefinition/config-group-schema.json | 46 + .../nsdDefinition/deploy.bicep} | 23 +- .../nsdDefinition/ubuntu-mappings.json | 12 + .../artifact_manifest.bicep | 0 .../nginx-nfdg_config_mapping.json | 0 .../ubuntu-nfdg_config_mapping.json | 0 .../nginx-nfdg_nf.bicep | 0 .../nsd_definition.bicep | 0 .../schemas/multinf_ConfigGroupSchema.json | 0 .../ubuntu-nfdg_nf.bicep | 0 .../scenario_tests}/recording_processors.py | 27 + .../test_cnf_nfd_build_and_publish.yaml | 1573 ++++++ .../test_vnf_nsd_build_and_publish.yaml | 4430 +++++++++++++++++ .../test_aosm_cnf_build_and_publish.py | 141 + .../test_aosm_vnf_build_and_publish.py | 124 + .../latest/integration_tests/test_cnf.py | 83 + .../latest/integration_tests/test_nsd.py | 419 ++ .../latest/integration_tests/test_vnf.py | 123 + .../tests/latest/integration_tests/utils.py | 59 + .../latest/mock_cnf/input-nfconfigchart.json | 21 - .../latest/mock_cnf/input-nfconfigchart.jsonc | 30 + .../latest/mock_core_vnf/input_with_fp.json | 32 +- .../tests/latest/mock_nsd/input.json | 20 - .../latest/mock_nsd/input_multi_nf_nsd.json | 29 - .../mock_nsd/input_multiple_instances.json | 20 - .../ubuntu-vm-nfdg_config_mapping.json | 9 - .../schemas/ubuntu_ConfigGroupSchema.json | 45 - .../test_build/ubuntu-vm-nfdg_nf.bicep | 72 - .../artifact_manifest.bicep | 39 - .../ubuntu-vm-nfdg_config_mapping.json | 7 - .../ubuntu-vm-nfdg_nf.bicep | 72 - .../artifact_manifest.bicep | 39 - .../cnf_input_template.json | 20 - .../cnf_nsd_input_template.json | 20 - .../mock_input_templates/nsd_input.json | 20 - .../mock_input_templates/vnf_input.json | 18 - .../vnf_input_template.json | 18 - .../vnf_nsd_input_template.json | 20 - .../test_aosm_cnf_publish_and_delete.py | 117 - .../tests/latest/test_aosm_scenario.py | 39 - .../test_aosm_vnf_publish_and_delete.py | 110 - .../tests/latest/test_arm_input_template.py | 12 - src/aosm/azext_aosm/tests/latest/test_cnf.py | 67 - src/aosm/azext_aosm/tests/latest/test_nsd.py | 393 -- src/aosm/azext_aosm/tests/latest/test_vnf.py | 93 - .../azext_aosm/tests/latest/tests_utils.py | 42 - .../broken_tests/test_artifact_definition.py | 119 - .../broken_tests/test_bicep_definition.py | 46 - .../broken_tests/test_core_vnf_build.py | 105 - .../broken_tests/test_definition_folder.py | 218 - .../broken_tests/test_nexus_vnf_build.py | 61 - .../test_nsd_cli_generate_config.py | 55 - .../test_artifact_builder.py | 10 +- .../tests/latest/unit_test/test_registry.py | 113 +- 85 files changed, 7788 insertions(+), 2090 deletions(-) rename src/aosm/azext_aosm/tests/latest/{scenario_test_mocks => integration_tests/integration_test_mocks}/cnf_mocks/nginxdemo-0.1.0.tgz (100%) create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_input_template.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_nsd_input_template.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multi_nf_nsd.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multiple_instances.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/nsd_core_input.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_template.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_with_sas_token_template.jsonc create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_nsd_input_template.jsonc rename src/aosm/azext_aosm/tests/latest/{scenario_test_mocks => integration_tests/integration_test_mocks}/vnf_mocks/ubuntu.vhd (100%) rename src/aosm/azext_aosm/tests/latest/{scenario_test_mocks => integration_tests/integration_test_mocks}/vnf_mocks/ubuntu_template.json (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/metaschema.json (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/metaschema_modified.json (100%) create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/all_deploy.parameters.json create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifactManifest/deploy.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/artifacts.json create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/ubuntu-vm.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/base/deploy.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/index.json rename src/aosm/azext_aosm/tests/latest/{nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json => integration_tests/nsd_output/test_build/nsdDefinition/config-group-schema.json} (56%) rename src/aosm/azext_aosm/tests/latest/{nsd_output/test_build/nsd_definition.bicep => integration_tests/nsd_output/test_build/nsdDefinition/deploy.bicep} (83%) create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/ubuntu-mappings.json create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/all_deploy.parameters.json create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifactManifest/deploy.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/artifacts.json create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/ubuntu-vm.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/base/deploy.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/index.json create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/config-group-schema.json rename src/aosm/azext_aosm/tests/latest/{nsd_output/test_build_multiple_instances/nsd_definition.bicep => integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/deploy.bicep} (83%) create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/ubuntu-mappings.json rename src/aosm/azext_aosm/tests/latest/{nsd_output/test_build => integration_tests/nsd_output/test_build_multiple_nfs}/artifact_manifest.bicep (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/nsd_output/test_build_multiple_nfs/nsd_definition.bicep (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests}/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep (100%) rename src/aosm/azext_aosm/tests/latest/{ => integration_tests/scenario_tests}/recording_processors.py (78%) create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_cnf_nfd_build_and_publish.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_vnf_nsd_build_and_publish.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_cnf_build_and_publish.py create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_vnf_build_and_publish.py create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/test_cnf.py create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/test_nsd.py create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/test_vnf.py create mode 100644 src/aosm/azext_aosm/tests/latest/integration_tests/utils.py delete mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.jsonc delete mode 100644 src/aosm/azext_aosm/tests/latest/mock_nsd/input.json delete mode 100644 src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json delete mode 100644 src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep delete mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json delete mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json delete mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json delete mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json delete mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json delete mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json delete mode 100644 src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py delete mode 100644 src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py delete mode 100644 src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py delete mode 100644 src/aosm/azext_aosm/tests/latest/test_arm_input_template.py delete mode 100644 src/aosm/azext_aosm/tests/latest/test_cnf.py delete mode 100644 src/aosm/azext_aosm/tests/latest/test_nsd.py delete mode 100644 src/aosm/azext_aosm/tests/latest/test_vnf.py delete mode 100644 src/aosm/azext_aosm/tests/latest/tests_utils.py delete mode 100644 src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_artifact_definition.py delete mode 100644 src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_bicep_definition.py delete mode 100644 src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_core_vnf_build.py delete mode 100644 src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_definition_folder.py delete mode 100644 src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nexus_vnf_build.py delete mode 100644 src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nsd_cli_generate_config.py diff --git a/src/aosm/azext_aosm/common/artifact.py b/src/aosm/azext_aosm/common/artifact.py index 3356b8c7d78..6a5be269c99 100644 --- a/src/aosm/azext_aosm/common/artifact.py +++ b/src/aosm/azext_aosm/common/artifact.py @@ -18,6 +18,7 @@ clean_registry_name, push_image_from_local_registry_to_acr, call_subprocess_raise_output, + check_tool_installed, ) from azext_aosm.configuration_models.common_parameters_config import ( BaseCommonParametersConfig, @@ -31,8 +32,6 @@ from azext_aosm.common.registry import ContainerRegistry, AzureContainerRegistry from azext_aosm.vendored_sdks.models import ArtifactType from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.common.command_context import CommandContext -from azext_aosm.common.utils import check_tool_installed, convert_bicep_to_arm from knack.util import CLIError from knack.log import get_logger from oras.client import OrasClient diff --git a/src/aosm/azext_aosm/common/utils.py b/src/aosm/azext_aosm/common/utils.py index 3950ab3063e..00cbb42feb5 100644 --- a/src/aosm/azext_aosm/common/utils.py +++ b/src/aosm/azext_aosm/common/utils.py @@ -2,20 +2,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +import json import re import os -import tarfile -from typing import Tuple -from pathlib import Path -from jinja2 import StrictUndefined, Template -import json import shutil import subprocess -from time import sleep import tarfile import tempfile +from typing import Tuple +from time import sleep from pathlib import Path -from typing import Union +from jinja2 import StrictUndefined, Template from knack.log import get_logger from knack.util import CLIError diff --git a/src/aosm/azext_aosm/definition_folder/builder/artifact_builder.py b/src/aosm/azext_aosm/definition_folder/builder/artifact_builder.py index e5c7055a2d0..38b71813751 100644 --- a/src/aosm/azext_aosm/definition_folder/builder/artifact_builder.py +++ b/src/aosm/azext_aosm/definition_folder/builder/artifact_builder.py @@ -35,9 +35,10 @@ def write(self): self.path.mkdir(exist_ok=True) artifacts_list = [] for artifact in self.artifacts: + artifact_dict = artifact.to_dict() logger.debug( - "Writing artifact %s as: %s", artifact.artifact_name, artifact.to_dict() + "Writing artifact %s as: %s", artifact.artifact_name, artifact_dict ) - artifacts_list.append(artifact.to_dict()) + artifacts_list.append(artifact_dict) (self.path / "artifacts.json").write_text(json.dumps(artifacts_list, indent=4)) self._write_supporting_files() diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz similarity index 100% rename from src/aosm/azext_aosm/tests/latest/scenario_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz rename to src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_input_template.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_input_template.jsonc new file mode 100644 index 00000000000..4e9b5820790 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_input_template.jsonc @@ -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": [] + } + ] +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_nsd_input_template.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_nsd_input_template.jsonc new file mode 100644 index 00000000000..e2306bbf75b --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/cnf_nsd_input_template.jsonc @@ -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" +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multi_nf_nsd.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multi_nf_nsd.jsonc new file mode 100644 index 00000000000..2f99944b6fb --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multi_nf_nsd.jsonc @@ -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" +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multiple_instances.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multiple_instances.jsonc new file mode 100644 index 00000000000..8596ecc527b --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/input_multiple_instances.jsonc @@ -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" +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/nsd_core_input.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/nsd_core_input.jsonc new file mode 100644 index 00000000000..2493cfffe04 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/nsd_core_input.jsonc @@ -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" +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_template.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_template.jsonc new file mode 100644 index 00000000000..220047d29ed --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_template.jsonc @@ -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" + } +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_with_sas_token_template.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_with_sas_token_template.jsonc new file mode 100644 index 00000000000..c8da07c4f08 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_input_with_sas_token_template.jsonc @@ -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" + } +} diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_nsd_input_template.jsonc b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_nsd_input_template.jsonc new file mode 100644 index 00000000000..77f51c15ea1 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/mock_input_templates/vnf_nsd_input_template.jsonc @@ -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" +} diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu.vhd b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/vnf_mocks/ubuntu.vhd similarity index 100% rename from src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu.vhd rename to src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/vnf_mocks/ubuntu.vhd diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu_template.json b/src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/vnf_mocks/ubuntu_template.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu_template.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/integration_test_mocks/vnf_mocks/ubuntu_template.json diff --git a/src/aosm/azext_aosm/tests/latest/metaschema.json b/src/aosm/azext_aosm/tests/latest/integration_tests/metaschema.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/metaschema.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/metaschema.json diff --git a/src/aosm/azext_aosm/tests/latest/metaschema_modified.json b/src/aosm/azext_aosm/tests/latest/integration_tests/metaschema_modified.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/metaschema_modified.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/metaschema_modified.json diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/all_deploy.parameters.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/all_deploy.parameters.json new file mode 100644 index 00000000000..bea62971479 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/all_deploy.parameters.json @@ -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" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifactManifest/deploy.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifactManifest/deploy.bicep new file mode 100644 index 00000000000..58fdfc5792d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifactManifest/deploy.bicep @@ -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' + } + ] + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/artifacts.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/artifacts.json new file mode 100644 index 00000000000..ec8ac11f130 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/artifacts.json @@ -0,0 +1,9 @@ +[ + { + "type": "ACRFromLocalFile", + "artifact_name": "ubuntu", + "artifact_type": "ArmTemplate", + "artifact_version": "1.0.0", + "file_path": "artifacts/ubuntu-vm.bicep" + } +] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/ubuntu-vm.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/ubuntu-vm.bicep new file mode 100644 index 00000000000..831d30fadc3 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/artifacts/ubuntu-vm.bicep @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@secure() +param configObject object + +var resourceGroupId = resourceGroup().id + +var identityObject = (configObject.managedIdentityId == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${configObject.managedIdentityId}': {} + } +} + +var nfdvSymbolicName = '${configObject.publisherName}/${configObject.nfdgName}/${configObject.nfdvName}' + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + name: nfdvSymbolicName + scope: resourceGroup(configObject.publisherResourceGroup) +} + +resource nfResource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in configObject.deploymentParameters: { + name: '${configObject.nfdgName}${i}' + location: configObject.location + identity: identityObject + properties: { + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } + nfviType: 'AzureCore' + nfviId: (configObject.customLocationId == '') ? resourceGroupId : configObject.customLocationId + allowSoftwareUpdate: true + configurationType: 'Open' + deploymentValues: string(values) + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/base/deploy.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/base/deploy.bicep new file mode 100644 index 00000000000..4be037aaa64 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/base/deploy.bicep @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates the base AOSM resources for a CNF +param location string +@description('Name of a publisher, expected to be in the resource group where you deploy the template') +param publisherName string +param acrArtifactStoreName string +@description('Name of an Network Service Design Group') +param nsDesignGroup string + +// The publisher resource is the top level AOSM resource under which all other designer resources +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' = { + name: publisherName + location: location + properties: { scope: 'Private'} +} + +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' = { + parent: publisher + name: acrArtifactStoreName + location: location + properties: { + storeType: 'AzureContainerRegistry' + } +} + +// The NSD Group is the parent resource under which all NSD versions will be created. +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' = { + parent: publisher + name: nsDesignGroup + location: location +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/index.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/index.json new file mode 100644 index 00000000000..8b5c7a1dce7 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/index.json @@ -0,0 +1,22 @@ +[ + { + "name": "base", + "type": "bicep", + "only_delete_on_clean": false + }, + { + "name": "artifactManifest", + "type": "bicep", + "only_delete_on_clean": false + }, + { + "name": "artifacts", + "type": "artifact", + "only_delete_on_clean": false + }, + { + "name": "nsdDefinition", + "type": "bicep", + "only_delete_on_clean": false + } +] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/config-group-schema.json similarity index 56% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/config-group-schema.json index 5393c2ba01f..0e348dab4f8 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/config-group-schema.json @@ -1,11 +1,14 @@ { "$schema": "https://json-schema.org/draft-07/schema#", - "title": "ubuntu_ConfigGroupSchema", + "title": "ConfigGroupSchema", "type": "object", "properties": { - "ubuntu-vm-nfdg": { + "ubuntu": { "type": "object", "properties": { + "nfdvName": { + "type": "string" + }, "deploymentParameters": { "type": "array", "items": { @@ -26,23 +29,18 @@ } } }, - "ubuntu_vm_nfdg_nfd_version": { - "type": "string", - "description": "The version of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-vm-nfdg." + "managedIdentityId": { + "type": "string" } }, "required": [ + "nfdvName", "deploymentParameters", - "ubuntu_vm_nfdg_nfd_version" + "managedIdentityId" ] - }, - "managedIdentity": { - "type": "string", - "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." } }, "required": [ - "ubuntu-vm-nfdg", - "managedIdentity" + "ubuntu" ] } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/deploy.bicep similarity index 83% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/deploy.bicep index fc8fc21b958..cbed2c7cce9 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/deploy.bicep @@ -19,19 +19,21 @@ param nfviSiteName string = 'ubuntu_NFVI' // 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 scope: resourceGroup() } // The artifact store is the resource in which all the artifacts required to deploy the NF are stored. -// The artifact store is created by the az aosm CLI before this template is deployed. +// 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 } -// Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. +// The NSD Group is the parent resource under which all NSD versions will be created. +// If using publish command, this is created from deploying the nsdbase.bicep resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' existing = { parent: publisher name: nsDesignGroup @@ -42,27 +44,26 @@ resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups // The operator will create a config group values object that will satisfy this schema. resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-09-01' = { parent: publisher - name: 'ubuntu_ConfigGroupSchema' + name: 'ConfigGroupSchema' location: location properties: { - schemaDefinition: string(loadJsonContent('schemas/ubuntu_ConfigGroupSchema.json')) + schemaDefinition: string(loadJsonContent('config-group-schema.json')) } } + // The NSD version +// This will deploy an NSDV in 'Preview' state. It should be changed to 'Active' once it is finalised. resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-09-01' = { parent: nsdGroup name: nsDesignVersion location: location properties: { description: 'Plain ubuntu VM' - // The version state can be Preview, Active or Deprecated. - // Once in an Active state, the NSDV becomes immutable. - versionState: 'Preview' // The `configurationgroupsSchemaReferences` field contains references to the schemas required to // be filled out to configure this NSD. configurationGroupSchemaReferences: { - ubuntu_ConfigGroupSchema: { + ConfigGroupSchema: { id: cgSchema.id } } @@ -77,7 +78,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou // to the values in the CG schemas. resourceElementTemplates: [ { - name: 'ubuntu-vm-nfdg_nf_artifact_resource_element' + name: 'ubuntu' // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. type: 'NetworkFunctionDefinition' // The configuration object may be different for different types of resource element. @@ -87,13 +88,13 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou artifactStoreReference: { id: acrArtifactStore.id } - artifactName: 'ubuntu-vm-nfdg_nf_artifact' + artifactName: 'ubuntu' artifactVersion: '1.0.0' } templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - parameterValues: string(loadJsonContent('configMappings/ubuntu-vm-nfdg_config_mapping.json')) + parameterValues: string(loadJsonContent('ubuntu-mappings.json')) } dependsOnProfile: { installDependsOn: [] diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/ubuntu-mappings.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/ubuntu-mappings.json new file mode 100644 index 00000000000..884e4561bf6 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build/nsdDefinition/ubuntu-mappings.json @@ -0,0 +1,12 @@ +{ + "configObject": { + "location": "uksouth", + "publisherName": "pub", + "nfdgName": "ubuntu", + "publisherResourceGroup": "rg", + "customLocationId": "", + "nfdvName": "{configurationparameters('ConfigGroupSchema').ubuntu.nfdvName}", + "deploymentParameters": "{configurationparameters('ConfigGroupSchema').ubuntu.deploymentParameters}", + "managedIdentityId": "{configurationparameters('ConfigGroupSchema').ubuntu.managedIdentityId}" + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/all_deploy.parameters.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/all_deploy.parameters.json new file mode 100644 index 00000000000..602dafdb049 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/all_deploy.parameters.json @@ -0,0 +1,10 @@ +{ + "location": "uksouth", + "publisherName": "automated-cli-tests-ubuntu-publisher", + "publisherResourceGroupName": "cli_test_nsd", + "acrArtifactStoreName": "ubuntu-acr", + "acrManifestName": "ubuntu-nsd-manifest-1-0-0", + "nsDesignGroup": "ubuntu", + "nsDesignVersion": "1.0.0", + "nfviSiteName": "ubuntu_NFVI" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifactManifest/deploy.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifactManifest/deploy.bicep new file mode 100644 index 00000000000..58fdfc5792d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifactManifest/deploy.bicep @@ -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' + } + ] + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/artifacts.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/artifacts.json new file mode 100644 index 00000000000..ec8ac11f130 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/artifacts.json @@ -0,0 +1,9 @@ +[ + { + "type": "ACRFromLocalFile", + "artifact_name": "ubuntu", + "artifact_type": "ArmTemplate", + "artifact_version": "1.0.0", + "file_path": "artifacts/ubuntu-vm.bicep" + } +] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/ubuntu-vm.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/ubuntu-vm.bicep new file mode 100644 index 00000000000..831d30fadc3 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/artifacts/ubuntu-vm.bicep @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@secure() +param configObject object + +var resourceGroupId = resourceGroup().id + +var identityObject = (configObject.managedIdentityId == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${configObject.managedIdentityId}': {} + } +} + +var nfdvSymbolicName = '${configObject.publisherName}/${configObject.nfdgName}/${configObject.nfdvName}' + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + name: nfdvSymbolicName + scope: resourceGroup(configObject.publisherResourceGroup) +} + +resource nfResource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in configObject.deploymentParameters: { + name: '${configObject.nfdgName}${i}' + location: configObject.location + identity: identityObject + properties: { + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } + nfviType: 'AzureCore' + nfviId: (configObject.customLocationId == '') ? resourceGroupId : configObject.customLocationId + allowSoftwareUpdate: true + configurationType: 'Open' + deploymentValues: string(values) + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/base/deploy.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/base/deploy.bicep new file mode 100644 index 00000000000..4be037aaa64 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/base/deploy.bicep @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates the base AOSM resources for a CNF +param location string +@description('Name of a publisher, expected to be in the resource group where you deploy the template') +param publisherName string +param acrArtifactStoreName string +@description('Name of an Network Service Design Group') +param nsDesignGroup string + +// The publisher resource is the top level AOSM resource under which all other designer resources +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' = { + name: publisherName + location: location + properties: { scope: 'Private'} +} + +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' = { + parent: publisher + name: acrArtifactStoreName + location: location + properties: { + storeType: 'AzureContainerRegistry' + } +} + +// The NSD Group is the parent resource under which all NSD versions will be created. +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' = { + parent: publisher + name: nsDesignGroup + location: location +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/index.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/index.json new file mode 100644 index 00000000000..8b5c7a1dce7 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/index.json @@ -0,0 +1,22 @@ +[ + { + "name": "base", + "type": "bicep", + "only_delete_on_clean": false + }, + { + "name": "artifactManifest", + "type": "bicep", + "only_delete_on_clean": false + }, + { + "name": "artifacts", + "type": "artifact", + "only_delete_on_clean": false + }, + { + "name": "nsdDefinition", + "type": "bicep", + "only_delete_on_clean": false + } +] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/config-group-schema.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/config-group-schema.json new file mode 100644 index 00000000000..0e348dab4f8 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/config-group-schema.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "ConfigGroupSchema", + "type": "object", + "properties": { + "ubuntu": { + "type": "object", + "properties": { + "nfdvName": { + "type": "string" + }, + "deploymentParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + } + } + } + }, + "managedIdentityId": { + "type": "string" + } + }, + "required": [ + "nfdvName", + "deploymentParameters", + "managedIdentityId" + ] + } + }, + "required": [ + "ubuntu" + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/deploy.bicep similarity index 83% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/deploy.bicep index fc8fc21b958..cbed2c7cce9 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/deploy.bicep @@ -19,19 +19,21 @@ param nfviSiteName string = 'ubuntu_NFVI' // 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 scope: resourceGroup() } // The artifact store is the resource in which all the artifacts required to deploy the NF are stored. -// The artifact store is created by the az aosm CLI before this template is deployed. +// 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 } -// Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. +// The NSD Group is the parent resource under which all NSD versions will be created. +// If using publish command, this is created from deploying the nsdbase.bicep resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' existing = { parent: publisher name: nsDesignGroup @@ -42,27 +44,26 @@ resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups // The operator will create a config group values object that will satisfy this schema. resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-09-01' = { parent: publisher - name: 'ubuntu_ConfigGroupSchema' + name: 'ConfigGroupSchema' location: location properties: { - schemaDefinition: string(loadJsonContent('schemas/ubuntu_ConfigGroupSchema.json')) + schemaDefinition: string(loadJsonContent('config-group-schema.json')) } } + // The NSD version +// This will deploy an NSDV in 'Preview' state. It should be changed to 'Active' once it is finalised. resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-09-01' = { parent: nsdGroup name: nsDesignVersion location: location properties: { description: 'Plain ubuntu VM' - // The version state can be Preview, Active or Deprecated. - // Once in an Active state, the NSDV becomes immutable. - versionState: 'Preview' // The `configurationgroupsSchemaReferences` field contains references to the schemas required to // be filled out to configure this NSD. configurationGroupSchemaReferences: { - ubuntu_ConfigGroupSchema: { + ConfigGroupSchema: { id: cgSchema.id } } @@ -77,7 +78,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou // to the values in the CG schemas. resourceElementTemplates: [ { - name: 'ubuntu-vm-nfdg_nf_artifact_resource_element' + name: 'ubuntu' // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. type: 'NetworkFunctionDefinition' // The configuration object may be different for different types of resource element. @@ -87,13 +88,13 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou artifactStoreReference: { id: acrArtifactStore.id } - artifactName: 'ubuntu-vm-nfdg_nf_artifact' + artifactName: 'ubuntu' artifactVersion: '1.0.0' } templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - parameterValues: string(loadJsonContent('configMappings/ubuntu-vm-nfdg_config_mapping.json')) + parameterValues: string(loadJsonContent('ubuntu-mappings.json')) } dependsOnProfile: { installDependsOn: [] diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/ubuntu-mappings.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/ubuntu-mappings.json new file mode 100644 index 00000000000..884e4561bf6 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_instances/nsdDefinition/ubuntu-mappings.json @@ -0,0 +1,12 @@ +{ + "configObject": { + "location": "uksouth", + "publisherName": "pub", + "nfdgName": "ubuntu", + "publisherResourceGroup": "rg", + "customLocationId": "", + "nfdvName": "{configurationparameters('ConfigGroupSchema').ubuntu.nfdvName}", + "deploymentParameters": "{configurationparameters('ConfigGroupSchema').ubuntu.deploymentParameters}", + "managedIdentityId": "{configurationparameters('ConfigGroupSchema').ubuntu.managedIdentityId}" + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/nsd_definition.bicep similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/nsd_definition.bicep diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep similarity index 100% rename from src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep rename to src/aosm/azext_aosm/tests/latest/integration_tests/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep diff --git a/src/aosm/azext_aosm/tests/latest/recording_processors.py b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recording_processors.py similarity index 78% rename from src/aosm/azext_aosm/tests/latest/recording_processors.py rename to src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recording_processors.py index e57db0346b0..22fd9453059 100644 --- a/src/aosm/azext_aosm/tests/latest/recording_processors.py +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recording_processors.py @@ -16,6 +16,7 @@ MOCK_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" MOCK_SAS_URI = "https://xxxxxxxxxxxxxxx.blob.core.windows.net" MOCK_STORAGE_ACCOUNT_SR = "&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx" +MOCK_USERNAME = "xxxxxxxxxxx@microsoft.com" BLOB_STORE_URI_REGEX = r"https:\/\/[a-zA-Z0-9]+\.blob\.core\.windows\.net" STORAGE_ACCOUNT_SR_REGEX = r"&si=StorageAccountAccessPolicy&sr=.*" @@ -86,3 +87,29 @@ def process_request(self, request): pass return request + + +class UsernameReplacer(RecordingProcessor): + def process_response(self, response): + CREATEDBY = "createdBy" + LASTMODIFIEDBY = "lastModifiedBy" + SYSTEMDATA = "systemData" + if is_text_payload(response) and response["body"]["string"]: + try: + response_body = json.loads(response["body"]["string"]) + + if SYSTEMDATA not in response_body: + return response + + system_data = response_body[SYSTEMDATA] + + if CREATEDBY in system_data: + system_data[CREATEDBY] = MOCK_USERNAME + if LASTMODIFIEDBY in system_data: + system_data[LASTMODIFIEDBY] = MOCK_USERNAME + + response_body[SYSTEMDATA] = system_data + response["body"]["string"] = json.dumps(response_body) + except TypeError: + pass + return response diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_cnf_nfd_build_and_publish.yaml b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_cnf_nfd_build_and_publish.yaml new file mode 100644 index 00000000000..08d2df3c877 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_cnf_nfd_build_and_publish.yaml @@ -0,0 +1,1573 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 20 Mar 2024 15:01:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "16280524387813352742"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of a publisher, expected to be in the resource group where you deploy + the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an ACR-backed Artifact Store, deployed under the publisher."}}, "nfDefinitionGroup": + {"type": "string", "metadata": {"description": "Name of a Network Function Definition + Group"}}}, "resources": [{"type": "Microsoft.HybridNetwork/publishers", "apiVersion": + "2023-09-01", "name": "[parameters(''publisherName'')]", "location": "[parameters(''location'')]", + "properties": {"scope": "Private"}}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureContainerRegistry"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''))]", "location": "[parameters(''location'')]", + "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', parameters(''publisherName''))]"]}]}, + "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": + "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"value": "nginx-acr"}, + "nfDefinitionGroup": {"value": "nginx"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '1888' + Content-Type: + - application/json + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710946878", + "name": "AOSM_CLI_deployment_1710946878", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "16280524387813352742", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "nfDefinitionGroup": {"type": "String", "value": + "nginx"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "f240e2c1-e547-4f8e-b5ff-7c57c6969a3a", + "providers": [{"namespace": "Microsoft.HybridNetwork", "resourceTypes": [{"resourceType": + "publishers", "locations": ["uksouth"]}, {"resourceType": "publishers/artifactStores", + "locations": ["uksouth"]}, {"resourceType": "publishers/networkfunctiondefinitiongroups", + "locations": ["uksouth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-nginx-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-nginx-publisher/nginx-acr"}, {"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-nginx-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "resourceName": "automated-cli-tests-nginx-publisher/nginx"}], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3038' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:01:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "16280524387813352742"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of a publisher, expected to be in the resource group where you deploy + the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an ACR-backed Artifact Store, deployed under the publisher."}}, "nfDefinitionGroup": + {"type": "string", "metadata": {"description": "Name of a Network Function Definition + Group"}}}, "resources": [{"type": "Microsoft.HybridNetwork/publishers", "apiVersion": + "2023-09-01", "name": "[parameters(''publisherName'')]", "location": "[parameters(''location'')]", + "properties": {"scope": "Private"}}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureContainerRegistry"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''))]", "location": "[parameters(''location'')]", + "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', parameters(''publisherName''))]"]}]}, + "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": + "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"value": "nginx-acr"}, + "nfDefinitionGroup": {"value": "nginx"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '1888' + Content-Type: + - application/json + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710946878", + "name": "AOSM_CLI_deployment_1710946878", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "16280524387813352742", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "nfDefinitionGroup": {"type": "String", "value": + "nginx"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": + "2024-03-20T15:01:19.6102643Z", "duration": "PT0.0009731S", "correlationId": + "5d2b041a-b185-4d2d-9352-873e2a6a68e1", "providers": [{"namespace": "Microsoft.HybridNetwork", + "resourceTypes": [{"resourceType": "publishers", "locations": ["uksouth"]}, + {"resourceType": "publishers/artifactStores", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkfunctiondefinitiongroups", "locations": ["uksouth"]}]}], + "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-nginx-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-nginx-publisher/nginx-acr"}, {"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-nginx-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "resourceName": "automated-cli-tests-nginx-publisher/nginx"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710946878/operationStatuses/08584906600060614648?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '2417' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:01:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:01:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:01:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:02:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:02:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:03:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:03:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:04:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:04:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:05:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:05:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906600060614648?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710946878", + "name": "AOSM_CLI_deployment_1710946878", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "16280524387813352742", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "nfDefinitionGroup": {"type": "String", "value": + "nginx"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": + "2024-03-20T15:05:59.8201596Z", "duration": "PT4M40.2108684S", "correlationId": + "5d2b041a-b185-4d2d-9352-873e2a6a68e1", "providers": [{"namespace": "Microsoft.HybridNetwork", + "resourceTypes": [{"resourceType": "publishers", "locations": ["uksouth"]}, + {"resourceType": "publishers/artifactStores", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkfunctiondefinitiongroups", "locations": ["uksouth"]}]}], + "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-nginx-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-nginx-publisher/nginx-acr"}, {"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-nginx-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "resourceName": "automated-cli-tests-nginx-publisher/nginx"}], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3054' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr/artifactManifests/nginx-acr-manifest-1-0-0?api-version=2023-09-01 + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr/artifactManifests/nginx-acr-manifest-1-0-0'' + under resource group ''cli_test_cnf_nfd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '337' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "8068031912378000682"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "nginxdemo", "artifactType": "OCIArtifact", "artifactVersion": "0.1.0"}, {"artifactName": + "nginx", "artifactType": "OCIArtifact", "artifactVersion": "stable"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "automated-cli-tests-nginx-publisher"}, + "acrArtifactStoreName": {"value": "nginx-acr"}, "acrManifestName": {"value": + "nginx-acr-manifest-1-0-0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '1518' + Content-Type: + - application/json + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947184", + "name": "AOSM_CLI_deployment_1710947184", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "8068031912378000682", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "acrManifestName": {"type": "String", "value": + "nginx-acr-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "6f833d89-70db-4ec3-b270-6a48262bc792", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr/artifactManifests/nginx-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1241' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "8068031912378000682"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "nginxdemo", "artifactType": "OCIArtifact", "artifactVersion": "0.1.0"}, {"artifactName": + "nginx", "artifactType": "OCIArtifact", "artifactVersion": "stable"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "automated-cli-tests-nginx-publisher"}, + "acrArtifactStoreName": {"value": "nginx-acr"}, "acrManifestName": {"value": + "nginx-acr-manifest-1-0-0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '1518' + Content-Type: + - application/json + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947184", + "name": "AOSM_CLI_deployment_1710947184", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "8068031912378000682", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "acrManifestName": {"type": "String", "value": + "nginx-acr-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2024-03-20T15:06:26.3193Z", "duration": "PT0.0006259S", + "correlationId": "b8a5cb48-7494-4f1d-b857-1cb4e0826e83", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947184/operationStatuses/08584906596993187527?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '978' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906596993187527?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906596993187527?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:06:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906596993187527?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:07:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906596993187527?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:07:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947184", + "name": "AOSM_CLI_deployment_1710947184", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "8068031912378000682", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "acrManifestName": {"type": "String", "value": + "nginx-acr-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2024-03-20T15:07:49.5269026Z", "duration": "PT1M23.2082285S", + "correlationId": "b8a5cb48-7494-4f1d-b857-1cb4e0826e83", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr/artifactManifests/nginx-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1257' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:07:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-nginx-publisher/artifactStores/nginx-acr/artifactManifests/nginx-acr-manifest-1-0-0/listCredential?api-version=2023-09-01 + response: + body: + string: '{"username": "nginx-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "acrServerUrl": "https://automatedclitestsnginxpublishernginxacr3964e97abc.azurecr.io", + "repositories": ["nginxdemo", "nginx"], "expiry": "2024-03-21T15:07:58.2350949+00:00", + "credentialType": "AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '338' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:07:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02628.2640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "15221125174711860095"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nfDefinitionGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Function Definition Group"}}, "nfDefinitionVersion": + {"type": "string", "metadata": {"description": "The version of the NFDV you + want to deploy, in format A.B.C"}}}, "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {}}, "$fxv#1": + {"replicaCount": 1, "image": {"repository": "overwriteme", "tag": "stable", + "pullPolicy": "IfNotPresent"}, "nameOverride": "", "fullnameOverride": "", "serviceAccount": + {"create": false, "name": "[null()]"}, "podSecurityContext": {}, "securityContext": + {}, "service": {"type": "ClusterIP", "port": 80}, "ingress": {"enabled": false, + "annotations": {}, "hosts": [{"host": "chart-example.local", "paths": []}], + "tls": []}, "resources": {}, "nodeSelector": {}, "tolerations": [], "affinity": + {}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"deployParameters": "[string(variables(''$fxv#0''))]", + "networkFunctionType": "ContainerizedNetworkFunction", "networkFunctionTemplate": + {"nfviType": "AzureArcKubernetes", "networkFunctionApplications": [{"artifactType": + "HelmPackage", "name": "nginxdemo", "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}, "artifactProfile": {"artifactStore": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "helmArtifactProfile": {"helmPackageName": + "nginxdemo", "helmPackageVersionRange": "0.1.0", "registryValuesPaths": [], + "imagePullSecretsValuesPaths": ["imagePullSecrets"]}}, "deployParametersMappingRuleProfile": + {"applicationEnablement": "Enabled", "helmMappingRuleProfile": {"releaseNamespace": + "nginxdemo", "releaseName": "nginxdemo", "helmPackageVersion": "0.1.0", "values": + "[string(variables(''$fxv#1''))]"}}}]}}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "automated-cli-tests-nginx-publisher"}, + "acrArtifactStoreName": {"value": "nginx-acr"}, "nfDefinitionGroup": {"value": + "nginx"}, "nfDefinitionVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '3115' + Content-Type: + - application/json + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947304", + "name": "AOSM_CLI_deployment_1710947304", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15221125174711860095", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "nfDefinitionGroup": {"type": "String", "value": + "nginx"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}}, "mode": + "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", + "duration": "PT0S", "correlationId": "04dbd5f4-d98a-4af9-8bad-302b1a316455", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uksouth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1329' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:08:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "15221125174711860095"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nfDefinitionGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Function Definition Group"}}, "nfDefinitionVersion": + {"type": "string", "metadata": {"description": "The version of the NFDV you + want to deploy, in format A.B.C"}}}, "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {}}, "$fxv#1": + {"replicaCount": 1, "image": {"repository": "overwriteme", "tag": "stable", + "pullPolicy": "IfNotPresent"}, "nameOverride": "", "fullnameOverride": "", "serviceAccount": + {"create": false, "name": "[null()]"}, "podSecurityContext": {}, "securityContext": + {}, "service": {"type": "ClusterIP", "port": 80}, "ingress": {"enabled": false, + "annotations": {}, "hosts": [{"host": "chart-example.local", "paths": []}], + "tls": []}, "resources": {}, "nodeSelector": {}, "tolerations": [], "affinity": + {}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"deployParameters": "[string(variables(''$fxv#0''))]", + "networkFunctionType": "ContainerizedNetworkFunction", "networkFunctionTemplate": + {"nfviType": "AzureArcKubernetes", "networkFunctionApplications": [{"artifactType": + "HelmPackage", "name": "nginxdemo", "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}, "artifactProfile": {"artifactStore": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "helmArtifactProfile": {"helmPackageName": + "nginxdemo", "helmPackageVersionRange": "0.1.0", "registryValuesPaths": [], + "imagePullSecretsValuesPaths": ["imagePullSecrets"]}}, "deployParametersMappingRuleProfile": + {"applicationEnablement": "Enabled", "helmMappingRuleProfile": {"releaseNamespace": + "nginxdemo", "releaseName": "nginxdemo", "helmPackageVersion": "0.1.0", "values": + "[string(variables(''$fxv#1''))]"}}}]}}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "automated-cli-tests-nginx-publisher"}, + "acrArtifactStoreName": {"value": "nginx-acr"}, "nfDefinitionGroup": {"value": + "nginx"}, "nfDefinitionVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '3115' + Content-Type: + - application/json + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947304", + "name": "AOSM_CLI_deployment_1710947304", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15221125174711860095", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "nfDefinitionGroup": {"type": "String", "value": + "nginx"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}}, "mode": + "Incremental", "provisioningState": "Accepted", "timestamp": "2024-03-20T15:08:26.0965663Z", + "duration": "PT0.0009536S", "correlationId": "e7003c7c-2f82-47b1-b07e-0cedd9d6aca3", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uksouth"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947304/operationStatuses/08584906595796047536?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1059' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:08:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906595796047536?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:08:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906595796047536?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:08:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906595796047536?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:09:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584906595796047536?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:09:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -b --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1710947304", + "name": "AOSM_CLI_deployment_1710947304", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15221125174711860095", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-nginx-publisher"}, "acrArtifactStoreName": {"type": + "String", "value": "nginx-acr"}, "nfDefinitionGroup": {"type": "String", "value": + "nginx"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}}, "mode": + "Incremental", "provisioningState": "Succeeded", "timestamp": "2024-03-20T15:09:47.7010864Z", + "duration": "PT1M21.6054737S", "correlationId": "e7003c7c-2f82-47b1-b07e-0cedd9d6aca3", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uksouth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_cnf_nfd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-nginx-publisher/networkfunctiondefinitiongroups/nginx/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1345' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 20 Mar 2024 15:09:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_vnf_nsd_build_and_publish.yaml b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_vnf_nsd_build_and_publish.yaml new file mode 100644 index 00000000000..156b96a8d21 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/recordings/test_vnf_nsd_build_and_publish.yaml @@ -0,0 +1,4430 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:36:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "9985939870973944498"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of a publisher, expected to be in the resource group where you deploy + the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an ACR-backed Artifact Store, deployed under the publisher."}}, "saArtifactStoreName": + {"type": "string", "metadata": {"description": "Name of a Storage Account-backed + Artifact Store, deployed under the publisher."}}, "nfDefinitionGroup": {"type": + "string", "metadata": {"description": "Name of a Network Function Definition + Group"}}}, "resources": [{"type": "Microsoft.HybridNetwork/publishers", "apiVersion": + "2023-09-01", "name": "[parameters(''publisherName'')]", "location": "[parameters(''location'')]", + "properties": {"scope": "Private"}}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureContainerRegistry"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureStorageAccount"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''))]", "location": "[parameters(''location'')]", + "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', parameters(''publisherName''))]"]}]}, + "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": + "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, + "nfDefinitionGroup": {"value": "ubuntu-vm"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2478' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474588", + "name": "AOSM_CLI_deployment_1711474588", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9985939870973944498", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "nfDefinitionGroup": {"type": "String", + "value": "ubuntu-vm"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "8b5c7d80-a701-463a-b0ea-0897b4e410e4", "providers": [{"namespace": "Microsoft.HybridNetwork", + "resourceTypes": [{"resourceType": "publishers", "locations": ["uksouth"]}, + {"resourceType": "publishers/artifactStores", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkfunctiondefinitiongroups", "locations": ["uksouth"]}]}], + "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-acr"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-blob-store"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu-vm"}], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '4028' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:36:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "9985939870973944498"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of a publisher, expected to be in the resource group where you deploy + the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an ACR-backed Artifact Store, deployed under the publisher."}}, "saArtifactStoreName": + {"type": "string", "metadata": {"description": "Name of a Storage Account-backed + Artifact Store, deployed under the publisher."}}, "nfDefinitionGroup": {"type": + "string", "metadata": {"description": "Name of a Network Function Definition + Group"}}}, "resources": [{"type": "Microsoft.HybridNetwork/publishers", "apiVersion": + "2023-09-01", "name": "[parameters(''publisherName'')]", "location": "[parameters(''location'')]", + "properties": {"scope": "Private"}}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureContainerRegistry"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureStorageAccount"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''))]", "location": "[parameters(''location'')]", + "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', parameters(''publisherName''))]"]}]}, + "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": + "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, + "nfDefinitionGroup": {"value": "ubuntu-vm"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2478' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474588", + "name": "AOSM_CLI_deployment_1711474588", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9985939870973944498", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "nfDefinitionGroup": {"type": "String", + "value": "ubuntu-vm"}}, "mode": "Incremental", "provisioningState": "Accepted", + "timestamp": "2024-03-26T17:36:27.9457594Z", "duration": "PT0.0001042S", "correlationId": + "2e39b075-b1c8-4260-8eae-5a1d4af7afc5", "providers": [{"namespace": "Microsoft.HybridNetwork", + "resourceTypes": [{"resourceType": "publishers", "locations": ["uksouth"]}, + {"resourceType": "publishers/artifactStores", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkfunctiondefinitiongroups", "locations": ["uksouth"]}]}], + "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-acr"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-blob-store"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu-vm"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474588/operationStatuses/08584901322977259664?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '3182' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:36:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:36:28 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:36:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:37:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:38:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:38:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:39:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:39:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:01 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901322977259664?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474588", + "name": "AOSM_CLI_deployment_1711474588", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9985939870973944498", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "nfDefinitionGroup": {"type": "String", + "value": "ubuntu-vm"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "2024-03-26T17:40:16.0105341Z", "duration": "PT3M48.0648789S", + "correlationId": "2e39b075-b1c8-4260-8eae-5a1d4af7afc5", "providers": [{"namespace": + "Microsoft.HybridNetwork", "resourceTypes": [{"resourceType": "publishers", + "locations": ["uksouth"]}, {"resourceType": "publishers/artifactStores", "locations": + ["uksouth"]}, {"resourceType": "publishers/networkfunctiondefinitiongroups", + "locations": ["uksouth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-acr"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-blob-store"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu-vm"}], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '4044' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-09-01 + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '343' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:32 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-09-01 + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '349' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "2261224723127030745"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": + {"type": "string", "metadata": {"description": "Name of the manifest to deploy + for the Storage Account-backed Artifact Store"}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "automated-cli-tests-artifact", "artifactType": "ArmTemplate", "artifactVersion": + "1.0.0"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "automated-cli-tests-vhd", "artifactType": "VhdImageFile", "artifactVersion": + "1-0-0"}]}}]}, "parameters": {"location": {"value": "uksouth"}, "publisherName": + {"value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": {"value": + "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saArtifactStoreName": {"value": "ubuntu-blob-store"}, "saManifestName": {"value": + "ubuntu-vm-sa-manifest-1-0-0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2296' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474840", + "name": "AOSM_CLI_deployment_1711474840", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "2261224723127030745", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "acrManifestName": {"type": "String", + "value": "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"type": "String", + "value": "ubuntu-vm-sa-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "09e80968-2902-4d79-adeb-f54e3cab77f6", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1667' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "2261224723127030745"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": + {"type": "string", "metadata": {"description": "Name of the manifest to deploy + for the Storage Account-backed Artifact Store"}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "automated-cli-tests-artifact", "artifactType": "ArmTemplate", "artifactVersion": + "1.0.0"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "automated-cli-tests-vhd", "artifactType": "VhdImageFile", "artifactVersion": + "1-0-0"}]}}]}, "parameters": {"location": {"value": "uksouth"}, "publisherName": + {"value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": {"value": + "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saArtifactStoreName": {"value": "ubuntu-blob-store"}, "saManifestName": {"value": + "ubuntu-vm-sa-manifest-1-0-0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2296' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474840", + "name": "AOSM_CLI_deployment_1711474840", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "2261224723127030745", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "acrManifestName": {"type": "String", + "value": "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"type": "String", + "value": "ubuntu-vm-sa-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2024-03-26T17:40:42.3758705Z", "duration": "PT0.000714S", + "correlationId": "4b94da61-1c59-4595-8e81-0f118a61c0dc", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474840/operationStatuses/08584901320433747222?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1137' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901320433747222?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:40:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901320433747222?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:41:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901320433747222?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:41:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901320433747222?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474840", + "name": "AOSM_CLI_deployment_1711474840", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "2261224723127030745", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "acrManifestName": {"type": "String", + "value": "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"type": "String", + "value": "ubuntu-vm-sa-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2024-03-26T17:42:05.2619033Z", "duration": "PT1M22.8867468S", + "correlationId": "4b94da61-1c59-4595-8e81-0f118a61c0dc", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1683' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-09-01 + response: + body: + string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "acrServerUrl": "https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io", + "repositories": ["automated-cli-tests-artifact"], "expiry": "2024-03-27T17:42:15.2750844+00:00", + "credentialType": "AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '353' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02636.2686 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "automated-cli-tests-artifact", "Action": "pull"}, {"Type": + "repository", "Name": "automated-cli-tests-artifact", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '314' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:15 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token",service="automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io",scope="repository:automated-cli-tests-artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token?service=automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io&scope=repository%3Aautomated-cli-tests-artifact%3Apull%2Cpush + response: + body: + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:15 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:15 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 0c6b706f-b5c5-45df-a3a8-b4ad3facd704 + location: + - /v2/automated-cli-tests-artifact/blobs/uploads/0c6b706f-b5c5-45df-a3a8-b4ad3facd704?_nouploadcache=false&_state=_zJEA08SXOBv4B708KF3xDF4uRs5QGDcLFZ_9TWtw-V7Ik5hbWUiOiJhdXRvbWF0ZWQtY2xpLXRlc3RzLWFydGlmYWN0IiwiVVVJRCI6IjBjNmI3MDZmLWI1YzUtNDVkZi1hM2E4LWI0YWQzZmFjZDcwNCIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0wMy0yNlQxNzo0MjoxNS44MTk1MzQ1MzJaIn0%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n + \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": + \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n + \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n + \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": + {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": + \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n + \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": + \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n + \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', + parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n + \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": + \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n + \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), + parameters('subnetName'))]\"\n },\n \"primary\": true,\n + \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n + \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n + \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n + \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n + \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n + \ },\n \"storageProfile\": {\n \"imageReference\": {\n + \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', + variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', + parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": + \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n + \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n + \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": + \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": + \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": + {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": + \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": + true,\n \"ssh\": {\n \"publicKeys\": [\n {\n + \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": + \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n + \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": + {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": + \"ImageDefault\"\n }\n },\n \"secrets\": [],\n + \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": + {\n \"networkInterfaces\": [\n {\n \"id\": + \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n + \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', + format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3591' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/blobs/uploads/0c6b706f-b5c5-45df-a3a8-b4ad3facd704?_nouploadcache=false&_state=_zJEA08SXOBv4B708KF3xDF4uRs5QGDcLFZ_9TWtw-V7Ik5hbWUiOiJhdXRvbWF0ZWQtY2xpLXRlc3RzLWFydGlmYWN0IiwiVVVJRCI6IjBjNmI3MDZmLWI1YzUtNDVkZi1hM2E4LWI0YWQzZmFjZDcwNCIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0wMy0yNlQxNzo0MjoxNS44MTk1MzQ1MzJaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:16 GMT + docker-content-digest: + - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/automated-cli-tests-artifact/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "automated-cli-tests-artifact", "Action": "pull"}, {"Type": + "repository", "Name": "automated-cli-tests-artifact", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '314' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:16 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token",service="automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io",scope="repository:automated-cli-tests-artifact:push,pull" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token?service=automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io&scope=repository%3Aautomated-cli-tests-artifact%3Apush%2Cpull + response: + body: + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:16 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:16 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - e5c270f8-2a5d-4945-88e2-0b1a7996938c + location: + - /v2/automated-cli-tests-artifact/blobs/uploads/e5c270f8-2a5d-4945-88e2-0b1a7996938c?_nouploadcache=false&_state=h3rQ97n4QEvLKZv05iWfx8mB0V8S1OJ5X8lMfCn9ioh7Ik5hbWUiOiJhdXRvbWF0ZWQtY2xpLXRlc3RzLWFydGlmYWN0IiwiVVVJRCI6ImU1YzI3MGY4LTJhNWQtNDk0NS04OGUyLTBiMWE3OTk2OTM4YyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0wMy0yNlQxNzo0MjoxNi4xMDcwMTU4N1oifQ%3D%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/blobs/uploads/e5c270f8-2a5d-4945-88e2-0b1a7996938c?_nouploadcache=false&_state=h3rQ97n4QEvLKZv05iWfx8mB0V8S1OJ5X8lMfCn9ioh7Ik5hbWUiOiJhdXRvbWF0ZWQtY2xpLXRlc3RzLWFydGlmYWN0IiwiVVVJRCI6ImU1YzI3MGY4LTJhNWQtNDk0NS04OGUyLTBiMWE3OTk2OTM4YyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0wMy0yNlQxNzo0MjoxNi4xMDcwMTU4N1oifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:16 GMT + docker-content-digest: + - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/automated-cli-tests-artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, + "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", + "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], + "annotations": {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '504' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/manifests/1.0.0 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "automated-cli-tests-artifact", "Action": "pull"}, {"Type": + "repository", "Name": "automated-cli-tests-artifact", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '314' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:16 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token",service="automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io",scope="repository:automated-cli-tests-artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token?service=automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io&scope=repository%3Aautomated-cli-tests-artifact%3Apull%2Cpush + response: + body: + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:16 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, + "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", + "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], + "annotations": {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '504' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/automated-cli-tests-artifact/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:16 GMT + docker-content-digest: + - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/automated-cli-tests-artifact/manifests/sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-09-01 + response: + body: + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-079FCC97/providers/Microsoft.Storage/storageAccounts/079fcc97ubuntublobstorea", + "containerCredentials": [{"containerName": "automatedclitestsvhd-1-0-0", "containerSasUri": + "https://xxxxxxxxxxxxxxx.blob.core.windows.net/automatedclitestsvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], + "expiry": "2024-03-27T17:42:17.6600985+00:00", "credentialType": "AzureStorageAccountToken"}' + headers: + cache-control: + - no-cache + content-length: + - '533' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02636.2686 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-blob-content-length: + - '512' + x-ms-blob-type: + - PageBlob + x-ms-date: + - Tue, 26 Mar 2024 17:42:16 GMT + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/automatedclitestsvhd-1-0-0/automatedclitests-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:17 GMT + etag: + - '"0x8DC4DBC14D14DC6"' + last-modified: + - Tue, 26 Mar 2024 17:42:17 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2022-11-02' + status: + code: 201 + message: Created +- request: + body: "61 38 6b 92 16 4b cc ac 6f d4 02 5c 6f 62 79 b9 \n8e 62 ae 07 02 1c dc + 73 5b 7a 51 e7 56 4e 4a b0 \n54 4a 93 2e 6b dd 3c b5 8b 60 fa 80 b1 80 1b 89 + \n1e 4d 7d 86 8e 25 76 58 24 8d 21 87 83 06 88 d6 \na4 fd 94 9c 66 b6 db ee + 92 46 f0 25 fc 84 bb f5 \n3f d9 49 28 ea 54 6a 2a 33 fa e0 47 eb 22 af 91 \nd4 + 34 a6 d9 fe 58 cb 54 03 35 d6 45 40 96 4e f3 \n31 ea 78 20 45 e9 f2 3a de cb + 38 53 c0 9c b2 b7 \n12 9e 57 d9 f6 1b cb 20 23 8c 86 d3 40 da 84 c3 \n22 5b + 48 61 63 e2 5f 5f 43 6d 8f 41 fc ce c1 87 \n33 e1 e2 61 63 e2 5f 5" + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '512' + Content-Type: + - application/octet-stream + If-Match: + - '"0x8DC4DBC14D14DC6"' + User-Agent: + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-date: + - Tue, 26 Mar 2024 17:42:16 GMT + x-ms-page-write: + - update + x-ms-range: + - bytes=0-511 + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/automatedclitestsvhd-1-0-0/automatedclitests-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:42:17 GMT + etag: + - '"0x8DC4DBC14D6ECD1"' + last-modified: + - Tue, 26 Mar 2024 17:42:17 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-sequence-number: + - '0' + x-ms-content-crc64: + - iWvWqElPrJg= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2022-11-02' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "7199002541811128072"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfDefinitionGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Function Definition Group"}}, "nfDefinitionVersion": + {"type": "string", "metadata": {"description": "The version of the NFDV you + want to deploy, in format A.B.C"}}}, "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"automated-cli-tests-artifact": + {"type": "object", "properties": {"subnetName": {"type": "string"}, "virtualNetworkId": + {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}, "required": ["subnetName", + "virtualNetworkId", "sshPublicKeyAdmin"]}}}, "$fxv#1": {"imageHyperVGeneration": + "V1", "imageName": "ubuntu-vmImage"}, "$fxv#2": {"imageName": "ubuntu-vmImage", + "subnetName": "{deployParameters.automated-cli-tests-artifact.subnetName}", + "virtualNetworkId": "{deployParameters.automated-cli-tests-artifact.virtualNetworkId}", + "sshPublicKeyAdmin": "{deployParameters.automated-cli-tests-artifact.sshPublicKeyAdmin}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"deployParameters": "[string(variables(''$fxv#0''))]", + "networkFunctionType": "VirtualNetworkFunction", "networkFunctionTemplate": + {"nfviType": "AzureCore", "networkFunctionApplications": [{"artifactType": "VhdImageFile", + "name": "automated-cli-tests-vhd", "dependsOnProfile": null, "artifactProfile": + {"vhdArtifactProfile": {"vhdName": "automated-cli-tests-vhd", "vhdVersion": + "1-0-0"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Enabled"}}, {"artifactType": "ArmTemplate", "name": + "automated-cli-tests-artifact", "dependsOnProfile": null, "artifactProfile": + {"templateArtifactProfile": {"templateName": "automated-cli-tests-artifact", + "templateVersion": "1.0.0"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Enabled"}}]}}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "automated-cli-tests-ubuntu-publisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nfDefinitionGroup": {"value": + "ubuntu-vm"}, "nfDefinitionVersion": {"value": "1.0.0"}, "saArtifactStoreName": + {"value": "ubuntu-blob-store"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '3768' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474944", + "name": "AOSM_CLI_deployment_1711474944", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "7199002541811128072", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "nfDefinitionGroup": {"type": "String", + "value": "ubuntu-vm"}, "nfDefinitionVersion": {"type": "String", "value": + "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "ca3f5ffe-1378-44ff-9317-aceee1e04a09", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uksouth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1412' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "7199002541811128072"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfDefinitionGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Function Definition Group"}}, "nfDefinitionVersion": + {"type": "string", "metadata": {"description": "The version of the NFDV you + want to deploy, in format A.B.C"}}}, "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"automated-cli-tests-artifact": + {"type": "object", "properties": {"subnetName": {"type": "string"}, "virtualNetworkId": + {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}, "required": ["subnetName", + "virtualNetworkId", "sshPublicKeyAdmin"]}}}, "$fxv#1": {"imageHyperVGeneration": + "V1", "imageName": "ubuntu-vmImage"}, "$fxv#2": {"imageName": "ubuntu-vmImage", + "subnetName": "{deployParameters.automated-cli-tests-artifact.subnetName}", + "virtualNetworkId": "{deployParameters.automated-cli-tests-artifact.virtualNetworkId}", + "sshPublicKeyAdmin": "{deployParameters.automated-cli-tests-artifact.sshPublicKeyAdmin}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"deployParameters": "[string(variables(''$fxv#0''))]", + "networkFunctionType": "VirtualNetworkFunction", "networkFunctionTemplate": + {"nfviType": "AzureCore", "networkFunctionApplications": [{"artifactType": "VhdImageFile", + "name": "automated-cli-tests-vhd", "dependsOnProfile": null, "artifactProfile": + {"vhdArtifactProfile": {"vhdName": "automated-cli-tests-vhd", "vhdVersion": + "1-0-0"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Enabled"}}, {"artifactType": "ArmTemplate", "name": + "automated-cli-tests-artifact", "dependsOnProfile": null, "artifactProfile": + {"templateArtifactProfile": {"templateName": "automated-cli-tests-artifact", + "templateVersion": "1.0.0"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Enabled"}}]}}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "automated-cli-tests-ubuntu-publisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nfDefinitionGroup": {"value": + "ubuntu-vm"}, "nfDefinitionVersion": {"value": "1.0.0"}, "saArtifactStoreName": + {"value": "ubuntu-blob-store"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '3768' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474944", + "name": "AOSM_CLI_deployment_1711474944", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "7199002541811128072", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "nfDefinitionGroup": {"type": "String", + "value": "ubuntu-vm"}, "nfDefinitionVersion": {"type": "String", "value": + "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": + "2024-03-26T17:42:26.7689542Z", "duration": "PT0.000588S", "correlationId": + "be9190ad-feb9-4a82-816d-6ad42c590444", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uksouth"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474944/operationStatuses/08584901319389339559?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1136' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901319389339559?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901319389339559?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:42:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901319389339559?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:43:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901319389339559?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:43:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder --definition-type + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711474944", + "name": "AOSM_CLI_deployment_1711474944", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "7199002541811128072", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": + "String", "value": "ubuntu-blob-store"}, "nfDefinitionGroup": {"type": "String", + "value": "ubuntu-vm"}, "nfDefinitionVersion": {"type": "String", "value": + "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": + "2024-03-26T17:43:49.412615Z", "duration": "PT1M22.6442488S", "correlationId": + "be9190ad-feb9-4a82-816d-6ad42c590444", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uksouth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1427' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:43:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd build + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/networkFunctionDefinitionGroups/ubuntu-vm/networkFunctionDefinitionVersions/1.0.0?api-version=2023-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkfunctiondefinitiongroups/ubuntu-vm/networkfunctiondefinitionversions/1.0.0", + "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "location": "uksouth", "systemData": {"createdBy": "xxxxxxxxxxx@microsoft.com", + "createdByType": "User", "createdAt": "2024-03-26T17:42:28.1546375Z", "lastModifiedBy": + "xxxxxxxxxxx@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2024-03-26T17:42:28.1546375Z"}, "properties": {"networkFunctionTemplate": + {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": + {"vhdName": "automated-cli-tests-vhd", "vhdVersion": "1-0-0"}, "artifactStore": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-blob-store"}}, + "deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": {"userConfiguration": + "{\"imageHyperVGeneration\":\"V1\",\"imageName\":\"ubuntu-vmImage\"}"}, "applicationEnablement": + "Enabled"}, "artifactType": "VhdImageFile", "dependsOnProfile": null, "name": + "automated-cli-tests-vhd"}, {"artifactProfile": {"templateArtifactProfile": + {"templateName": "automated-cli-tests-artifact", "templateVersion": "1.0.0"}, + "artifactStore": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr"}}, + "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": + "{\"imageName\":\"ubuntu-vmImage\",\"subnetName\":\"{deployParameters.automated-cli-tests-artifact.subnetName}\",\"virtualNetworkId\":\"{deployParameters.automated-cli-tests-artifact.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.automated-cli-tests-artifact.sshPublicKeyAdmin}\"}"}, + "applicationEnablement": "Enabled"}, "artifactType": "ArmTemplate", "dependsOnProfile": + null, "name": "automated-cli-tests-artifact"}], "nfviType": "AzureCore"}, + "versionState": "Preview", "description": null, "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"automated-cli-tests-artifact\":{\"type\":\"object\",\"properties\":{\"subnetName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"subnetName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}},\"required\":[\"automated-cli-tests-artifact\"]}", + "networkFunctionType": "VirtualNetworkFunction", "provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '2893' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:43:57 GMT + etag: + - '"a709610f-0000-1000-0000-660309160000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:43:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "3408402259472792388"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of a publisher, expected to be in the resource group where you deploy + the template"}}, "acrArtifactStoreName": {"type": "string"}, "nsDesignGroup": + {"type": "string", "metadata": {"description": "Name of an Network Service Design + Group"}}}, "resources": [{"type": "Microsoft.HybridNetwork/publishers", "apiVersion": + "2023-09-01", "name": "[parameters(''publisherName'')]", "location": "[parameters(''location'')]", + "properties": {"scope": "Private"}}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureContainerRegistry"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''nsDesignGroup''))]", "location": "[parameters(''location'')]", + "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', parameters(''publisherName''))]"]}]}, + "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": + "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, + "nsDesignGroup": {"value": "ubuntu"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '1769' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475047", + "name": "AOSM_CLI_deployment_1711475047", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "3408402259472792388", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", + "value": "ubuntu"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "46c25b53-720c-4d4a-a0a5-e14ba3a93141", "providers": [{"namespace": "Microsoft.HybridNetwork", + "resourceTypes": [{"resourceType": "publishers", "locations": ["uksouth"]}, + {"resourceType": "publishers/artifactStores", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkservicedesigngroups", "locations": ["uksouth"]}]}], "dependencies": + [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-acr"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu"}], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3033' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:44:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "3408402259472792388"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of a publisher, expected to be in the resource group where you deploy + the template"}}, "acrArtifactStoreName": {"type": "string"}, "nsDesignGroup": + {"type": "string", "metadata": {"description": "Name of an Network Service Design + Group"}}}, "resources": [{"type": "Microsoft.HybridNetwork/publishers", "apiVersion": + "2023-09-01", "name": "[parameters(''publisherName'')]", "location": "[parameters(''location'')]", + "properties": {"scope": "Private"}}, {"type": "Microsoft.HybridNetwork/publishers/artifactStores", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]", "location": "[parameters(''location'')]", + "properties": {"storeType": "AzureContainerRegistry"}, "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', + parameters(''publisherName''))]"]}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + parameters(''nsDesignGroup''))]", "location": "[parameters(''location'')]", + "dependsOn": ["[resourceId(''Microsoft.HybridNetwork/publishers'', parameters(''publisherName''))]"]}]}, + "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": + "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, + "nsDesignGroup": {"value": "ubuntu"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '1769' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475047", + "name": "AOSM_CLI_deployment_1711475047", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "3408402259472792388", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", + "value": "ubuntu"}}, "mode": "Incremental", "provisioningState": "Accepted", + "timestamp": "2024-03-26T17:44:09.6938991Z", "duration": "PT0.0005981S", "correlationId": + "62b9948b-fb81-4964-a47f-48718c1fe626", "providers": [{"namespace": "Microsoft.HybridNetwork", + "resourceTypes": [{"resourceType": "publishers", "locations": ["uksouth"]}, + {"resourceType": "publishers/artifactStores", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkservicedesigngroups", "locations": ["uksouth"]}]}], "dependencies": + [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-acr"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475047/operationStatuses/08584901318359994710?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '2412' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:44:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:44:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:44:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:45:10 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:45:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:46:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:46:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:47:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:47:43 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901318359994710?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475047", + "name": "AOSM_CLI_deployment_1711475047", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "3408402259472792388", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", + "value": "ubuntu"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "2024-03-26T17:47:53.1538201Z", "duration": "PT3M43.4605191S", + "correlationId": "62b9948b-fb81-4964-a47f-48718c1fe626", "providers": [{"namespace": + "Microsoft.HybridNetwork", "resourceTypes": [{"resourceType": "publishers", + "locations": ["uksouth"]}, {"resourceType": "publishers/artifactStores", "locations": + ["uksouth"]}, {"resourceType": "publishers/networkservicedesigngroups", "locations": + ["uksouth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr", + "resourceType": "Microsoft.HybridNetwork/publishers/artifactStores", "resourceName": + "automated-cli-tests-ubuntu-publisher/ubuntu-acr"}, {"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher", + "resourceType": "Microsoft.HybridNetwork/publishers", "resourceName": "automated-cli-tests-ubuntu-publisher"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu"}], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3049' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nsd-manifest-1-0-0?api-version=2023-09-01 + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nsd-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '340' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:14 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "1992933778514196637"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the Artifact Manifest to create"}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "ubuntu", "artifactType": "OCIArtifact", "artifactVersion": "1.0.0"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "automated-cli-tests-ubuntu-publisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestName": {"value": + "ubuntu-nsd-manifest-1-0-0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '1406' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475301", + "name": "AOSM_CLI_deployment_1711475301", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1992933778514196637", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "acrManifestName": {"type": "String", + "value": "ubuntu-nsd-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "8bdabd74-76a4-4bf1-9cc1-6406aad741ee", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nsd-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1247' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "1992933778514196637"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the Artifact Manifest to create"}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "ubuntu", "artifactType": "OCIArtifact", "artifactVersion": "1.0.0"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "automated-cli-tests-ubuntu-publisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestName": {"value": + "ubuntu-nsd-manifest-1-0-0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '1406' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475301", + "name": "AOSM_CLI_deployment_1711475301", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1992933778514196637", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "acrManifestName": {"type": "String", + "value": "ubuntu-nsd-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2024-03-26T17:48:23.8081775Z", "duration": "PT0.0009866S", + "correlationId": "7eb204e3-d16b-4390-84a9-2c34df6150bb", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475301/operationStatuses/08584901315818368108?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '984' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:23 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901315818368108?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:23 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901315818368108?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:48:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901315818368108?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:49:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901315818368108?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:49:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475301", + "name": "AOSM_CLI_deployment_1711475301", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1992933778514196637", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "acrManifestName": {"type": "String", + "value": "ubuntu-nsd-manifest-1-0-0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2024-03-26T17:49:44.9615785Z", "duration": "PT1M21.1543876S", + "correlationId": "7eb204e3-d16b-4390-84a9-2c34df6150bb", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uksouth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nsd-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1263' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:49:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-cli-tests-ubuntu-publisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nsd-manifest-1-0-0/listCredential?api-version=2023-09-01 + response: + body: + string: '{"username": "ubuntu-nsd-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "acrServerUrl": "https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io", + "repositories": ["ubuntu"], "expiry": "2024-03-27T17:50:04.1901768+00:00", + "credentialType": "AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '328' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02636.2686 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu", "Action": "pull"}, {"Type": "repository", + "Name": "ubuntu", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '270' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:04 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token",service="automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io",scope="repository:ubuntu:push,pull" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token?service=automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io&scope=repository%3Aubuntu%3Apush%2Cpull + response: + body: + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:04 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:50:09 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - a90bd350-1fc7-4a62-8064-a7842117cb20 + location: + - /v2/ubuntu/blobs/uploads/a90bd350-1fc7-4a62-8064-a7842117cb20?_nouploadcache=false&_state=r7Im6L9IIg9gDRBWFUuyTXv6JD9a2RBZykqQcvhmxrJ7Ik5hbWUiOiJ1YnVudHUiLCJVVUlEIjoiYTkwYmQzNTAtMWZjNy00YTYyLTgwNjQtYTc4NDIxMTdjYjIwIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDI0LTAzLTI2VDE3OjUwOjA0Ljc0MDI4MTAyNloifQ%3D%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: '{"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "3143786477138181218"}}, "parameters": {"configObject": + {"type": "secureObject"}}, "variables": {"resourceGroupId": "[resourceGroup().id]", + "identityObject": "[if(equals(parameters(''configObject'').managedIdentityId, + ''''), createObject(''type'', ''SystemAssigned''), createObject(''type'', ''UserAssigned'', + ''userAssignedIdentities'', createObject(format(''{0}'', parameters(''configObject'').managedIdentityId), + createObject())))]", "nfdvSymbolicName": "[format(''{0}/{1}/{2}'', parameters(''configObject'').publisherName, + parameters(''configObject'').nfdgName, parameters(''configObject'').nfdvName)]"}, + "resources": [{"copy": {"name": "nfResource", "count": "[length(parameters(''configObject'').deploymentParameters)]"}, + "type": "Microsoft.HybridNetwork/networkFunctions", "apiVersion": "2023-09-01", + "name": "[format(''{0}{1}'', parameters(''configObject'').nfdgName, copyIndex())]", + "location": "[parameters(''configObject'').location]", "identity": "[variables(''identityObject'')]", + "properties": {"networkFunctionDefinitionVersionResourceReference": {"id": "[extensionResourceId(format(''/subscriptions/{0}/resourceGroups/{1}'', + subscription().subscriptionId, parameters(''configObject'').publisherResourceGroup), + ''Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions'', + split(variables(''nfdvSymbolicName''), ''/'')[0], split(variables(''nfdvSymbolicName''), + ''/'')[1], split(variables(''nfdvSymbolicName''), ''/'')[2])]", "idType": "Open"}, + "nfviType": "AzureCore", "nfviId": "[if(equals(parameters(''configObject'').customLocationId, + ''''), variables(''resourceGroupId''), parameters(''configObject'').customLocationId)]", + "allowSoftwareUpdate": true, "configurationType": "Open", "deploymentValues": + "[string(parameters(''configObject'').deploymentParameters[copyIndex()])]"}}]}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1990' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/blobs/uploads/a90bd350-1fc7-4a62-8064-a7842117cb20?_nouploadcache=false&_state=r7Im6L9IIg9gDRBWFUuyTXv6JD9a2RBZykqQcvhmxrJ7Ik5hbWUiOiJ1YnVudHUiLCJVVUlEIjoiYTkwYmQzNTAtMWZjNy00YTYyLTgwNjQtYTc4NDIxMTdjYjIwIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDI0LTAzLTI2VDE3OjUwOjA0Ljc0MDI4MTAyNloifQ%3D%3D&digest=sha256%3A6b00a79ed3e0b9f11f3c6aafeaae2d6ee12f2a43a25090d1c44fdc492d5f55d5 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:50:10 GMT + docker-content-digest: + - sha256:6b00a79ed3e0b9f11f3c6aafeaae2d6ee12f2a43a25090d1c44fdc492d5f55d5 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu/blobs/sha256:6b00a79ed3e0b9f11f3c6aafeaae2d6ee12f2a43a25090d1c44fdc492d5f55d5 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu", "Action": "pull"}, {"Type": "repository", + "Name": "ubuntu", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '270' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:10 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token",service="automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io",scope="repository:ubuntu:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token?service=automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io&scope=repository%3Aubuntu%3Apull%2Cpush + response: + body: + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:10 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:50:10 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - e6869643-1d57-4745-8f17-90a9f546eaee + location: + - /v2/ubuntu/blobs/uploads/e6869643-1d57-4745-8f17-90a9f546eaee?_nouploadcache=false&_state=sm5yJR70r_SZKbBmu5UcNV6HaGstgA_EUwuRSK0RGYx7Ik5hbWUiOiJ1YnVudHUiLCJVVUlEIjoiZTY4Njk2NDMtMWQ1Ny00NzQ1LThmMTctOTBhOWY1NDZlYWVlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDI0LTAzLTI2VDE3OjUwOjEwLjEyNTQ5NjI2OFoifQ%3D%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/blobs/uploads/e6869643-1d57-4745-8f17-90a9f546eaee?_nouploadcache=false&_state=sm5yJR70r_SZKbBmu5UcNV6HaGstgA_EUwuRSK0RGYx7Ik5hbWUiOiJ1YnVudHUiLCJVVUlEIjoiZTY4Njk2NDMtMWQ1Ny00NzQ1LThmMTctOTBhOWY1NDZlYWVlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDI0LTAzLTI2VDE3OjUwOjEwLjEyNTQ5NjI2OFoifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:50:10 GMT + docker-content-digest: + - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 1990, + "digest": "sha256:6b00a79ed3e0b9f11f3c6aafeaae2d6ee12f2a43a25090d1c44fdc492d5f55d5", + "annotations": {"org.opencontainers.image.title": "ubuntu-vm.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '498' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/manifests/1.0.0 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu", "Action": "pull"}, {"Type": "repository", + "Name": "ubuntu", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '270' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:10 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token",service="automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io",scope="repository:ubuntu:push,pull" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/oauth2/token?service=automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io&scope=repository%3Aubuntu%3Apush%2Cpull + response: + body: + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:10 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 1990, + "digest": "sha256:6b00a79ed3e0b9f11f3c6aafeaae2d6ee12f2a43a25090d1c44fdc492d5f55d5", + "annotations": {"org.opencontainers.image.title": "ubuntu-vm.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '498' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://automatedclitestsubuntupublisherubuntuac19ff03324d.azurecr.io/v2/ubuntu/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Tue, 26 Mar 2024 17:50:10 GMT + docker-content-digest: + - sha256:0739fd6a63dca7205160b42cf62fb18a150de6f2ff0d2bce1130abcf9ef6c0ec + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu/manifests/sha256:0739fd6a63dca7205160b42cf62fb18a150de6f2ff0d2bce1130abcf9ef6c0ec + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "15149419403364783370"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ConfigGroupSchema", + "type": "object", "properties": {"ubuntu": {"type": "object", "properties": + {"nfdvName": {"type": "string"}, "deploymentParameters": {"type": "array", "items": + {"type": "object", "properties": {"automated-cli-tests-artifact": {"type": "object", + "properties": {"subnetName": {"type": "string"}, "virtualNetworkId": {"type": + "string"}, "sshPublicKeyAdmin": {"type": "string"}}, "required": ["subnetName", + "virtualNetworkId", "sshPublicKeyAdmin"]}}, "required": ["automated-cli-tests-artifact"]}}, + "managedIdentityId": {"type": "string"}}, "required": ["nfdvName", "deploymentParameters", + "managedIdentityId"]}}, "required": ["ubuntu"]}, "$fxv#1": {"configObject": + {"location": "uksouth", "publisherName": "automated-cli-tests-ubuntu-publisher", + "nfdgName": "ubuntu-vm", "publisherResourceGroup": "cli_test_vnf_nsd_000001", + "customLocationId": "", "nfdvName": "{configurationparameters(''ConfigGroupSchema'').ubuntu.nfdvName}", + "deploymentParameters": "{configurationparameters(''ConfigGroupSchema'').ubuntu.deploymentParameters}", + "managedIdentityId": "{configurationparameters(''ConfigGroupSchema'').ubuntu.managedIdentityId}"}}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "configurationGroupSchemaReferences": {"ConfigGroupSchema": {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu", "type": "NetworkFunctionDefinition", + "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": + "ubuntu", "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ConfigGroupSchema'')]"]}]}, "parameters": {"location": + {"value": "uksouth"}, "publisherName": {"value": "automated-cli-tests-ubuntu-publisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4162' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475418", + "name": "AOSM_CLI_deployment_1711475418", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15149419403364783370", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", + "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, + "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", + "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": + "PT0S", "correlationId": "42260aba-3dd0-492d-96ae-d3e0b5fcb4c5", "providers": + [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/configurationGroupSchemas", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": + ["uksouth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/configurationGroupSchemas/ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "automated-cli-tests-ubuntu-publisher/ConfigGroupSchema"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu/1.0.0"}], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/configurationGroupSchemas/ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2505' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "15149419403364783370"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ConfigGroupSchema", + "type": "object", "properties": {"ubuntu": {"type": "object", "properties": + {"nfdvName": {"type": "string"}, "deploymentParameters": {"type": "array", "items": + {"type": "object", "properties": {"automated-cli-tests-artifact": {"type": "object", + "properties": {"subnetName": {"type": "string"}, "virtualNetworkId": {"type": + "string"}, "sshPublicKeyAdmin": {"type": "string"}}, "required": ["subnetName", + "virtualNetworkId", "sshPublicKeyAdmin"]}}, "required": ["automated-cli-tests-artifact"]}}, + "managedIdentityId": {"type": "string"}}, "required": ["nfdvName", "deploymentParameters", + "managedIdentityId"]}}, "required": ["ubuntu"]}, "$fxv#1": {"configObject": + {"location": "uksouth", "publisherName": "automated-cli-tests-ubuntu-publisher", + "nfdgName": "ubuntu-vm", "publisherResourceGroup": "cli_test_vnf_nsd_000001", + "customLocationId": "", "nfdvName": "{configurationparameters(''ConfigGroupSchema'').ubuntu.nfdvName}", + "deploymentParameters": "{configurationparameters(''ConfigGroupSchema'').ubuntu.deploymentParameters}", + "managedIdentityId": "{configurationparameters(''ConfigGroupSchema'').ubuntu.managedIdentityId}"}}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "configurationGroupSchemaReferences": {"ConfigGroupSchema": {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu", "type": "NetworkFunctionDefinition", + "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": + "ubuntu", "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ConfigGroupSchema'')]"]}]}, "parameters": {"location": + {"value": "uksouth"}, "publisherName": {"value": "automated-cli-tests-ubuntu-publisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4162' + Content-Type: + - application/json + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475418", + "name": "AOSM_CLI_deployment_1711475418", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15149419403364783370", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", + "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, + "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", + "provisioningState": "Accepted", "timestamp": "2024-03-26T17:50:20.5990529Z", + "duration": "PT0.0007746S", "correlationId": "9dae32ec-f89f-48de-aec1-074ee6d8c1d2", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/configurationGroupSchemas", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": + ["uksouth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/configurationGroupSchemas/ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "automated-cli-tests-ubuntu-publisher/ConfigGroupSchema"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu/1.0.0"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475418/operationStatuses/08584901314650570735?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '2015' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901314650570735?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901314650570735?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:50:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08584901314650570735?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:51:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - --build-output-folder + User-Agent: + - AZURECLI/2.56.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1711475418", + "name": "AOSM_CLI_deployment_1711475418", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15149419403364783370", "parameters": {"location": + {"type": "String", "value": "uksouth"}, "publisherName": {"type": "String", + "value": "automated-cli-tests-ubuntu-publisher"}, "acrArtifactStoreName": + {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", + "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, + "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", + "provisioningState": "Succeeded", "timestamp": "2024-03-26T17:50:57.7471387Z", + "duration": "PT37.1488604S", "correlationId": "9dae32ec-f89f-48de-aec1-074ee6d8c1d2", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/configurationGroupSchemas", "locations": ["uksouth"]}, {"resourceType": + "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": + ["uksouth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/configurationGroupSchemas/ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "automated-cli-tests-ubuntu-publisher/ConfigGroupSchema"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "automated-cli-tests-ubuntu-publisher/ubuntu/1.0.0"}], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/configurationGroupSchemas/ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-cli-tests-ubuntu-publisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2519' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 26 Mar 2024 17:51:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_cnf_build_and_publish.py b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_cnf_build_and_publish.py new file mode 100644 index 00000000000..e8c9e7bf806 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_cnf_build_and_publish.py @@ -0,0 +1,141 @@ +# # -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +"""Integration tests for the cnf definition type commands in the aosm extension. +They test the following commands: + aosm nfd build + aosm nfd publish +""" +# We are only testing the nfd and not the nsd commands here. This is because the nsd commands +# are tested in the vnf tests and the nsd code path is the same for both vnf and cnf. + +import os +import logging +import sys +import unittest.mock as mock +from tempfile import TemporaryDirectory + +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from knack.log import get_logger +from azext_aosm.tests.latest.integration_tests.utils import ( + mock_in_unit_test, + update_input_file, + get_path_to_test_chart, +) +from azext_aosm.tests.latest.integration_tests.scenario_tests.recording_processors import ( + TokenReplacer, + SasUriReplacer, + BlobStoreUriReplacer, + UsernameReplacer, +) + +logger = get_logger(__name__) + +# We use the TEMPLATE file as a jinja2 template to populate some input parameters at runtime. +NFD_INPUT_TEMPLATE_NAME = "cnf_input_template.jsonc" +NFD_INPUT_FILE_NAME = "cnf_input.jsonc" + + +def patch_call_subprocess_raise_output(unit_test): + """Patch the call_subprocess_raise_output function to return a valid mocked output.""" + + # call_subprocess_raise_output uses subprocess.run to call a command and return the output. + # Subprocess is not recorded by the python vcr which means that in the playback we are + # actually trying to run commands like logging into ACRs, which will fail. To avoid this + # we mock the call_subprocess_raise_output function to return a valid mocked output. + def _mock_call_subprocess_raise_output( + *args, **kwargs + ): # pylint: disable=unused-argument + mocked_output = "Valid mocked output" + mocked_call_subprocess_raise_output = mock.Mock(return_value=mocked_output) + return mocked_call_subprocess_raise_output + + # Mock this function in all relevant files + mock_in_unit_test( + unit_test, + "azext_aosm.common.artifact.call_subprocess_raise_output", + _mock_call_subprocess_raise_output, + ) + + mock_in_unit_test( + unit_test, + "azext_aosm.common.registry.call_subprocess_raise_output", + _mock_call_subprocess_raise_output, + ) + + mock_in_unit_test( + unit_test, + "azext_aosm.common.utils.call_subprocess_raise_output", + _mock_call_subprocess_raise_output, + ) + + +class CnfNfdTest(ScenarioTest): + """ + Integration tests for the aosm extension for cnf definition type. + + This test uses Live Scenario Test because it depends on using the `az login` command + which does not work when playing back from the recording. + """ + + def __init__(self, method_name): + """ + This constructor initializes the class + :param method_name: The name of the test method. + :param recording_processors: The recording processors to use for the test. + These recording processors modify the recording of a test before it is saved, + helping to remove sensitive information from the recording. + :param replay_patches: The patches to apply when replaying the test. + These patches modify the test to use mocked functions instead of making live calls. + They will not be applied in live tests. + """ + logging.basicConfig(level=logging.INFO, stream=sys.stdout) + super().__init__( + method_name, + recording_processors=[ + TokenReplacer(), + SasUriReplacer(), + BlobStoreUriReplacer(), + UsernameReplacer(), + ], + replay_patches=[patch_call_subprocess_raise_output], + ) + + @ResourceGroupPreparer(name_prefix="cli_test_cnf_nfd_", location="uksouth") + def test_cnf_nfd_build_and_publish(self, resource_group): + """ + This test builds a cnf nfd output folder and publishes it. + The resource group used is created by the ResourceGroupPreparer decorator + and is deleted at the end of the live test. + + :param resource_group: The name of the resource group to use for the test. + This is passed in by the ResourceGroupPreparer decorator. + """ + starting_directory = os.getcwd() + + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + chart_path = get_path_to_test_chart() + + nfd_input_file_path = os.path.join(test_dir, NFD_INPUT_FILE_NAME) + + update_input_file( + NFD_INPUT_TEMPLATE_NAME, + nfd_input_file_path, + params={ + "publisher_resource_group_name": resource_group, + "path_to_chart": chart_path, + }, + ) + + self.cmd( + f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type cnf' + ) + + self.cmd("az aosm nfd publish -b cnf-cli-output --definition-type cnf") + finally: + os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_vnf_build_and_publish.py b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_vnf_build_and_publish.py new file mode 100644 index 00000000000..e77711b7666 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/scenario_tests/test_aosm_vnf_build_and_publish.py @@ -0,0 +1,124 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Integration tests for the vnf definition type commands in the aosm extension. +They test the following commands: + aosm nfd build + aosm nfd publish + aosm nsd build + aosm nsd publish +""" + +import os +import logging +import sys +import shutil +from tempfile import TemporaryDirectory + +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from knack.log import get_logger +from azext_aosm.tests.latest.integration_tests.scenario_tests.recording_processors import ( + TokenReplacer, + SasUriReplacer, + BlobStoreUriReplacer, + UsernameReplacer, +) +from azext_aosm.tests.latest.integration_tests.utils import ( + update_input_file, + get_path_to_vnf_mocks, +) + +logger = get_logger(__name__) + +# We use the TEMPLATE files as a jinja2 templates to populate some input parameters at runtime. +NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.jsonc" +NFD_INPUT_FILE_NAME = "vnf_input.jsonc" +NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.jsonc" +NSD_INPUT_FILE_NAME = "nsd_input.jsonc" +ARM_TEMPLATE_NAME = "ubuntu_template.json" +VHD_NAME = "ubuntu.vhd" + + +class VnfNsdTest(ScenarioTest): + """This class contains the integration tests for the aosm extension for vnf definition type.""" + + def __init__(self, method_name): + """ + This constructor initializes the class + :param method_name: The name of the test method. + :param recording_processors: The recording processors to use for the test. + These recording processors modify the recording of a test before it is saved, + helping to remove sensitive information from the recording. + """ + logging.basicConfig(level=logging.INFO, stream=sys.stdout) + super().__init__( + method_name, + recording_processors=[ + TokenReplacer(), + SasUriReplacer(), + BlobStoreUriReplacer(), + UsernameReplacer(), + ], + ) + + @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="uksouth") + def test_vnf_nsd_build_and_publish(self, resource_group): + """ + This test creates a vnf nfd and nsd, publishes them. + The resource group is created by the ResourceGroupPreparer decorator + and is deleted at the end of the live test. + + :param resource_group: The name of the resource group to use for the test. + This is passed in by the ResourceGroupPreparer decorator. + """ + starting_directory = os.getcwd() + + vnf_mocks_dir = get_path_to_vnf_mocks() + + arm_template_path = os.path.join(vnf_mocks_dir, ARM_TEMPLATE_NAME) + + vhd_path = os.path.join(vnf_mocks_dir, VHD_NAME) + + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + # For ORAS push to work, we need the arm template to be in the + # current working directory. + arm_template_in_temp_dir = os.path.join(test_dir, ARM_TEMPLATE_NAME) + + shutil.copy(arm_template_path, arm_template_in_temp_dir) + + nfd_input_file_path = os.path.join(test_dir, NFD_INPUT_FILE_NAME) + + update_input_file( + NFD_INPUT_TEMPLATE_NAME, + nfd_input_file_path, + params={ + "publisher_resource_group_name": resource_group, + "arm_template_path": arm_template_in_temp_dir, + "vhd_path": vhd_path, + }, + ) + + self.cmd( + f'az aosm nfd build --config-file "{nfd_input_file_path}" --definition-type vnf' + ) + + self.cmd( + "az aosm nfd publish --build-output-folder vnf-cli-output --definition-type vnf" + ) + + nsd_input_file_path = os.path.join(test_dir, NSD_INPUT_FILE_NAME) + update_input_file( + NSD_INPUT_TEMPLATE_NAME, + nsd_input_file_path, + params={"publisher_resource_group_name": resource_group}, + ) + + self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}"') + + self.cmd("az aosm nsd publish --build-output-folder nsd-cli-output") + finally: + os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/test_cnf.py b/src/aosm/azext_aosm/tests/latest/integration_tests/test_cnf.py new file mode 100644 index 00000000000..08878fcde45 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/test_cnf.py @@ -0,0 +1,83 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import unittest +import json +import os +from tempfile import TemporaryDirectory + +from azext_aosm.custom import ( + onboard_nfd_generate_config, + onboard_nfd_build, +) + +from azext_aosm.tests.latest.integration_tests.utils import ( + update_input_file, + get_path_to_test_chart, +) + +# We use the TEMPLATE file as a jinja2 template to populate some input parameters at runtime. +INPUT_TEMPLATE_NAME = "cnf_input_template.jsonc" +INPUT_FILE_NAME = "cnf_input.jsonc" + + +class TestCNF(unittest.TestCase): + def test_generate_config(self): + """Test generating a config file for a VNF.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + output_file_path = os.path.join(test_dir, "cnf_input.jsonc") + + try: + onboard_nfd_generate_config( + definition_type="cnf", + output_file=os.path.join(test_dir, output_file_path), + ) + assert os.path.exists(output_file_path) + finally: + os.chdir(starting_directory) + + def test_build(self): + """Test the build command for CNFs.""" + starting_directory = os.getcwd() + + chart_path = get_path_to_test_chart() + + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + cnf_input_file_path = os.path.join(test_dir, INPUT_FILE_NAME) + + update_input_file( + INPUT_TEMPLATE_NAME, + cnf_input_file_path, + params={ + "publisher_resource_group_name": "cli_test_cnf_nfd", + "path_to_chart": chart_path, + }, + ) + + onboard_nfd_build("cnf", cnf_input_file_path) + assert os.path.exists("cnf-cli-output") + + assert os.path.exists("cnf-cli-output/all_deploy.parameters.json") + + expected_deploy_params = { + "location": "uksouth", + "publisherName": "automated-cli-tests-nginx-publisher", + "publisherResourceGroupName": "cli_test_cnf_nfd", + "acrArtifactStoreName": "nginx-acr", + "acrManifestName": "nginx-acr-manifest-1-0-0", + "nfDefinitionGroup": "nginx", + "nfDefinitionVersion": "1.0.0", + } + with open( + "cnf-cli-output/all_deploy.parameters.json" + ) as allDeployParametersFile: + params = json.load(allDeployParametersFile) + assert params == expected_deploy_params + finally: + os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/test_nsd.py b/src/aosm/azext_aosm/tests/latest/integration_tests/test_nsd.py new file mode 100644 index 00000000000..5b19443e5b5 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/test_nsd.py @@ -0,0 +1,419 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import json +import os +import shutil +import subprocess +import logging +import sys +from dataclasses import dataclass +from distutils.dir_util import copy_tree +from filecmp import dircmp +from pathlib import Path +from tempfile import TemporaryDirectory +from typing import Any +from unittest.mock import patch +from azext_aosm.vendored_sdks.models import ( + VirtualNetworkFunctionDefinitionVersion, +) +from unittest import TestCase + +import jsonschema +from azure.core import exceptions as azure_exceptions +from azure.mgmt.resource.features.v2015_12_01.models import ( + FeatureProperties, + FeatureResult, +) + +from azext_aosm.custom import ( + onboard_nsd_build, + onboard_nsd_generate_config, +) + +from azext_aosm.vendored_sdks import HybridNetworkManagementClient + +mock_input_templates_folder = ( + (Path(__file__)).parent / "integration_test_mocks/mock_input_templates" +).resolve() +output_folder = ((Path(__file__).parent) / "nsd_output").resolve() + +NSD_INPUT_FILE_NAME = "nsd_core_input.jsonc" + +CGV_DATA = { + "ubuntu": { + "nfdvName": "exampleNfdvName", + "deploymentParameters": [ + { + "location": "eastus", + "subnetName": "subnet", + "virtualNetworkId": "bar", + "sshPublicKeyAdmin": "foo", + } + ], + "managedIdentityId": "blah", + }, +} + + +MULTIPLE_INSTANCES_CGV_DATA = { + "ubuntu": { + "nfdvName": "exampleNfdvName", + "deploymentParameters": [ + { + "location": "eastus", + "subnetName": "subnet", + "virtualNetworkId": "bar", + "sshPublicKeyAdmin": "foo", + }, + { + "location": "eastus", + "subnetName": "subnet2", + "virtualNetworkId": "bar2", + "sshPublicKeyAdmin": "foo2", + }, + ], + "managedIdentityId": "blah", + }, +} + + +MULTIPLE_NFs_CGV_DATA = { + "multi-nf": { + "nfdvName": "exampleNfdvName", + "managedIdentityId": "exampleManagedIdentityId", + "deploymentParameters": [ + {"service_port": 5222, "serviceAccount_create": False} + ], + }, + "ubuntu": { + "nfdvName": "exampleNfdvName", + "managedIdentity": "managed_identity", + "deploymentParameters": { + "location": "eastus", + "subnetName": "ubuntu-vm-subnet", + "ubuntuVmName": "ubuntu-vm", + "virtualNetworkId": "ubuntu-vm-vnet", + "sshPublicKeyAdmin": "public_key", + }, + }, +} + + +ubuntu_deploy_parameters = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": { + "location": {"type": "string"}, + "subnetName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, + "sshPublicKeyAdmin": {"type": "string"}, + }, +} + + +nginx_deploy_parameters = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": { + "serviceAccount_create": {"type": "boolean"}, + "service_port": {"type": "integer"}, + }, + "required": ["serviceAccount_create", "service_port"], +} + + +# We don't want to get details from a real NFD (calling out to Azure) in a UT. +# Therefore we pass in a fake client to supply the deployment parameters from the "NFD". +@dataclass +class NetworkFunctionTemplate: + nfvi_type: str + + +@dataclass +class NFDVProperties(VirtualNetworkFunctionDefinitionVersion): + deploy_parameters: str + network_function_template: NetworkFunctionTemplate # type: ignore + + +@dataclass +class NFDV: + properties: NFDVProperties + id: str + + +class NFDVs: + def get(self, network_function_definition_group_name, **_): + networkFunctionTemplate = NetworkFunctionTemplate(nfvi_type="AzureCore") + if "nginx" in network_function_definition_group_name: + return NFDV( + properties=NFDVProperties( + deploy_parameters=json.dumps(nginx_deploy_parameters), + network_function_template=networkFunctionTemplate, + ), + id="/subscriptions/00000/resourceGroups/rg/providers/Microsoft.HybridNetwork/publishers/pub/networkFunctionDefinitionGroups/nginx/networkFunctionDefinitionVersions/1.0.0", + ) + else: + return NFDV( + properties=NFDVProperties( + deploy_parameters=json.dumps(ubuntu_deploy_parameters), + network_function_template=networkFunctionTemplate, + ), + id="/subscriptions/00000/resourceGroups/rg/providers/Microsoft.HybridNetwork/publishers/pub/networkFunctionDefinitionGroups/ubuntu/networkFunctionDefinitionVersions/1.0.0", + ) + + +class AOSMClient(HybridNetworkManagementClient): + def __init__(self) -> None: + self.network_function_definition_versions = NFDVs() # type: ignore + + +mock_client = AOSMClient() + + +class MockFeatures: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Mock init.""" + self.mock_state = "NotRegistered" + + def get( + self, resource_provider_namespace: str, feature_name: str, **kwargs: Any + ) -> FeatureResult: + """Mock Features get function.""" + return FeatureResult( + name=feature_name, properties=FeatureProperties(state=self.mock_state) + ) + + +class MockMissingFeatures: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Fake init.""" + pass + + def get( + self, resource_provider_namespace: str, feature_name: str, **kwargs: Any + ) -> FeatureResult: + """Mock features get function that raises an exception.""" + raise azure_exceptions.ResourceNotFoundError() + + +class FeaturesClient: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Mock class for _check_features_enabled.""" + self.features = MockFeatures() + + +class MissingFeaturesClient: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Mock class for _check_features_enabled.""" + self.features = MockMissingFeatures() + + +class FakeCmd: + def __init__(self) -> None: + self.cli_ctx = None + + +mock_cmd = FakeCmd() + + +def validate_schema_against_metaschema(schema_data): + """Validate that the schema produced by the CLI matches the AOSM metaschema.""" + + # There is a bug in the jsonschema module that means that it hits an error in with + # the "$id" bit of the metaschema. Here we use a modified version of the metaschema + # with that small section removed. + metaschema_file_path = ( + (Path(__file__).parent) / "metaschema_modified.json" + ).resolve() + with open(metaschema_file_path, "r", encoding="utf8") as f: + metaschema = json.load(f) + + jsonschema.validate(instance=schema_data, schema=metaschema) + + +def validate_json_against_schema(json_data, schema_file): + """Validate some test data against the schema produced by the CLI.""" + with open(schema_file, "r", encoding="utf8") as f: + schema = json.load(f) + + validate_schema_against_metaschema(schema) + + jsonschema.validate(instance=json_data, schema=schema) + + +def build_bicep(bicep_template_path): + bicep_output = subprocess.run( # noqa + [ + str(shutil.which("az")), + "bicep", + "build", + "--file", + bicep_template_path, + ], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + if bicep_output.returncode != 0: + print(f"Invalid bicep: {bicep_template_path}") + print(str(bicep_output.stderr).replace("\\n", "\n").replace("\\t", "\t")) + raise RuntimeError("Invalid Bicep") + + +def compare_to_expected_output(expected_folder_name: str): + """ + Compares nsd-cli-output to the supplied folder name. + + :param expected_folder_name: The name of the folder within nsd_output to compare + with. + """ + # Check files and folders within the top level directory are the same. + expected_output_path = output_folder / expected_folder_name + comparison = dircmp("nsd-cli-output", expected_output_path) + + try: + assert len(comparison.diff_files) == 0 + assert len(comparison.left_only) == 0 + assert len(comparison.right_only) == 0 + + # Check the files and folders within each of the subdirectories are the same. + for subdir in comparison.subdirs.values(): + assert len(subdir.diff_files) == 0 + assert len(subdir.left_only) == 0 + assert len(subdir.right_only) == 0 + except: + copy_tree("nsd-cli-output", str(expected_output_path)) + print( + f"Output has changed in {expected_output_path}, use git diff to check if " + f"you are happy with those changes." + ) + raise + + +class TestNSDGenerator(TestCase): + def setUp(self): + # Prints out info logs in console if test fails + logging.basicConfig(level=logging.INFO, stream=sys.stdout) + + def test_generate_config(self): + """Test generating a config file for a VNF.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + output_file_path = os.path.join(test_dir, "nsd-input.jsonc") + + try: + onboard_nsd_generate_config(output_file_path) + assert os.path.exists(output_file_path) + finally: + os.chdir(starting_directory) + + @patch( + "azext_aosm.common.command_context.get_mgmt_service_client", + return_value=mock_client, + ) + def test_build(self, mock_get_mgmt_service_client): + """Test building the NSD bicep templates.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + nsd_input_file_path = os.path.join( + mock_input_templates_folder, NSD_INPUT_FILE_NAME + ) + + try: + onboard_nsd_build( + cmd=mock_cmd, + config_file=nsd_input_file_path, + ) + + assert os.path.exists("nsd-cli-output") + + validate_json_against_schema( + CGV_DATA, + "nsd-cli-output/nsdDefinition/config-group-schema.json", + ) + + compare_to_expected_output("test_build") + finally: + os.chdir(starting_directory) + + @patch( + "azext_aosm.common.command_context.get_mgmt_service_client", + return_value=mock_client, + ) + def test_build_multiple_instances(self, mock_get_mgmt_service_client): + # Parameter is not used but we need to include it for the patch to work + # TODO: this test passes but it doesn't actually test anything because + # This functionality is currently broken + """Test building the NSD bicep templates with multiple NFs allowed.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + onboard_nsd_build( + cmd=mock_cmd, + config_file=str( + mock_input_templates_folder / "input_multiple_instances.jsonc" + ), + ) + + assert os.path.exists("nsd-cli-output") + validate_json_against_schema( + MULTIPLE_INSTANCES_CGV_DATA, + "nsd-cli-output/nsdDefinition/config-group-schema.json", + ) + + compare_to_expected_output("test_build_multiple_instances") + finally: + os.chdir(starting_directory) + + # TODO: creating NSDs with multiple NFs is broken at the moment. + # Fix this test after the bug there is fixed. + # @patch( + # "azext_aosm.common.command_context.get_mgmt_service_client", + # return_value=mock_client, + # ) + # def test_build_multiple_nfs(self, mock_get_mgmt_service_client): + # """Test building the NSD bicep templates with multiple NFs allowed.""" + # starting_directory = os.getcwd() + # with TemporaryDirectory() as test_dir: + # os.chdir(test_dir) + + # try: + # onboard_nsd_build( + # cmd=mock_cmd, + # config_file=str(mock_input_templates_folder / "input_multi_nf_nsd.jsonc"), + # ) + + # assert os.path.exists("nsd-cli-output") + + # # The bicep checks take a while, so we would only do them here and not + # # on the other tests. However, they are disabled until we can look at + # # them further, as the version of Bicep used ends up in the built file, + # # and we don't control what version of bicep is used in the pipeline or + # # on the user's machine. + # # build_bicep("nsd-bicep-templates/nginx-nfdg_nf.bicep") + # # build_bicep("nsd-bicep-templates/ubuntu-nfdg_nf.bicep") + # # build_bicep("nsd-bicep-templates/nsd_definition.bicep") + # # build_bicep("nsd-bicep-templates/artifact_manifest.bicep") + + # compare_to_expected_output("test_build_multiple_nfs") + # finally: + # os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/test_vnf.py b/src/aosm/azext_aosm/tests/latest/integration_tests/test_vnf.py new file mode 100644 index 00000000000..1972affc4f3 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/test_vnf.py @@ -0,0 +1,123 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import json +import os +import unittest +from pathlib import Path +from tempfile import TemporaryDirectory + +from azext_aosm.custom import onboard_nfd_build, onboard_nfd_generate_config +from azext_aosm.tests.latest.integration_tests.utils import update_input_file +from azext_aosm.common.constants import VNF_OUTPUT_FOLDER_FILENAME + +mock_vnf_folder = ((Path(__file__).parent.parent) / "mock_vnf").resolve() + +INPUT_WITH_SAS_VHD_PARAMS = { + "imageDiskSizeGB": 30, + "imageHyperVGeneration": "V1", + "apiVersion": "2023-03-01", + "imageName": "ubuntu-vmImage", +} + +# We use the TEMPLATE files as a jinja2 templates to populate some input parameters at runtime. +NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.jsonc" +NFD_INPUT_FILE_NAME = "vnf_input.jsonc" +VNF_INPUT_WITH_SAS_TOKEN_TEMPLATE_NAME = "vnf_input_with_sas_token_template.jsonc" +ARM_TEMPLATE_NAME = "ubuntu_template.json" +VHD_NAME = "ubuntu.vhd" + + +def get_path_to_vnf_mocks(): + """Get the path to the vnf mocks directory.""" + code_dir = os.path.dirname(__file__) + vnf_mocks_dir = os.path.join(code_dir, "integration_test_mocks", "vnf_mocks") + + return vnf_mocks_dir + + +def validate_vhd_parameters(expected_params, vhd_params_file_path): + """Validate that the expected parameters are in the actual parameters.""" + assert os.path.exists(vhd_params_file_path) + with open(vhd_params_file_path) as f: + actual_params = json.load(f) + assert expected_params == actual_params + + +class TestVNF(unittest.TestCase): + def test_generate_config(self): + """Test generating a config file for a VNF.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + output_file_path = os.path.join(test_dir, "vnf_input.jsonc") + + try: + onboard_nfd_generate_config( + definition_type="vnf", + output_file=os.path.join(test_dir, output_file_path), + ) + assert os.path.exists(output_file_path) + finally: + os.chdir(starting_directory) + + def test_build_with_filepath(self): + """Test building an NFDV for a VNF using a filepath.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + vnf_mocks_dir = get_path_to_vnf_mocks() + + arm_template_path = os.path.join(vnf_mocks_dir, ARM_TEMPLATE_NAME) + vhd_path = os.path.join(vnf_mocks_dir, VHD_NAME) + + nfd_input_file_path = os.path.join(test_dir, NFD_INPUT_FILE_NAME) + + update_input_file( + NFD_INPUT_TEMPLATE_NAME, + nfd_input_file_path, + params={ + "publisher_resource_group_name": "resource_group", + "arm_template_path": arm_template_path, + "vhd_path": vhd_path, + }, + ) + + onboard_nfd_build("vnf", nfd_input_file_path) + assert os.path.exists(VNF_OUTPUT_FOLDER_FILENAME) + finally: + os.chdir(starting_directory) + + def test_build_with_sas_token(self): + """Test building an NFDV for a VNF using a filepath.""" + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + vnf_mocks_dir = get_path_to_vnf_mocks() + + arm_template_path = os.path.join(vnf_mocks_dir, ARM_TEMPLATE_NAME) + + nfd_input_file_path = os.path.join(test_dir, NFD_INPUT_FILE_NAME) + update_input_file( + VNF_INPUT_WITH_SAS_TOKEN_TEMPLATE_NAME, + nfd_input_file_path, + params={ + "publisher_resource_group_name": "resource_group", + "arm_template_path": arm_template_path, + }, + ) + + onboard_nfd_build("vnf", nfd_input_file_path) + assert os.path.exists(VNF_OUTPUT_FOLDER_FILENAME) + validate_vhd_parameters( + INPUT_WITH_SAS_VHD_PARAMS, + f"{VNF_OUTPUT_FOLDER_FILENAME}/nfDefinition/vhdParameters.json", + ) + finally: + os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/integration_tests/utils.py b/src/aosm/azext_aosm/tests/latest/integration_tests/utils.py new file mode 100644 index 00000000000..bdd20aaddf2 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/integration_tests/utils.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +""" This module provides utility functions for integration tests. """ +import os +import unittest +from typing import Dict +from jinja2 import Template + +from azure.cli.core.azclierror import CLIInternalError + +CHART_NAME = "nginxdemo-0.1.0.tgz" + + +def mock_in_unit_test(unit_test, target, replacement): + """Mock a function in a unit test.""" + + if not isinstance(unit_test, unittest.TestCase): + raise CLIInternalError("Patches can be only called from a unit test") + + patcher = unittest.mock.patch(target, replacement) + patcher.__enter__() + unit_test.addCleanup(patcher.__exit__, None, None, None) + + +def update_input_file(input_template_name, output_file_path, params: Dict[str, str]): + """Update the input file with the given parameters and return the path to the updated file.""" + code_dir = os.path.dirname(__file__) + templates_dir = os.path.join( + code_dir, "integration_test_mocks", "mock_input_templates" + ) + input_template_path = os.path.join(templates_dir, input_template_name) + + with open(input_template_path, "r", encoding="utf-8") as file: + contents = file.read() + + jinja_template = Template(contents) + + rendered_template = jinja_template.render(**params) + + with open(output_file_path, "w", encoding="utf-8") as file: + file.write(rendered_template) + + +def get_path_to_test_chart(): + """Get the path to the chart used in the tests.""" + code_dir = os.path.dirname(__file__) + templates_dir = os.path.join(code_dir, "integration_test_mocks", "cnf_mocks") + chart_path = os.path.join(templates_dir, CHART_NAME) + return chart_path + + +def get_path_to_vnf_mocks(): + """Get the path to the vnf mocks directory.""" + code_dir = os.path.dirname(__file__) + vnf_mocks_dir = os.path.join(code_dir, "integration_test_mocks", "vnf_mocks") + + return vnf_mocks_dir diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json deleted file mode 100644 index f6a97949291..00000000000 --- a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "publisher_name": "sunnyclipub", - "publisher_resource_group_name": "sunny-uksouth", - "nf_name": "nginx-basic-test", - "version": "0.1.0", - "acr_artifact_store_name": "sunny-nfagent-acr-2", - "location": "uksouth", - "images": - { - "source_registry": "this was nonsense just put something in to stop CLI complaining. The image was manually uploaded. /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/SIMPLVM-team-CI/providers/Microsoft.ContainerRegistry/registries/a4oSIMPL" - }, - "helm_packages": [ - { - "name": "nfconfigchart", - "path_to_chart": "helm-charts/nfconfigchart-0.1.0.tgz", - "path_to_mappings": "helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml", - "depends_on": [ - ] - } - ] -} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.jsonc b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.jsonc new file mode 100644 index 00000000000..c9830a0654c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.jsonc @@ -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": "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": "cli_test_cnf_nfd", + // 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": "nfconfigchart", + "path_to_chart": "helm-charts/nfconfigchart-0.1.0.tgz", + "default_values": "", + "depends_on": [] + } + ] +} diff --git a/src/aosm/azext_aosm/tests/latest/mock_core_vnf/input_with_fp.json b/src/aosm/azext_aosm/tests/latest/mock_core_vnf/input_with_fp.json index b3a3b991a1d..a527f0061a2 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_core_vnf/input_with_fp.json +++ b/src/aosm/azext_aosm/tests/latest/mock_core_vnf/input_with_fp.json @@ -1,18 +1,18 @@ { - "publisher_name": "jamie-mobile-publisher", - "publisher_resource_group_name": "Jamie-publisher", - "nf_name": "ubuntu-vm", - "version": "1.0.0", - "acr_artifact_store_name": "ubuntu-acr", - "location": "eastus", - "blob_artifact_store_name": "ubuntu-blob-store", - "image_name_parameter": "imageName", - "arm_template": { - "file_path": "ubuntu-template.json", - "version": "1.0.0" - }, - "vhd": { - "file_path": "livecd.ubuntu-cpc.azure.vhd", - "version": "1-0-0" - } + "publisher_name": "jamie-mobile-publisher", + "publisher_resource_group_name": "Jamie-publisher", + "nf_name": "ubuntu-vm", + "version": "1.0.0", + "acr_artifact_store_name": "ubuntu-acr", + "location": "eastus", + "blob_artifact_store_name": "ubuntu-blob-store", + "image_name_parameter": "imageName", + "arm_template": { + "file_path": "ubuntu-template.json", + "version": "1.0.0" + }, + "vhd": { + "file_path": "livecd.ubuntu-cpc.azure.vhd", + "version": "1-0-0" + } } diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json deleted file mode 100644 index c609de96eae..00000000000 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "location": "eastus", - "publisher_name": "jamie-mobile-publisher", - "publisher_resource_group_name": "Jamie-publisher", - "acr_artifact_store_name": "ubuntu-acr", - "network_functions": [ - { - "name": "ubuntu-vm-nfdg", - "version": "1.0.0", - "publisher_offering_location": "eastus", - "type": "vnf", - "multiple_instances": false, - "publisher": "jamie-mobile-publisher", - "publisher_resource_group": "Jamie-publisher" - } - ], - "nsd_name": "ubuntu", - "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json deleted file mode 100644 index 5820cb367ba..00000000000 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "publisher_name": "jamie-publisher", - "publisher_resource_group_name": "Jamie-multi-NF", - "acr_artifact_store_name": "acr", - "location": "eastus", - "network_functions": [ - { - "publisher": "reference-publisher", - "publisher_resource_group": "Reference-publisher", - "name": "nginx-nfdg", - "version": "1.0.0", - "publisher_offering_location": "eastus", - "type": "cnf", - "multiple_instances": "False" - }, - { - "publisher": "reference-publisher", - "publisher_resource_group": "Reference-publisher", - "name": "ubuntu-nfdg", - "version": "1.0.0", - "publisher_offering_location": "eastus", - "type": "vnf", - "multiple_instances": false - } - ], - "nsd_name": "multinf", - "nsd_version": "1.0.1", - "nsdv_description": "Test deploying multiple NFs" -} diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json deleted file mode 100644 index 0d8049734c4..00000000000 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "location": "eastus", - "publisher_name": "jamie-mobile-publisher", - "publisher_resource_group_name": "Jamie-publisher", - "acr_artifact_store_name": "ubuntu-acr", - "network_functions": [ - { - "name": "ubuntu-vm-nfdg", - "version": "1.0.0", - "publisher_offering_location": "eastus", - "type": "vnf", - "multiple_instances": "True", - "publisher": "jamie-mobile-publisher", - "publisher_resource_group": "Jamie-publisher" - } - ], - "nsd_name": "ubuntu", - "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json deleted file mode 100644 index 1d6fcf2b8f5..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "deploymentParametersObject": { - "deploymentParameters": [ - "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}" - ] - }, - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters('ubuntu_ConfigGroupSchema').managedIdentity}" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json deleted file mode 100644 index 287fa0a6106..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "ubuntu_ConfigGroupSchema", - "type": "object", - "properties": { - "ubuntu-vm-nfdg": { - "type": "object", - "properties": { - "deploymentParameters": { - "type": "object", - "properties": { - "location": { - "type": "string" - }, - "subnetName": { - "type": "string" - }, - "virtualNetworkId": { - "type": "string" - }, - "sshPublicKeyAdmin": { - "type": "string" - } - } - }, - "ubuntu_vm_nfdg_nfd_version": { - "type": "string", - "description": "The version of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-vm-nfdg." - } - }, - "required": [ - "deploymentParameters", - "ubuntu_vm_nfdg_nfd_version" - ] - }, - "managedIdentity": { - "type": "string", - "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." - } - }, - "required": [ - "ubuntu-vm-nfdg", - "managedIdentity" - ] -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep deleted file mode 100644 index 4158f8c6ccb..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Highly Confidential Material -// -// The template that the NSD invokes to create the Network Function from a published NFDV. - -@description('Publisher where the NFD is published') -param publisherName string = 'jamie-mobile-publisher' - -@description('Resource group where the NFD publisher exists') -param publisherResourceGroup string = 'Jamie-publisher' - -@description('NFD Group name for the Network Function') -param networkFunctionDefinitionGroupName string = 'ubuntu-vm-nfdg' - -@description('NFD version') -param ubuntu_vm_nfdg_nfd_version string - -@description('The managed identity that should be used to create the NF.') -param managedIdentity string - -param location string = 'eastus' - -param nfviType string = 'AzureCore' - -param resourceGroupId string = resourceGroup().id - -@secure() -param deploymentParametersObject object - -var deploymentParameters = deploymentParametersObject.deploymentParameters - -var identityObject = (managedIdentity == '') ? { - type: 'SystemAssigned' -} : { - type: 'UserAssigned' - userAssignedIdentities: { - '${managedIdentity}': {} - } -} - -resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { - name: publisherName - scope: resourceGroup(publisherResourceGroup) -} - -resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { - parent: publisher - name: networkFunctionDefinitionGroupName -} - -resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { - parent: nfdg - name: ubuntu_vm_nfdg_nfd_version - -} - -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { - name: 'ubuntu-vm-nfdg${i}' - location: location - identity: identityObject - properties: { - networkFunctionDefinitionVersionResourceReference: { - id: nfdv.id - idType: 'Open' - } - nfviType: nfviType - nfviId: resourceGroupId - allowSoftwareUpdate: true - configurationType: 'Secret' - secretDeploymentValues: string(values) - } -}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep deleted file mode 100644 index 1dddde744eb..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep +++ /dev/null @@ -1,39 +0,0 @@ -// 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 manifest to deploy for the ACR-backed Artifact Store') -param acrManifestNames array -@description('The name under which to store the ARM template') -param armTemplateNames array -@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') -param armTemplateVersion string - -resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { - name: publisherName - scope: resourceGroup() -} - -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { - parent: publisher - name: acrArtifactStoreName -} - -resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = [for (values, i) in armTemplateNames: { - parent: acrArtifactStore - name: acrManifestNames[i] - location: location - properties: { - artifacts: [ - { - artifactName: armTemplateNames[i] - artifactType: 'ArmTemplate' - artifactVersion: armTemplateVersion - } - ] - } -}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json deleted file mode 100644 index c903aa85a35..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "deploymentParametersObject": { - "deploymentParameters": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}" - }, - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters('ubuntu_ConfigGroupSchema').managedIdentity}" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep deleted file mode 100644 index 4158f8c6ccb..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Highly Confidential Material -// -// The template that the NSD invokes to create the Network Function from a published NFDV. - -@description('Publisher where the NFD is published') -param publisherName string = 'jamie-mobile-publisher' - -@description('Resource group where the NFD publisher exists') -param publisherResourceGroup string = 'Jamie-publisher' - -@description('NFD Group name for the Network Function') -param networkFunctionDefinitionGroupName string = 'ubuntu-vm-nfdg' - -@description('NFD version') -param ubuntu_vm_nfdg_nfd_version string - -@description('The managed identity that should be used to create the NF.') -param managedIdentity string - -param location string = 'eastus' - -param nfviType string = 'AzureCore' - -param resourceGroupId string = resourceGroup().id - -@secure() -param deploymentParametersObject object - -var deploymentParameters = deploymentParametersObject.deploymentParameters - -var identityObject = (managedIdentity == '') ? { - type: 'SystemAssigned' -} : { - type: 'UserAssigned' - userAssignedIdentities: { - '${managedIdentity}': {} - } -} - -resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { - name: publisherName - scope: resourceGroup(publisherResourceGroup) -} - -resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { - parent: publisher - name: networkFunctionDefinitionGroupName -} - -resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { - parent: nfdg - name: ubuntu_vm_nfdg_nfd_version - -} - -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { - name: 'ubuntu-vm-nfdg${i}' - location: location - identity: identityObject - properties: { - networkFunctionDefinitionVersionResourceReference: { - id: nfdv.id - idType: 'Open' - } - nfviType: nfviType - nfviId: resourceGroupId - allowSoftwareUpdate: true - configurationType: 'Secret' - secretDeploymentValues: string(values) - } -}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep deleted file mode 100644 index 1dddde744eb..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep +++ /dev/null @@ -1,39 +0,0 @@ -// 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 manifest to deploy for the ACR-backed Artifact Store') -param acrManifestNames array -@description('The name under which to store the ARM template') -param armTemplateNames array -@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') -param armTemplateVersion string - -resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { - name: publisherName - scope: resourceGroup() -} - -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { - parent: publisher - name: acrArtifactStoreName -} - -resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = [for (values, i) in armTemplateNames: { - parent: acrArtifactStore - name: acrManifestNames[i] - location: location - properties: { - artifacts: [ - { - artifactName: armTemplateNames[i] - artifactType: 'ArmTemplate' - artifactVersion: armTemplateVersion - } - ] - } -}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json deleted file mode 100644 index f3ec1f24aa3..00000000000 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "publisher_name": "automated-cli-tests-nginx-publisher", - "publisher_resource_group_name": "{{publisher_resource_group_name}}", - "nf_name": "nginx", - "version": "1.0.0", - "acr_artifact_store_name": "nginx-acr", - "location": "uaenorth", - "images":{ - "source_registry": "not-used-in-test-but-cannot-be-blank", - "source_registry_namespace": "" - }, - "helm_packages": [ - { - "name": "nginxdemo", - "path_to_chart": "{{path_to_chart}}", - "path_to_mappings": "", - "depends_on": [] - } - ] -} diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json deleted file mode 100644 index 81e42a38501..00000000000 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "location": "uaenorth", - "publisher_name": "automated-cli-tests-nginx-publisher", - "publisher_resource_group_name": "{{publisher_resource_group_name}}", - "acr_artifact_store_name": "nginx-acr", - "network_functions": [ - { - "name": "nginx-nfdg", - "version": "1.0.0", - "publisher_offering_location": "uaenorth", - "type": "cnf", - "multiple_instances": false, - "publisher": "automated-cli-tests-nginx-publisher", - "publisher_resource_group": "{{publisher_resource_group_name}}" - } - ], - "nsd_name": "nginx", - "nsd_version": "1.0.0", - "nsdv_description": "Deploys a basic NGINX CNF" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json deleted file mode 100644 index 1e40b229d7a..00000000000 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "location": "uaenorth", - "publisher_name": "automated-tests-ubuntuPublisher", - "publisher_resource_group_name": "cli_test_vnf_nsd_000001", - "acr_artifact_store_name": "ubuntu-acr", - "network_functions": [ - { - "name": "ubuntu-vm-nfdg", - "version": "1.0.0", - "publisher_offering_location": "uaenorth", - "type": "vnf", - "multiple_instances": false, - "publisher": "automated-tests-ubuntuPublisher", - "publisher_resource_group": "cli_test_vnf_nsd_000001" - } - ], - "nsd_name": "ubuntu", - "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json deleted file mode 100644 index fa4e8dd303d..00000000000 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "publisher_name": "automated-tests-ubuntuPublisher", - "publisher_resource_group_name": "cli_test_vnf_nsd_000001", - "acr_artifact_store_name": "ubuntu-acr", - "location": "uaenorth", - "nf_name": "ubuntu-vm", - "version": "1.0.0", - "blob_artifact_store_name": "ubuntu-blob-store", - "image_name_parameter": "imageName", - "arm_template": { - "file_path": "../vnf_mocks/ubuntu_template.json", - "version": "1.0.0" - }, - "vhd": { - "file_path": "../vnf_mocks/ubuntu.vhd", - "version": "1-0-0" - } -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json deleted file mode 100644 index f4ded903cb3..00000000000 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "publisher_name": "automated-cli-tests-ubuntu-publisher", - "publisher_resource_group_name": "{{publisher_resource_group_name}}", - "acr_artifact_store_name": "ubuntu-acr", - "location": "uaenorth", - "nf_name": "ubuntu-vm", - "version": "1.0.0", - "blob_artifact_store_name": "ubuntu-blob-store", - "image_name_parameter": "imageName", - "arm_template": { - "file_path": "../vnf_mocks/ubuntu_template.json", - "version": "1.0.0" - }, - "vhd": { - "file_path": "../vnf_mocks/ubuntu.vhd", - "version": "1-0-0" - } -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json deleted file mode 100644 index 0545d8595d6..00000000000 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "location": "uaenorth", - "publisher_name": "automated-cli-tests-ubuntu-publisher", - "publisher_resource_group_name": "{{publisher_resource_group_name}}", - "acr_artifact_store_name": "ubuntu-acr", - "network_functions": [ - { - "name": "ubuntu-vm-nfdg", - "version": "1.0.0", - "publisher_offering_location": "uaenorth", - "type": "vnf", - "multiple_instances": false, - "publisher": "automated-cli-tests-ubuntu-publisher", - "publisher_resource_group": "{{publisher_resource_group_name}}" - } - ], - "nsd_name": "ubuntu", - "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM" -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py deleted file mode 100644 index 38d43d5e92c..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ /dev/null @@ -1,117 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Integration tests for the aosm extension. They test the following commands for the -# cnf definition type: -# aosm nfd build -# aosm nfd publish -# aosm nfd delete -# aosm nsd build -# aosm nsd publish -# aosm nsd delete -# -# -------------------------------------------------------------------------------------------- - -import os -from typing import Dict - -from azure.cli.testsdk import LiveScenarioTest, ResourceGroupPreparer -from jinja2 import Template -from knack.log import get_logger - -logger = get_logger(__name__) - -NFD_INPUT_TEMPLATE_NAME = "cnf_input_template.json" -NFD_INPUT_FILE_NAME = "cnf_input.json" -NSD_INPUT_TEMPLATE_NAME = "cnf_nsd_input_template.json" -NSD_INPUT_FILE_NAME = "nsd_cnf_input.json" -CHART_NAME = "nginxdemo-0.1.0.tgz" - - -def get_path_to_chart(): - code_dir = os.path.dirname(__file__) - templates_dir = os.path.join(code_dir, "scenario_test_mocks", "cnf_mocks") - chart_path = os.path.join(templates_dir, CHART_NAME) - return chart_path - - -def update_input_file(input_template_name, output_file_name, params: Dict[str, str]): - code_dir = os.path.dirname(__file__) - templates_dir = os.path.join( - code_dir, "scenario_test_mocks", "mock_input_templates" - ) - input_template_path = os.path.join(templates_dir, input_template_name) - - with open(input_template_path, "r", encoding="utf-8") as file: - contents = file.read() - - jinja_template = Template(contents) - - rendered_template = jinja_template.render(**params) - - output_path = os.path.join(templates_dir, output_file_name) - - with open(output_path, "w", encoding="utf-8") as file: - file.write(rendered_template) - - return output_path - - -class CnfNsdTest(LiveScenarioTest): - """ - Integration tests for the aosm extension for cnf definition type. - - This test uses Live Scenario Test because it depends on using the `az login` command - which does not work when playing back from the recording. - """ - - @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="uaenorth") - def test_cnf_nsd_publish_and_delete(self, resource_group): - """ - This test creates a cnf nfd and nsd, publishes them, and then deletes them. - - :param resource_group: The name of the resource group to use for the test. - This is passed in by the ResourceGroupPreparer decorator. - """ - - chart_path = get_path_to_chart() - - nfd_input_file_path = update_input_file( - NFD_INPUT_TEMPLATE_NAME, - NFD_INPUT_FILE_NAME, - params={ - "publisher_resource_group_name": resource_group, - "path_to_chart": chart_path, - }, - ) - - self.cmd( - f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type cnf --force' - ) - - try: - self.cmd( - f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type cnf --debug --skip image-upload' - ) - except Exception: - self.cmd( - f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' - ) - raise - - nsd_input_file_path = update_input_file( - NSD_INPUT_TEMPLATE_NAME, - NSD_INPUT_FILE_NAME, - params={"publisher_resource_group_name": resource_group}, - ) - - self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --debug --force') - - try: - self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') - finally: - self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') - self.cmd( - f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' - ) diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py deleted file mode 100644 index fe10ce0d1de..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py +++ /dev/null @@ -1,39 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -import os -import unittest - -# from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest - -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), "..")) - -## Note: keeping this only as an example for what we could do -# class AosmScenarioTest(ScenarioTest): -# @ResourceGroupPreparer(name_prefix="cli_test_aosm") -# def test_aosm(self, resource_group): -# self.kwargs.update({"name": "test1"}) - -# self.cmd( -# "aosm create -g {rg} -n {name} --tags foo=doo", -# checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], -# ) -# self.cmd( -# "aosm update -g {rg} -n {name} --tags foo=boo", -# checks=[self.check("tags.foo", "boo")], -# ) -# count = len(self.cmd("aosm list").get_output_in_json()) -# self.cmd( -# "aosm show - {rg} -n {name}", -# checks=[ -# self.check("name", "{name}"), -# self.check("resourceGroup", "{rg}"), -# self.check("tags.foo", "boo"), -# ], -# ) -# self.cmd("aosm delete -g {rg} -n {name}") -# final_count = len(self.cmd("aosm list").get_output_in_json()) -# self.assertTrue(final_count, count - 1) diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py deleted file mode 100644 index 6f25a3d785b..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ /dev/null @@ -1,110 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# This is an integration tests for the aosm extension. It tests the following commands for the -# vnf definition type: -# aosm nfd build -# aosm nfd publish -# aosm nfd delete -# aosm nsd build -# aosm nsd publish -# aosm nsd delete -# -------------------------------------------------------------------------------------------- - -import os - -from azure.cli.testsdk import LiveScenarioTest, ResourceGroupPreparer -from jinja2 import Template -from knack.log import get_logger - -logger = get_logger(__name__) - -NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.json" -NFD_INPUT_FILE_NAME = "vnf_input.json" -NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" -NSD_INPUT_FILE_NAME = "nsd_input.json" -ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" - - -def update_resource_group_in_input_file( - input_template_name: str, output_file_name: str, resource_group: str -) -> str: - """ - This function updates the resource group name in the input template file and returns the - path to the updated file. - - :param input_template_name: The name of the input template file. - :param output_file_name: The name of the output file. - :param resource_group: The name of the resource group to update the input template with. - :return: The path to the updated input template file. - """ - code_dir = os.path.dirname(__file__) - templates_dir = os.path.join( - code_dir, "scenario_test_mocks", "mock_input_templates" - ) - input_template_path = os.path.join(templates_dir, input_template_name) - - with open(input_template_path, "r", encoding="utf-8") as file: - contents = file.read() - - jinja_template = Template(contents) - - rendered_template = jinja_template.render( - publisher_resource_group_name=resource_group - ) - - output_path = os.path.join(templates_dir, output_file_name) - - with open(output_path, "w", encoding="utf-8") as file: - file.write(rendered_template) - - return output_path - - -class VnfNsdTest(LiveScenarioTest): - """This class contains the integration tests for the aosm extension for vnf definition type.""" - - @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="uaenorth") - def test_vnf_nsd_publish_and_delete(self, resource_group): - """ - This test creates a vnf nfd and nsd, publishes them, and then deletes them. - - :param resource_group: The name of the resource group to use for the test. - This is passed in by the ResourceGroupPreparer decorator. - """ - nfd_input_file_path = update_resource_group_in_input_file( - NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group - ) - - self.cmd( - f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' - ) - - try: - self.cmd( - f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf' - ) - except Exception: - # If the command fails, then the test should fail. - # We still need to clean up the resources, so we run the delete command. - self.cmd( - f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' - ) - raise - - nsd_input_file_path = update_resource_group_in_input_file( - NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group - ) - - self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --force') - - try: - self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}"') - finally: - # If the command fails, then the test should fail. - # We still need to clean up the resources, so we run the delete command. - self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') - self.cmd( - f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' - ) diff --git a/src/aosm/azext_aosm/tests/latest/test_arm_input_template.py b/src/aosm/azext_aosm/tests/latest/test_arm_input_template.py deleted file mode 100644 index 070907f3116..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_arm_input_template.py +++ /dev/null @@ -1,12 +0,0 @@ -# from pathlib import Path -# import unittest - -# from azext_aosm.template_parsers.arm_parser import ArmParser - - -# class ArmParserTest(unittest.TestCase): -# here = Path(__file__).parent -# arm_parser = ArmParser(here / "mock_vnf/ubuntu-template.json") - -# assert arm_parser.get_defaults() == None -# assert arm_parser.get_schema() == {'location': {'type': 'string', 'defaultValue': '[resourceGroup().location]'}, 'subnetName': {'type': 'string'}, 'ubuntuVmName': {'type': 'string', 'defaultValue': 'ubuntu-vm'}, 'virtualNetworkId': {'type': 'string'}, 'sshPublicKeyAdmin': {'type': 'string'}, 'imageName': {'type': 'string'}} diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py deleted file mode 100644 index a8619cb8105..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ /dev/null @@ -1,67 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- -# import unittest -# import json -# import os -# from pathlib import Path -# from tempfile import TemporaryDirectory - -# from azext_aosm.custom import build_definition, generate_definition_config - - -# mock_cnf_folder = ((Path(__file__).parent) / "mock_cnf").resolve() - - -# class TestCNF(unittest.TestCase): -# def test_generate_config(self): -# """Test generating a config file for a VNF.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# generate_definition_config("cnf") -# assert os.path.exists("input.json") -# finally: -# os.chdir(starting_directory) - -# def test_build(self): -# """Test the build command for CNFs.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# build_definition( -# "cnf", str(mock_cnf_folder / "input-nfconfigchart.json") -# ) -# assert os.path.exists("nfd-bicep-nginx-basic-test") -# # Confirm that the generated schema file correctly handles array deployment params. -# assert os.path.exists("nfd-bicep-nginx-basic-test/schemas/deploymentParameters.json") -# with open("nfd-bicep-nginx-basic-test/schemas/deploymentParameters.json") as f: -# schema = json.load(f) -# assert schema["properties"]["imagePullSecrets_0"]["type"] == "string" -# finally: -# os.chdir(starting_directory) - -# def test_build_no_mapping(self): -# """ -# Test the build command for CNFs where no mapping file is supplied. - -# Also reorder the parameters. -# """ -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# build_definition( -# "cnf", -# str(mock_cnf_folder / "input-nf-agent-cnf.json"), -# order_params=True, -# ) -# assert os.path.exists("nfd-bicep-nf-agent-cnf") -# finally: -# os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py deleted file mode 100644 index da7df647934..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ /dev/null @@ -1,393 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- - -# import json -# import os -# import shutil -# import subprocess -# from dataclasses import dataclass -# from distutils.dir_util import copy_tree -# from filecmp import dircmp -# from pathlib import Path -# from tempfile import TemporaryDirectory -# from typing import Any -# from unittest.mock import Mock, patch - -# import jsonschema -# import pytest -# from azure.cli.core.azclierror import CLIInternalError -# from azure.core import exceptions as azure_exceptions -# from azure.mgmt.resource.features.v2015_12_01.models import ( -# FeatureProperties, -# FeatureResult, -# ) - -# from azext_aosm.custom import ( -# _check_features_enabled, -# build_design, -# generate_design_config, -# ) - -# mock_nsd_folder = ((Path(__file__).parent) / "mock_nsd").resolve() -# output_folder = ((Path(__file__).parent) / "nsd_output").resolve() - - -# CGV_DATA = { -# "ubuntu-vm-nfdg": { -# "deploymentParameters": { -# "location": "eastus", -# "subnetName": "subnet", -# "virtualNetworkId": "bar", -# "sshPublicKeyAdmin": "foo", -# }, -# "ubuntu_vm_nfdg_nfd_version": "1.0.0", -# }, -# "managedIdentity": "blah", -# } - - -# MULTIPLE_INSTANCES_CGV_DATA = { -# "ubuntu-vm-nfdg": { -# "deploymentParameters": [ -# { -# "location": "eastus", -# "subnetName": "subnet", -# "virtualNetworkId": "bar", -# "sshPublicKeyAdmin": "foo", -# }, -# { -# "location": "eastus", -# "subnetName": "subnet2", -# "virtualNetworkId": "bar2", -# "sshPublicKeyAdmin": "foo2", -# }, -# ], -# "ubuntu_vm_nfdg_nfd_version": "1.0.0", -# }, -# "managedIdentity": "blah", -# } - - -# MULTIPLE_NFs_CGV_DATA = { -# "managedIdentity": "managed_identity", -# "nginx-nfdg": { -# "customLocationId": "custom_location", -# "nginx_nfdg_nfd_version": "1.0.0", -# "deploymentParameters": {"service_port": 5222, "serviceAccount_create": False}, -# }, -# "ubuntu-nfdg": { -# "ubuntu_nfdg_nfd_version": "1.0.0", -# "deploymentParameters": { -# "location": "eastus", -# "subnetName": "ubuntu-vm-subnet", -# "ubuntuVmName": "ubuntu-vm", -# "virtualNetworkId": "ubuntu-vm-vnet", -# "sshPublicKeyAdmin": "public_key", -# }, -# }, -# } - - -# ubuntu_deploy_parameters = { -# "$schema": "https://json-schema.org/draft-07/schema#", -# "title": "DeployParametersSchema", -# "type": "object", -# "properties": { -# "location": {"type": "string"}, -# "subnetName": {"type": "string"}, -# "virtualNetworkId": {"type": "string"}, -# "sshPublicKeyAdmin": {"type": "string"}, -# }, -# } - -# nginx_deploy_parameters = { -# "$schema": "https://json-schema.org/draft-07/schema#", -# "title": "DeployParametersSchema", -# "type": "object", -# "properties": { -# "serviceAccount_create": {"type": "boolean"}, -# "service_port": {"type": "integer"}, -# }, -# "required": ["serviceAccount_create", "service_port"], -# } - - -# # We don't want to get details from a real NFD (calling out to Azure) in a UT. -# # Therefore we pass in a fake client to supply the deployment parameters from the "NFD". -# @dataclass -# class NFDVProperties: -# deploy_parameters: str - -# @dataclass -# class NFDV: -# properties: NFDVProperties - -# class NFDVs: -# def get(self, network_function_definition_group_name, **_): -# if "nginx" in network_function_definition_group_name: -# return NFDV(NFDVProperties(json.dumps(nginx_deploy_parameters))) -# else: -# return NFDV(NFDVProperties(json.dumps(ubuntu_deploy_parameters))) - - -# class AOSMClient: -# def __init__(self) -> None: -# self.network_function_definition_versions = NFDVs() - - -# mock_client = AOSMClient() - - -# class MockFeatures: -# """Mock class for _check_features_enabled.""" - -# def __init__(self) -> None: -# """Mock init.""" -# self.mock_state = "NotRegistered" - -# def get( -# self, resource_provider_namespace: str, feature_name: str, **kwargs: Any -# ) -> FeatureResult: -# """Mock Features get function.""" -# return FeatureResult( -# name=feature_name, properties=FeatureProperties(state=self.mock_state) -# ) - - -# class MockMissingFeatures: -# """Mock class for _check_features_enabled.""" - -# def __init__(self) -> None: -# """Fake init.""" -# pass - -# def get( -# self, resource_provider_namespace: str, feature_name: str, **kwargs: Any -# ) -> FeatureResult: -# """Mock features get function that raises an exception.""" -# raise azure_exceptions.ResourceNotFoundError() - - -# class FeaturesClient: -# """Mock class for _check_features_enabled.""" - -# def __init__(self) -> None: -# """Mock class for _check_features_enabled.""" -# self.features = MockFeatures() - - -# class MissingFeaturesClient: -# """Mock class for _check_features_enabled.""" - -# def __init__(self) -> None: -# """Mock class for _check_features_enabled.""" -# self.features = MockMissingFeatures() - - -# class FakeCmd: -# def __init__(self) -> None: -# self.cli_ctx = None - - -# mock_cmd = FakeCmd() - - -# def validate_schema_against_metaschema(schema_data): -# """Validate that the schema produced by the CLI matches the AOSM metaschema.""" - -# # There is a bug in the jsonschema module that means that it hits an error in with -# # the "$id" bit of the metaschema. Here we use a modified version of the metaschema -# # with that small section removed. -# metaschema_file_path = ( -# (Path(__file__).parent) / "metaschema_modified.json" -# ).resolve() -# with open(metaschema_file_path, "r", encoding="utf8") as f: -# metaschema = json.load(f) - -# jsonschema.validate(instance=schema_data, schema=metaschema) - - -# def validate_json_against_schema(json_data, schema_file): -# """Validate some test data against the schema produced by the CLI.""" -# with open(schema_file, "r", encoding="utf8") as f: -# schema = json.load(f) - -# validate_schema_against_metaschema(schema) - -# jsonschema.validate(instance=json_data, schema=schema) - - -# def build_bicep(bicep_template_path): -# bicep_output = subprocess.run( # noqa -# [ -# str(shutil.which("az")), -# "bicep", -# "build", -# "--file", -# bicep_template_path, -# ], -# stdout=subprocess.PIPE, -# stderr=subprocess.PIPE, -# ) - -# if bicep_output.returncode != 0: -# print(f"Invalid bicep: {bicep_template_path}") -# print(str(bicep_output.stderr).replace("\\n", "\n").replace("\\t", "\t")) -# raise RuntimeError("Invalid Bicep") - - -# def compare_to_expected_output(expected_folder_name: str): -# """ -# Compares nsd-bicep-templates to the supplied folder name. - -# :param expected_folder_name: The name of the folder within nsd_output to compare -# with. -# """ -# # Check files and folders within the top level directory are the same. -# expected_output_path = output_folder / expected_folder_name -# comparison = dircmp("nsd-bicep-templates", expected_output_path) - -# try: -# assert len(comparison.diff_files) == 0 -# assert len(comparison.left_only) == 0 -# assert len(comparison.right_only) == 0 - -# # Check the files and folders within each of the subdirectories are the same. -# for subdir in comparison.subdirs.values(): -# assert len(subdir.diff_files) == 0 -# assert len(subdir.left_only) == 0 -# assert len(subdir.right_only) == 0 -# except: -# copy_tree("nsd-bicep-templates", str(expected_output_path)) -# print( -# f"Output has changed in {expected_output_path}, use git diff to check if " -# f"you are happy with those changes." -# ) -# raise - - -# class TestNSDGenerator: -# def test_generate_config(self): -# """Test generating a config file for a VNF.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# generate_design_config() -# assert os.path.exists("input.json") -# finally: -# os.chdir(starting_directory) - -# @patch("azext_aosm.custom.cf_resources") -# def test_build(self, cf_resources): -# """Test building the NSD bicep templates.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# build_design( -# mock_cmd, -# client=mock_client, -# config_file=str(mock_nsd_folder / "input.json"), -# ) - -# assert os.path.exists("nsd-bicep-templates") -# validate_json_against_schema( -# CGV_DATA, -# "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", -# ) - -# compare_to_expected_output("test_build") -# finally: -# os.chdir(starting_directory) - -# @patch("azext_aosm.custom.cf_resources") -# def test_build_multiple_instances(self, cf_resources): -# """Test building the NSD bicep templates with multiple NFs allowed.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# build_design( -# mock_cmd, -# client=mock_client, -# config_file=str(mock_nsd_folder / "input_multiple_instances.json"), -# ) - -# assert os.path.exists("nsd-bicep-templates") -# validate_json_against_schema( -# MULTIPLE_INSTANCES_CGV_DATA, -# "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", -# ) - -# compare_to_expected_output("test_build_multiple_instances") -# finally: -# os.chdir(starting_directory) - -# @patch("azext_aosm.custom.cf_resources") -# def test_build_multiple_nfs(self, cf_resources): -# """Test building the NSD bicep templates with multiple NFs allowed.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# build_design( -# mock_cmd, -# client=mock_client, -# config_file=str(mock_nsd_folder / "input_multi_nf_nsd.json"), -# ) - -# assert os.path.exists("nsd-bicep-templates") -# validate_json_against_schema( -# MULTIPLE_NFs_CGV_DATA, -# "nsd-bicep-templates/schemas/multinf_ConfigGroupSchema.json", -# ) - -# # The bicep checks take a while, so we would only do them here and not -# # on the other tests. However, they are disabled until we can look at -# # them further, as the version of Bicep used ends up in the built file, -# # and we don't control what version of bicep is used in the pipeline or -# # on the user's machine. -# # build_bicep("nsd-bicep-templates/nginx-nfdg_nf.bicep") -# # build_bicep("nsd-bicep-templates/ubuntu-nfdg_nf.bicep") -# # build_bicep("nsd-bicep-templates/nsd_definition.bicep") -# # build_bicep("nsd-bicep-templates/artifact_manifest.bicep") - -# compare_to_expected_output("test_build_multiple_nfs") -# finally: -# os.chdir(starting_directory) - -# def test_check_features(self, caplog): -# """ -# Test the _check_features_enabled function. - -# Does not test the actual feature check, just that the function logs and raises -# exceptions appropriately. -# """ -# mock_features_client = FeaturesClient() -# mock_missing_features_client = MissingFeaturesClient() -# caplog.set_level("DEBUG") -# with patch("azext_aosm.custom.cf_features", return_value=mock_features_client): -# mock_features_client.features.mock_state = "NotRegistered" - -# with pytest.raises(CLIInternalError): -# _check_features_enabled(mock_cmd) -# assert "is not registered on the subscription" in caplog.text -# mock_features_client.features.mock_state = "Registered" -# _check_features_enabled(mock_cmd) - -# with patch( -# "azext_aosm.custom.cf_features", return_value=mock_missing_features_client -# ): -# with pytest.raises(CLIInternalError): -# _check_features_enabled(mock_cmd) -# assert ( -# "CLI encountered an error checking that your " -# "subscription has been onboarded to AOSM." in caplog.text -# ) diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py deleted file mode 100644 index 7aae2184e3a..00000000000 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ /dev/null @@ -1,93 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- - -# import json -# import os -# import unittest -# from pathlib import Path -# from tempfile import TemporaryDirectory - -# from azext_aosm.custom import build_definition, generate_definition_config - -# mock_vnf_folder = ((Path(__file__).parent) / "mock_vnf").resolve() -# vnf_output_directory = ((Path(__file__).parent) / "vnf_output").resolve() - -# INPUT_WITH_SAS_VHD_PARAMS = { -# "imageName": "ubuntu-vmImage", -# "imageDiskSizeGB": 30, -# "imageHyperVGeneration": "V1", -# "imageApiVersion": "2023-03-01", -# } - - -# def validate_vhd_parameters(expected_params, vhd_params_file_path): -# """Validate that the expected parameters are in the actual parameters.""" -# assert os.path.exists(vhd_params_file_path) -# with open(vhd_params_file_path) as f: -# actual_params = json.load(f) -# assert expected_params == actual_params - - -# class TestVNF(unittest.TestCase): -# def test_generate_config(self): -# """Test generating a config file for a VNF.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# generate_definition_config("vnf") -# assert os.path.exists("input.json") -# finally: -# os.chdir(starting_directory) - -# def test_build_with_filepath(self): -# """Test building an NFDV for a VNF using a filepath.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(vnf_output_directory / "ubuntu_with_filepath") - -# try: -# build_definition( -# "vnf", str(mock_vnf_folder / "input_with_filepath.json") # TODO: add force to ensure we overwrite -# ) -# assert os.path.exists("nfd-bicep-ubuntu-template") -# finally: -# os.chdir(starting_directory) - -# def test_build_with_sas_token(self): -# """Test building an NFDV for a VNF using a filepath.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(vnf_output_directory / "ubuntu_with_sas_token") - -# try: -# build_definition( -# "vnf", str(mock_vnf_folder / "input_with_sas_token.json") -# ) -# assert os.path.exists("nfd-bicep-ubuntu-template") -# print(os.listdir("nfd-bicep-ubuntu-template")) -# validate_vhd_parameters( -# INPUT_WITH_SAS_VHD_PARAMS, -# "nfd-bicep-ubuntu-template/configMappings/vhdParameters.json", -# ) -# finally: -# os.chdir(starting_directory) - -# def test_build_with_ordered_params(self): -# """Test building an NFDV for a VNF.""" -# starting_directory = os.getcwd() -# with TemporaryDirectory() as test_dir: -# os.chdir(test_dir) - -# try: -# build_definition( -# "vnf", -# str(mock_vnf_folder / "input_with_filepath.json"), -# order_params=True, -# ) -# assert os.path.exists("nfd-bicep-ubuntu-template") -# finally: -# os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/tests_utils.py b/src/aosm/azext_aosm/tests/latest/tests_utils.py deleted file mode 100644 index 2e34f3242e7..00000000000 --- a/src/aosm/azext_aosm/tests/latest/tests_utils.py +++ /dev/null @@ -1,42 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- - -import os -from typing import Dict - -from jinja2 import Template - - -def get_tests_path(): - code_directory = os.path.dirname(__file__) - tests_directory = os.path.join(code_directory, "../") - return tests_directory - - -def update_input_file(input_template_name, output_file_name, params: Dict[str, str]): - tests_directory = get_tests_path() - templates_directory = os.path.join( - tests_directory, "latest", "input_file_templates" - ) - output_files_directory = os.path.join( - tests_directory, "latest", "autogenerated_test_files" - ) - os.makedirs(output_files_directory, exist_ok=True) - - input_template_path = os.path.join(templates_directory, input_template_name) - - with open(input_template_path, "r", encoding="utf-8") as file: - contents = file.read() - - jinja_template = Template(contents) - - rendered_template = jinja_template.render(**params) - - output_path = os.path.join(output_files_directory, output_file_name) - - with open(output_path, "w", encoding="utf-8") as file: - file.write(rendered_template) - - return output_path diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_artifact_definition.py b/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_artifact_definition.py deleted file mode 100644 index e410269764d..00000000000 --- a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_artifact_definition.py +++ /dev/null @@ -1,119 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- - -# from pathlib import Path -# from unittest import TestCase -# from unittest.mock import call, MagicMock, patch, create_autospec - -# from azext_aosm.definition_folder.reader.artifact_definition import ArtifactDefinitionElement -# from azext_aosm.common.artifact import LocalFileACRArtifact - -# class TestArtifactDefinitionElement(TestCase): -# """Test the Artifact definition element.""" - - -# @patch("pathlib.Path.read_text") -# def test_deploy(self, mock_read_text): -# """Test deploying an Artifact definition element.""" - -# # Example artifacts.json -# # Fields other than type are ignored as Artifact classes are mocked. -# mock_read_text.return_value = """ -# [ -# { -# "artifact_type": "ArmTemplate", -# "artifact_name": "abc", -# "artifact_version": "1.0.0", -# "type": "MockType1", -# "file_path": "def" -# }, -# { -# "artifact_type": "ArmTemplate", -# "artifact_name": "ghi", -# "artifact_version": "2.1.1", -# "type": "MockType2", -# "file_path": "jkl" -# } -# ] -# """ - -# # Create artifact type mocks. -# mock_type_1 = LocalFileACRArtifact -# mock_type_2 = LocalFileACRArtifact -# mock_artifact_type_to_class = { -# "MockType1": mock_type_1, -# "MockType2": mock_type_2, -# } - -# with patch.dict( -# "azext_aosm.definition_folder.reader.artifact_definition.ARTIFACT_TYPE_TO_CLASS", -# mock_artifact_type_to_class -# ): -# # Create an Artifact definition element. -# element_path = Path("/element/path") -# definition_element = ArtifactDefinitionElement(element_path, False) - -# # Deploy the element. -# mock_config = MagicMock() -# mock_context = MagicMock() -# definition_element.deploy(config=mock_config, command_context=mock_context) - -# # Check results. -# mock_type_1.assert_has_calls( -# [ -# call.upload(), -# ] -# ) -# mock_type_2.assert_has_calls( -# [ -# call.upload(), -# ] -# ) - -# @patch("pathlib.Path.read_text") -# def test_delete(self, mock_read_text): -# """Test deleting an Artifact definition element.""" - -# # Example artifacts.json -# # Fields other than type are ignored as Artifact classes are mocked. -# mock_read_text.return_value = """ -# [ -# { -# "type": "MockType1", -# "artifact_manifest": "def", -# "file_path": "def" -# }, -# { -# "type": "MockType2", -# "artifact_manifest": "jkl", -# "file_path": "jkl" -# } -# ] -# """ - -# # Create artifact type mocks. -# mock_type_1 = LocalFileACRArtifact -# mock_type_2 = LocalFileACRArtifact -# mock_artifact_type_to_class = { -# "MockType1": mock_type_1, -# "MockType2": mock_type_2, -# } - -# with patch.dict( -# "azext_aosm.definition_folder.reader.artifact_definition.ARTIFACT_TYPE_TO_CLASS", -# mock_artifact_type_to_class -# ): -# # Create an Artifact definition element. -# # only_delete_on_clean is True, but this is not checked in the delete method. -# # It is expected to be checked in the owning DefinitionFolder before calling delete. -# element_path = Path("/element/path") -# definition_element = ArtifactDefinitionElement(element_path, True) - -# # Delete the element. -# # TODO: Implement? Currently no-op. -# definition_element.delete() - -# # Check results. -# # TODO: Implement. diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_bicep_definition.py b/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_bicep_definition.py deleted file mode 100644 index eca3fb78105..00000000000 --- a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_bicep_definition.py +++ /dev/null @@ -1,46 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- - -# from pathlib import Path -# from unittest import TestCase -# from unittest.mock import patch - -# from azext_aosm.definition_folder.reader.bicep_definition import BicepDefinitionElement - - -# class TestBicepDefinitionElement(TestCase): -# """Test the Bicep definition element.""" - -# def test_deploy(self): -# """Test deploying a Bicep definition element.""" -# # Set up any mocks. -# # TODO: Implement. - -# # Create a Bicep definition element. -# element_path = Path("/element/path") -# definition_element = BicepDefinitionElement(element_path, False) - -# # Deploy the element. -# definition_element.deploy() - -# # Check results. -# # TODO: Implement. - -# def test_delete(self): -# """Test deleting a Bicep definition element.""" -# # Set up any mocks. -# # TODO: Implement. - -# # Create a Bicep definition element. -# # only_delete_on_clean is True, but this is not checked in the delete method. -# # It is expected to be checked in the owning DefinitionFolder before calling delete. -# element_path = Path("/element/path") -# definition_element = BicepDefinitionElement(element_path, True) - -# # Delete the element. -# definition_element.delete() - -# # Check results. -# # TODO: Implement. diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_core_vnf_build.py b/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_core_vnf_build.py deleted file mode 100644 index 06ce64c0991..00000000000 --- a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_core_vnf_build.py +++ /dev/null @@ -1,105 +0,0 @@ -# from unittest import TestCase -# from unittest.mock import patch, MagicMock, Mock -# from pathlib import Path -# from typing import List -# from azext_aosm.cli_handlers.onboarding_core_vnf_handler import OnboardingCoreVNFCLIHandler -# from azext_aosm.definition_folder.builder.artifact_builder import ArtifactDefinitionElementBuilder -# from azext_aosm.definition_folder.builder.bicep_builder import BicepDefinitionElementBuilder -# from azext_aosm.definition_folder.builder.local_file_builder import LocalFileBuilder -# from azext_aosm.common.constants import VNF_OUTPUT_FOLDER_FILENAME, ARTIFACT_LIST_FILENAME -# from azext_aosm.build_processors.arm_processor import AzureCoreArmBuildProcessor -# from azext_aosm.build_processors.vhd_processor import VHDProcessor -# from azext_aosm.vendored_sdks.models import ( -# AzureCoreVhdImageDeployMappingRuleProfile, AzureCoreNetworkFunctionVhdApplication, -# AzureCoreVhdImageArtifactProfile, VhdImageArtifactProfile, VhdImageMappingRuleProfile, ApplicationEnablement -# ) - -# class VNFCoreBuildTest(TestCase): - -# def setUp(self): -# self.vnf_handler = OnboardingCoreVNFCLIHandler() - -# # def test_valid_nexus_config_provided(): -# # # give it nexus specific config -# # pass - -# # def test_invalid_nexus_config_provided(): -# # # give it nexus specific config with an error -# # pass - -# # def test_core_config_provided(): -# # # give it core specific config -# # pass - -# # # def test_build_base_bicep(self): -# # # with patch("pathlib.Path.write_text") as mock_write_text: -# # # self.nexus_vnf_cli_handler.build_base_bicep() -# # # mock_write_text.assert_called() - -# def test_build_artifact_list_type(self): -# """ Testing build artifact list for Nexus VNFs - -# Test if path is as expected, and if list returned is correct type -# """ -# self.vnf_handler.processors = MagicMock() -# artifact_list = self.vnf_handler.build_artifact_list() -# self.assertEqual(artifact_list.path, Path(VNF_OUTPUT_FOLDER_FILENAME, ARTIFACT_LIST_FILENAME)) -# self.assertIsInstance(artifact_list, ArtifactDefinitionElementBuilder) - -# def test_build_resource_bicep_type(self): -# """Testing build resource bicep for Nexus VNFs - -# We only need to test the type of the bicep and the supporting files, -# and that they have the correct names. -# This is because the complicated logic is tested in the processors tests. - -# """ -# # we are testing the rest of the logic in the processors? (are we? we should) -# # TODO: fix this mocking, it works for deploymentParameters but not for actual processors (duh?) -# # mocked_input = MagicMock() -# # arm_processor = AzureCoreArmProcessor(mocked_input) -# arm_input = MagicMock() -# vhd_input = MagicMock() -# arm_processor = AzureCoreArmBuildProcessor("arm_test", arm_input) -# vhd_processor = VHDProcessor("test_vhd", vhd_input) -# arm_processor = MagicMock(spec=AzureCoreArmBuildProcessor) -# vhd_processor = MagicMock(spec=VHDProcessor) -# # arm_processor = Mock(spec=AzureCoreArmBuildProcessor) -# # vhd_processor = Mock(spec=VHDProcessor) -# # assert isinstance(arm_processor, AzureCoreArmBuildProcessor) -# # # TODO: one of these returns local file build -# # vhd_processor.generate_nf_application.return_value = AzureCoreNetworkFunctionVhdApplication(name="test",depends_on_profile=None, -# # artifact_profile=AzureCoreVhdImageArtifactProfile( -# # artifact_store=None, -# # vhd_artifact_profile=VhdImageArtifactProfile( -# # vhd_name="vhd_name", -# # vhd_version="1-0-0", -# # ),), deploy_parameters_mapping_rule_profile=AzureCoreVhdImageDeployMappingRuleProfile( -# # application_enablement=ApplicationEnablement.ENABLED, -# # vhd_image_mapping_rule_profile=VhdImageMappingRuleProfile(user_configuration=None) -# # ) -# # ) -# arm_processor.generate_params_schema.return_value = {} -# # arm_processor.generate_parameters_file.return_value = LocalFileBuilder("", {}) -# vhd_processor.generate_params_schema.return_value = {} -# # We want to test a specific private method so disable the pylint warning -# # pylint: disable=protected-access -# vhd_processor._generate_mapping_rule_profile.return_value = AzureCoreVhdImageDeployMappingRuleProfile(application_enablement=None, vhd_image_mapping_rule_profile=None) -# self.vnf_handler.processors = [arm_processor, vhd_processor] -# resource_bicep = self.vnf_handler.build_resource_bicep() -# print(resource_bicep.supporting_files[1].path) -# # TODO: check that the nexus one contains deploymentParameters, imageParameters and at least one templateParams? -# # special assert? -# self.assertIsInstance(resource_bicep.supporting_files, List[LocalFileBuilder]) -# self.assertIsInstance(resource_bicep, BicepDefinitionElementBuilder) - -# # def test_build_all_parameters_json(): -# # def test_build_artifact_manifest(self): -# # # self.vnf_handler._generate_type_specific_artifact_manifest -# # self.vnf_handler.processors = MagicMock() -# # manifest_bicep = self.vnf_handler.build_manifest_bicep() -# # # We want to test a specific private method so disable the pylint warning -# # # pylint: disable=protected-access -# # (arm_list, sa_list) = self.vnf_handler._generate_type_specific_artifact_manifest(self.vnf_handler.processors[0]) -# # self.assertEqual() - diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_definition_folder.py b/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_definition_folder.py deleted file mode 100644 index 4ab1ca86719..00000000000 --- a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_definition_folder.py +++ /dev/null @@ -1,218 +0,0 @@ -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -------------------------------------------------------------------------------------------- - -# from pathlib import Path -# from unittest import TestCase -# from unittest.mock import call, MagicMock, patch - -# from azext_aosm.definition_folder.reader.definition_folder import DefinitionFolder - - -# class TestDefinitionFolderBuilder(TestCase): -# """Test the definition folder object.""" - -# @patch("azext_aosm.definition_folder.reader.definition_folder.BicepDefinitionElement") -# @patch("azext_aosm.definition_folder.reader.definition_folder.ArtifactDefinitionElement") -# @patch("pathlib.Path.read_text") -# def test_deploy(self, mock_read_text, mock_artifact_element, mock_bicep_element): -# """Test creating and deploying a definition folder.""" - -# # Example index.json -# mock_read_text.return_value = """ -# [ -# { -# "name": "biceptemplate", -# "type": "bicep" -# }, -# { -# "name": "artifactlist", -# "type": "artifact", -# "only_delete_on_clean": true -# } -# ] -# """ - -# # Create a parent mock to check correct call order. -# mock_elements = MagicMock() -# mock_elements.attach_mock(mock_bicep_element, "bicep_element") -# mock_elements.attach_mock(mock_artifact_element, "artifact_element") - -# # Create a definition folder -# folder_path = Path("/definition/folder/path") -# definition_folder = DefinitionFolder(folder_path) - -# # Deploy the definition folder -# definition_folder.deploy() - -# # Check that the elements were created and deployed in the expected order. -# mock_elements.assert_has_calls( -# [ -# call.bicep_element(folder_path / "biceptemplate", False), -# call.artifact_element(folder_path / "artifactlist", True), -# call.bicep_element().deploy(), -# call.artifact_element().deploy(), -# ] -# ) - -# @patch("azext_aosm.definition_folder.reader.definition_folder.BicepDefinitionElement") -# @patch("azext_aosm.definition_folder.reader.definition_folder.ArtifactDefinitionElement") -# @patch("pathlib.Path.read_text") -# def test_delete(self, mock_read_text, mock_artifact_element, mock_bicep_element): -# """Test creating and deploying a definition folder.""" - -# # Example index.json -# mock_read_text.return_value = """ -# [ -# { -# "name": "infratemplate", -# "type": "bicep", -# "only_delete_on_clean": true -# }, -# { -# "name": "biceptemplate", -# "type": "bicep" -# }, -# { -# "name": "artifactlist", -# "type": "artifact", -# "only_delete_on_clean": false -# } -# ] -# """ - -# # Set up mocks. -# mock_bicep_element().only_delete_on_clean.__bool__.side_effect = [False, True] -# mock_artifact_element().only_delete_on_clean.__bool__.return_value = False - -# # Create a parent mock to check correct call order. -# mock_elements = MagicMock() -# mock_elements.attach_mock(mock_bicep_element, "bicep_element") -# mock_elements.attach_mock(mock_artifact_element, "artifact_element") - -# # Create a definition folder -# folder_path = Path("/definition/folder/path") -# definition_folder = DefinitionFolder(folder_path) - -# # Call delete for the definition folder -# definition_folder.delete() - -# # Check that the elements were created and deleted in the expected order. -# # Delete should be in reverse order, and only_delete_on_clean should be respected. -# mock_elements.assert_has_calls( -# [ -# call.bicep_element(folder_path / "infratemplate", True), -# call.bicep_element(folder_path / "biceptemplate", False), -# call.artifact_element(folder_path / "artifactlist", False), -# call.artifact_element().only_delete_on_clean.__bool__(), -# call.artifact_element().delete(), -# call.bicep_element().only_delete_on_clean.__bool__(), -# call.bicep_element().delete(), -# call.bicep_element().only_delete_on_clean.__bool__(), -# ] -# ) -# self.assertEqual(mock_bicep_element().delete.call_count, 1) -# self.assertEqual(mock_artifact_element().delete.call_count, 1) - -# @patch("azext_aosm.definition_folder.reader.definition_folder.BicepDefinitionElement") -# @patch("azext_aosm.definition_folder.reader.definition_folder.ArtifactDefinitionElement") -# @patch("pathlib.Path.read_text") -# def test_delete_clean(self, mock_read_text, mock_artifact_element, mock_bicep_element): -# """Test creating and deploying a definition folder.""" - -# # Example index.json -# mock_read_text.return_value = """ -# [ -# { -# "name": "infratemplate", -# "type": "bicep", -# "only_delete_on_clean": true -# }, -# { -# "name": "biceptemplate", -# "type": "bicep" -# }, -# { -# "name": "artifactlist", -# "type": "artifact", -# "only_delete_on_clean": false -# } -# ] -# """ - -# # Create a parent mock to check correct call order. -# mock_elements = MagicMock() -# mock_elements.attach_mock(mock_bicep_element, "bicep_element") -# mock_elements.attach_mock(mock_artifact_element, "artifact_element") - -# # Create a definition folder -# folder_path = Path("/definition/folder/path") -# definition_folder = DefinitionFolder(folder_path) - -# # Call delete for the definition folder -# definition_folder.delete(clean=True) - -# # Check that the elements were created and deleted in the expected order. -# # Delete should be in reverse order, and only_delete_on_clean should be respected. -# mock_elements.assert_has_calls( -# [ -# call.bicep_element(folder_path / "infratemplate", True), -# call.bicep_element(folder_path / "biceptemplate", False), -# call.artifact_element(folder_path / "artifactlist", False), -# call.artifact_element().delete(), -# call.bicep_element().delete(), -# ] -# ) -# self.assertEqual(mock_bicep_element().delete.call_count, 2) -# self.assertEqual(mock_artifact_element().delete.call_count, 1) - -# @patch("pathlib.Path.read_text") -# def test_bad_index_file(self, mock_read_text): -# """Test that a bad index file raises an error.""" - -# # Example index.json -# mock_read_text.return_value = """ -# unicode_snowman.jpeg -# """ - -# # Attempt to create a definition folder, check an exception is raised. -# folder_path = Path("/definition/folder/path") -# with self.assertRaises(ValueError): -# DefinitionFolder(folder_path) - -# @patch("pathlib.Path.read_text") -# def test_index_missing_name(self, mock_read_text): -# """Test that an index file with a missing name raises an error.""" - -# # Example index.json -# mock_read_text.return_value = """ -# [ -# { -# "type": "bicep" -# } -# ] -# """ - -# # Attempt to create a definition folder, check an exception is raised. -# folder_path = Path("/definition/folder/path") -# with self.assertRaises(ValueError): -# DefinitionFolder(folder_path) - -# @patch("pathlib.Path.read_text") -# def test_index_missing_type(self, mock_read_text): -# """Test that an index file with a missing type raises an error.""" - -# # Example index.json -# mock_read_text.return_value = """ -# [ -# { -# "name": "biceptemplate" -# } -# ] -# """ - -# # Attempt to create a definition folder, check an exception is raised. -# folder_path = Path("/definition/folder/path") -# with self.assertRaises(ValueError): -# DefinitionFolder(folder_path) diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nexus_vnf_build.py b/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nexus_vnf_build.py deleted file mode 100644 index a4d74cf196d..00000000000 --- a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nexus_vnf_build.py +++ /dev/null @@ -1,61 +0,0 @@ -# from unittest import TestCase -# from unittest.mock import patch, MagicMock -# from pathlib import Path -# from typing import List -# from azext_aosm.cli_handlers.onboarding_nexus_vnf_handler import OnboardingNexusVNFCLIHandler -# from azext_aosm.definition_folder.builder.artifact_builder import ArtifactDefinitionElementBuilder -# from azext_aosm.definition_folder.builder.bicep_builder import BicepDefinitionElementBuilder -# from azext_aosm.definition_folder.builder.local_file_builder import LocalFileBuilder -# from azext_aosm.common.constants import VNF_OUTPUT_FOLDER_FILENAME, ARTIFACT_LIST_FILENAME - - -# class VNFNexusBuildTest(TestCase): - -# def setUp(self): -# self.nexus_handler = OnboardingNexusVNFCLIHandler() - -# # def test_valid_nexus_config_provided(): -# # # give it nexus specific config -# # pass - -# # def test_invalid_nexus_config_provided(): -# # # give it nexus specific config with an error -# # pass - -# # def test_core_config_provided(): -# # # give it core specific config -# # pass - -# # # def test_build_base_bicep(self): -# # # with patch("pathlib.Path.write_text") as mock_write_text: -# # # self.nexus_vnf_cli_handler.build_base_bicep() -# # # mock_write_text.assert_called() - -# def test_build_artifact_list_type(self): -# """ Testing build artifact list for Nexus VNFs - -# Test if path is as expected, and if list returned is correct type -# """ -# self.nexus_handler.processors = MagicMock() -# artifact_list = self.nexus_handler.build_artifact_list() -# self.assertEqual(artifact_list.path, Path(VNF_OUTPUT_FOLDER_FILENAME, ARTIFACT_LIST_FILENAME)) -# self.assertIsInstance(artifact_list, ArtifactDefinitionElementBuilder) - -# def test_build_resource_bicep_type(self): -# """Testing build resource bicep for Nexus VNFs - -# We only need to test the type of the bicep and the supporting files, -# and that they have the correct names. -# This is because the complicated logic is tested in the processors tests. - -# """ -# # we are testing the rest of the logic in the processors? (are we? we should) -# # TODO: fix this mocking, it works for deploymentParameters but not for actual processors (duh?) -# self.nexus_handler.processors = MagicMock() -# resource_bicep = self.nexus_handler.build_resource_bicep() -# print(resource_bicep.supporting_files[0].path) -# # TODO: check that the nexus one contains deploymentParameters, imageParameters and at least one templateParams? -# self.assertIsInstance(resource_bicep.supporting_files, List[LocalFileBuilder]) -# self.assertIsInstance(resource_bicep, BicepDefinitionElementBuilder) - -# # def test_build_all_parameters_json(): diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nsd_cli_generate_config.py b/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nsd_cli_generate_config.py deleted file mode 100644 index 87cc3f9c8e2..00000000000 --- a/src/aosm/azext_aosm/tests/latest/unit_test/broken_tests/test_nsd_cli_generate_config.py +++ /dev/null @@ -1,55 +0,0 @@ -# from __future__ import annotations -# from unittest import TestCase -# from unittest.mock import patch -# from azext_aosm.cli_handlers.onboarding_nsd_handler import OnboardingNSDCLIHandler -# from azure.cli.core.azclierror import ( -# UnclassifiedUserFault, -# ) -# # TODO: Fix tests with correct mocking for input() - -# @patch("pathlib.Path.exists") -# class TestNsdCliHandler(TestCase): - -# @patch("pathlib.Path.write_text") -# def test_generate_config(self, mock_exists, mock_write_text): -# mock_exists.return_value = False -# # sensible naming -# file_path = __file__.split('/')[:-1] -# file_path.append('input_files') -# file_path.append('nsd-input.jsonc') -# file_path = '/'.join(file_path) -# with open(file_path, "r") as f: -# expected_output = f.read() -# nsd_cli_handler = OnboardingNSDCLIHandler() -# nsd_cli_handler.generate_config() - -# mock_write_text.assert_called_with(expected_output) - -# @patch("pathlib.Path.write_text") -# @patch("builtins.input") -# def test_generate_config_with_file_to_overwrite(self, mock_input, mock_write_text, mock_exists): -# mock_exists.return_value = True -# mock_input.return_value = "y" - -# file_path = __file__.split('/')[:-1] -# file_path.append('input_files') -# file_path.append('nsd-input.jsonc') -# file_path = '/'.join(file_path) -# with open(file_path, "r") as f: -# expected_output = f.read() -# nsd_cli_handler = OnboardingNSDCLIHandler() -# nsd_cli_handler.generate_config() - -# mock_input.assert_called() -# mock_write_text.assert_called_with(expected_output) - -# # @patch("builtins.input") -# def test_generate_config_with_file_not_to_overwrite(self, mock_exists): - -# mock_exists.return_value = True -# assert input() == 'n' -# # mock_input.return_value = "n" -# nsd_cli_handler = OnboardingNSDCLIHandler() - -# with self.assertRaises(UnclassifiedUserFault): -# nsd_cli_handler.generate_config() diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/test_definiton_folder_builder/test_artifact_builder.py b/src/aosm/azext_aosm/tests/latest/unit_test/test_definiton_folder_builder/test_artifact_builder.py index e9c4003f0c8..0526f4eb548 100644 --- a/src/aosm/azext_aosm/tests/latest/unit_test/test_definiton_folder_builder/test_artifact_builder.py +++ b/src/aosm/azext_aosm/tests/latest/unit_test/test_definiton_folder_builder/test_artifact_builder.py @@ -7,7 +7,9 @@ from unittest import TestCase from unittest.mock import MagicMock, patch -from azext_aosm.definition_folder.builder.artifact_builder import ArtifactDefinitionElementBuilder +from azext_aosm.definition_folder.builder.artifact_builder import ( + ArtifactDefinitionElementBuilder, +) class TestArtifactDefinitionElementBuilder(TestCase): @@ -26,8 +28,7 @@ def test_write(self, mock_mkdir, mock_write_text): # Create a Artifact definition element builder. artifact_definition_element_builder = ArtifactDefinitionElementBuilder( - Path("/some/folder"), - [artifact_1, artifact_2] + Path("/some/folder"), [artifact_1, artifact_2] ) # Write the definition element to disk. @@ -37,6 +38,5 @@ def test_write(self, mock_mkdir, mock_write_text): mock_mkdir.assert_called_once() artifact_1.to_dict.assert_called_once() artifact_2.to_dict.assert_called_once() - expected_params = [{"abc":"def"}, - {"ghi":"jkl"}] + expected_params = [{"abc": "def"}, {"ghi": "jkl"}] mock_write_text.assert_called_once_with(json.dumps(expected_params, indent=4)) diff --git a/src/aosm/azext_aosm/tests/latest/unit_test/test_registry.py b/src/aosm/azext_aosm/tests/latest/unit_test/test_registry.py index 80970b82951..e017e66c998 100644 --- a/src/aosm/azext_aosm/tests/latest/unit_test/test_registry.py +++ b/src/aosm/azext_aosm/tests/latest/unit_test/test_registry.py @@ -110,53 +110,47 @@ def test_find_image_cli_error(self): with patch( "azext_aosm.common.registry.call_subprocess_raise_output", mocked_call_subprocess_raise_output, - ), self.assertRaises(ClientRequestError): - self.registry.find_image(image, version) + ): + result = self.registry.find_image(image, version) + self.assertEqual(result, (None, None)) class TestAzureContainerRegistry(TestCase): def setUp(self): logging.basicConfig(level=logging.INFO, stream=sys.stdout) self.registry = AzureContainerRegistry(registry_name="registry.azurecr.io") + self.registry.add_namespace("") + + def test_find_image_existing_image(self): + image = "myimage" + version = "1.0.0" - def test_get_images_in_registry(self): # Mock the call_subprocess_raise_output function - mocked_output_repositories = json.dumps( - ["repository1", "repository2/image", "repository3/sample/image2"] - ) - mocked_output_versions = json.dumps(["version1", "version2"]) - mocked_call_subprocess_raise_output = Mock( - side_effect=[ - mocked_output_repositories, - mocked_output_versions, - mocked_output_versions, - mocked_output_versions, - ] - ) + mocked_output = "some output" + mocked_call_subprocess_raise_output = Mock(return_value=mocked_output) with patch( "azext_aosm.common.registry.call_subprocess_raise_output", mocked_call_subprocess_raise_output, ): - images = self.registry.get_images_in_registry() - - self.assertEqual(len(images), 6) - self.assertIn(("repository1", "version1"), images) - self.assertIn(("repository1", "version2"), images) - self.assertIn(("image", "version1"), images) - self.assertIn(("image", "version2"), images) - self.assertIn(("image2", "version1"), images) - self.assertIn(("image2", "version2"), images) - self.assertEqual(images[("repository1", "version1")], (self.registry, "")) - self.assertEqual(images[("repository1", "version2")], (self.registry, "")) - self.assertEqual(images[("image", "version1")], (self.registry, "repository2/")) - self.assertEqual(images[("image", "version2")], (self.registry, "repository2/")) - self.assertEqual( - images[("image2", "version1")], (self.registry, "repository3/sample/") - ) - self.assertEqual( - images[("image2", "version2")], (self.registry, "repository3/sample/") - ) + result = self.registry.find_image(image, version) + + self.assertEqual(result, (self.registry, "")) + + def test_find_image_cli_error(self): + image = "myimage" + version = "1.0.0" + + # Mock the call_subprocess_raise_output function to raise a CLIError + mocked_error = CLIError() + mocked_call_subprocess_raise_output = Mock(side_effect=mocked_error) + + with patch( + "azext_aosm.common.registry.call_subprocess_raise_output", + mocked_call_subprocess_raise_output, + ): + result = self.registry.find_image(image, version) + self.assertEqual(result, (None, None)) class TestRegistryHandler(TestCase): @@ -167,20 +161,13 @@ def setUp(self): self.registry_name_2 = "registry.example.com/sample" self.registry_name_3 = "registry.example.com" - with patch.object( - ContainerRegistryHandler, - "_get_registries_for_images", - return_value={ - ("image1", "1.0.0"): (AzureContainerRegistry(self.registry_name_1), "") - }, - ): - self.registry_handler = ContainerRegistryHandler( - image_sources=[ - self.registry_name_1, - self.registry_name_2, - self.registry_name_3, - ] - ) + self.registry_handler = ContainerRegistryHandler( + image_sources=[ + self.registry_name_1, + self.registry_name_2, + self.registry_name_3, + ] + ) def test_create_registry_list(self): registry_list = self.registry_handler.registry_list @@ -205,21 +192,31 @@ def test_create_registry_list(self): self.assertEqual(acr_registry_count, 1) def test_find_registry_for_image(self): - - registry_1, namespace = self.registry_handler.find_registry_for_image( - "image1", "1.0.0" - ) - - self.assertEqual(registry_1.registry_name, self.registry_name_1) - # Create a mock object to replace the find_image method - mock_find_image = Mock() - mock_find_image.return_value = ( + mock_find_image_ACR = Mock() + mock_find_image_ACR.return_value = ( + AzureContainerRegistry(self.registry_name_1), + "", + ) + mock_find_image_universal_registry = Mock() + mock_find_image_universal_registry.return_value = ( UniversalRegistry(self.registry_name_2), "sample", ) with patch( - "azext_aosm.common.registry.UniversalRegistry.find_image", mock_find_image + "azext_aosm.common.registry.AzureContainerRegistry.find_image", + mock_find_image_ACR, + ): + registry_1, namespace = self.registry_handler.find_registry_for_image( + "image1", "1.0.0" + ) + + self.assertEqual(registry_1.registry_name, self.registry_name_1) + self.assertEqual(namespace, "") + + with patch( + "azext_aosm.common.registry.UniversalRegistry.find_image", + mock_find_image_universal_registry, ): registry_2, namespace = self.registry_handler.find_registry_for_image(