Skip to content

Commit

Permalink
Adding usecases to exclusion list; Don't remove linux image from PIR …
Browse files Browse the repository at this point in the history
…if Canary didn't upload it
  • Loading branch information
knithinc committed Sep 8, 2017
1 parent b04eaf5 commit 667a016
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CanaryValidator/Canary.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ param (
[parameter(HelpMessage="List of usecases to be excluded from execution")]
[Parameter(ParameterSetName="default", Mandatory=$false)]
[Parameter(ParameterSetName="tenant", Mandatory=$false)]
[string[]]$ExclusionList = ("GetAzureStackInfraRoleInstance", "DeleteSubscriptionResourceGroup"),
[string[]]$ExclusionList = ("GetAzureStackInfraRoleInstance", "DeleteSubscriptionResourceGroup", "QueryImagesFromPIR", "DeployARMTemplate", "RetrieveResourceDeploymentTimes", "QueryTheVMsDeployed", "CheckVMCommunicationPreVMReboot", "TransmitMTUSizedPacketsBetweenTenantVMs", "AddDatadiskToVMWithPrivateIP", "ApplyDataDiskCheckCustomScriptExtensionToVMWithPrivateIP", "RestartVMWithPublicIP", "StopDeallocateVMWithPrivateIP", "StartVMWithPrivateIP", "CheckVMCommunicationPostVMReboot", "CheckExistenceOfScreenShotForVMWithPrivateIP", "DeleteVMWithPrivateIP"),
[parameter(HelpMessage="Lists the available usecases in Canary")]
[Parameter(ParameterSetName="listavl", Mandatory=$true)]
[ValidateNotNullOrEmpty()]
Expand Down Expand Up @@ -319,7 +319,7 @@ while ($runCount -le $NumberOfIterations)
$CustomVHDPath = CopyImage -ImagePath $LinuxImagePath -OutputFolder $CanaryCustomImageFolder
Add-AzsVMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -Location $ResourceLocation -CreateGalleryItem $false
Remove-Item $CanaryCustomImageFolder -Force -Recurse
$linuxUpload = $true
Set-Variable -Name linuxUpload -Value $true -Scope 1
}
}
catch
Expand Down Expand Up @@ -761,8 +761,8 @@ while ($runCount -le $NumberOfIterations)
}
$osVersion, $linuxImgExists
}
[string]$osVersion = $pirQueryRes[2]
[boolean]$linuxImgExists = $pirQueryRes[3]
#[string]$osVersion = $pirQueryRes[2]
#[boolean]$linuxImgExists = $pirQueryRes[3]

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

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

0 comments on commit 667a016

Please sign in to comment.