Skip to content

Commit 667a016

Browse files
committed
Adding usecases to exclusion list; Don't remove linux image from PIR if Canary didn't upload it
1 parent b04eaf5 commit 667a016

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CanaryValidator/Canary.Tests.ps1

+6-6
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ param (
104104
[parameter(HelpMessage="List of usecases to be excluded from execution")]
105105
[Parameter(ParameterSetName="default", Mandatory=$false)]
106106
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
107-
[string[]]$ExclusionList = ("GetAzureStackInfraRoleInstance", "DeleteSubscriptionResourceGroup"),
107+
[string[]]$ExclusionList = ("GetAzureStackInfraRoleInstance", "DeleteSubscriptionResourceGroup", "QueryImagesFromPIR", "DeployARMTemplate", "RetrieveResourceDeploymentTimes", "QueryTheVMsDeployed", "CheckVMCommunicationPreVMReboot", "TransmitMTUSizedPacketsBetweenTenantVMs", "AddDatadiskToVMWithPrivateIP", "ApplyDataDiskCheckCustomScriptExtensionToVMWithPrivateIP", "RestartVMWithPublicIP", "StopDeallocateVMWithPrivateIP", "StartVMWithPrivateIP", "CheckVMCommunicationPostVMReboot", "CheckExistenceOfScreenShotForVMWithPrivateIP", "DeleteVMWithPrivateIP"),
108108
[parameter(HelpMessage="Lists the available usecases in Canary")]
109109
[Parameter(ParameterSetName="listavl", Mandatory=$true)]
110110
[ValidateNotNullOrEmpty()]
@@ -319,7 +319,7 @@ while ($runCount -le $NumberOfIterations)
319319
$CustomVHDPath = CopyImage -ImagePath $LinuxImagePath -OutputFolder $CanaryCustomImageFolder
320320
Add-AzsVMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -Location $ResourceLocation -CreateGalleryItem $false
321321
Remove-Item $CanaryCustomImageFolder -Force -Recurse
322-
$linuxUpload = $true
322+
Set-Variable -Name linuxUpload -Value $true -Scope 1
323323
}
324324
}
325325
catch
@@ -761,8 +761,8 @@ while ($runCount -le $NumberOfIterations)
761761
}
762762
$osVersion, $linuxImgExists
763763
}
764-
[string]$osVersion = $pirQueryRes[2]
765-
[boolean]$linuxImgExists = $pirQueryRes[3]
764+
#[string]$osVersion = $pirQueryRes[2]
765+
#[boolean]$linuxImgExists = $pirQueryRes[3]
766766

767767
Invoke-Usecase -Name 'DeployARMTemplate' -Description "Deploy ARM template to setup the virtual machines" -UsecaseBlock `
768768
{
@@ -1162,13 +1162,13 @@ while ($runCount -le $NumberOfIterations)
11621162

11631163
Invoke-Usecase -Name 'RemoveLinuxImageFromPIR' -Description "Remove the Linux image uploaded during setup from the Platform Image Respository" -UsecaseBlock `
11641164
{
1165-
if (Get-AzureRmVMImage -Location $ResourceLocation -PublisherName $linuxImagePublisher -Offer $linuxImageOffer -Sku $LinuxOSSku -ErrorAction SilentlyContinue)
1165+
if ((Get-AzureRmVMImage -Location $ResourceLocation -PublisherName $linuxImagePublisher -Offer $linuxImageOffer -Sku $LinuxOSSku -ErrorAction SilentlyContinue) -and ($linuxUpload))
11661166
{
11671167
Remove-AzsVMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -Location $ResourceLocation -Force
11681168
}
11691169
}
11701170
Invoke-Usecase -Name 'DeleteSubscriptionResourceGroup' -Description "Delete the resource group that contains subscription resources" -UsecaseBlock `
1171-
{
1171+
{
11721172
if ($removeRG = Get-AzureRmResourceGroup -Name $subscriptionRGName -ErrorAction Stop)
11731173
{
11741174
$removeRG | Remove-AzureRmResourceGroup -Force -ErrorAction Stop

0 commit comments

Comments
 (0)