From 700bee5d75ab4dc18f4e4f9f361ccb465aa9066a Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Fri, 30 Sep 2022 14:00:03 -0700 Subject: [PATCH 1/3] adding tests for all 4 extension types calls --- .../public/ExtensionTypes.Tests.ps1 | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 testing/test/extensions/public/ExtensionTypes.Tests.ps1 diff --git a/testing/test/extensions/public/ExtensionTypes.Tests.ps1 b/testing/test/extensions/public/ExtensionTypes.Tests.ps1 new file mode 100644 index 00000000000..d9634024432 --- /dev/null +++ b/testing/test/extensions/public/ExtensionTypes.Tests.ps1 @@ -0,0 +1,33 @@ +Describe 'Extension Types Testing' { + BeforeAll { + $extensionType = "cassandradatacentersoperator" + $location = "eastus2euap" + + . $PSScriptRoot/../../helper/Constants.ps1 + . $PSScriptRoot/../../helper/Helper.ps1 + } + + It 'Performs a show extension types call' { + $output = az $Env:K8sExtensionName extension-types show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters --extension-type $extensionType + $? | Should -BeTrue + $output | Should -Not -BeNullOrEmpty + } + + It "Performs a cluster-scoped list extension types call" { + $output = az $Env:K8sExtensionName extension-types list -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters + $? | Should -BeTrue + $output | Should -Not -BeNullOrEmpty + } + + It "Performs a location-scoped list extension types call" { + $output = az $Env:K8sExtensionName extension-types list-by-location --location $location + $? | Should -BeTrue + $output | Should -Not -BeNullOrEmpty + } + + It "Performs a location-scoped list extension type versions call" { + $output = az $Env:K8sExtensionName extension-types list-versions --location $location --extension-type $extensionType + $? | Should -BeTrue + $output | Should -Not -BeNullOrEmpty + } +} From efd86d4e1497b9edf125f469760e143d21243db8 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Fri, 30 Sep 2022 14:05:31 -0700 Subject: [PATCH 2/3] adding to test config file --- testing/pipeline/k8s-custom-pipelines.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/pipeline/k8s-custom-pipelines.yml b/testing/pipeline/k8s-custom-pipelines.yml index 0592b58ec53..ef1f5aa8577 100644 --- a/testing/pipeline/k8s-custom-pipelines.yml +++ b/testing/pipeline/k8s-custom-pipelines.yml @@ -41,6 +41,10 @@ stages: parameters: jobName: Cassandra path: ./test/extensions/public/Cassandra.Tests.ps1 + - template: ./templates/run-test.yml + parameters: + jobName: ExtensionTypes + path: ./test/extensions/public/ExtensionTypes.Tests.ps1 - template: ./templates/run-test.yml parameters: jobName: OpenServiceMesh From 8dcef494a72158ddb4ab79a60fa60bb18ed412f7 Mon Sep 17 00:00:00 2001 From: Deeksha Sharma Date: Fri, 30 Sep 2022 16:32:37 -0700 Subject: [PATCH 3/3] updating the api version for extension types to be the correct version expected by the service --- src/k8s-extension/azext_k8s_extension/consts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k8s-extension/azext_k8s_extension/consts.py b/src/k8s-extension/azext_k8s_extension/consts.py index 2044f06bf4d..c69df7a73f0 100644 --- a/src/k8s-extension/azext_k8s_extension/consts.py +++ b/src/k8s-extension/azext_k8s_extension/consts.py @@ -25,4 +25,4 @@ APPLIANCE_API_VERSION = "2021-10-31-preview" HYBRIDCONTAINERSERVICE_API_VERSION = "2022-05-01-preview" -EXTENSION_TYPE_API_VERSION = "2022-04-02-preview" +EXTENSION_TYPE_API_VERSION = "2022-01-15-preview"