Skip to content

Commit

Permalink
Merge pull request #183 from AzureArcForKubernetes/deesharma/exttypes…
Browse files Browse the repository at this point in the history
…tests

adding tests for all 4 extension types calls
  • Loading branch information
deeksha345 authored Oct 5, 2022
2 parents 2ecb63a + f1c9348 commit 5c57791
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/k8s-extension/azext_k8s_extension/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 4 additions & 0 deletions testing/pipeline/k8s-custom-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions testing/test/extensions/public/ExtensionTypes.Tests.ps1
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 5c57791

Please sign in to comment.