Skip to content

Commit

Permalink
Remove policy update test from extension E2E (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Nov 9, 2021
1 parent b2eaf5e commit 5f6aea5
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions testing/test/extensions/public/AzurePolicy.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Describe 'Azure Policy Testing' {
{
# Only check the extension config, not the pod since this doesn't bring up pods
$output = Invoke-Expression "az $Env:K8sExtensionName show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName" -ErrorVariable badOut
$provisioningState = ($output | ConvertFrom-Json).provisioningState
Write-Host "Got ProvisioningState: $provisioningState for the extension"
if ((Has-ExtensionData $extensionName) -And ($provisioningState -eq "Succeeded")) {
if (Has-ExtensionData $extensionName){
break
}
Start-Sleep -Seconds 10
Expand All @@ -46,30 +44,6 @@ Describe 'Azure Policy Testing' {
$output | Should -Not -BeNullOrEmpty
}

It "Runs an update on the extension on the cluster" {
$output = az $Env:K8sExtensionName update -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName --auto-upgrade false --no-wait
$? | Should -BeTrue

$output = az $Env:K8sExtensionName show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters -n $extensionName
$? | Should -BeTrue

$isAutoUpgradeMinorVersion = ($output | ConvertFrom-Json).autoUpgradeMinorVersion
$isAutoUpgradeMinorVersion.ToString() -eq "False" | Should -BeTrue

# Loop and retry until the extension config updates
$n = 0
do
{
$isAutoUpgradeMinorVersion = (Get-ExtensionData $extensionName).spec.autoUpgradeMinorVersion
if (!$isAutoUpgradeMinorVersion) { #autoUpgradeMinorVersion doesn't exist in ExtensionConfig CRD if false
break
}
Start-Sleep -Seconds 10
$n += 1
} while ($n -le $MAX_RETRY_ATTEMPTS)
$n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS
}

It "Lists the extensions on the cluster" {
$output = az $Env:K8sExtensionName list -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters
$? | Should -BeTrue
Expand Down

0 comments on commit 5f6aea5

Please sign in to comment.