@@ -39,11 +39,11 @@ param (
3939 [parameter (HelpMessage = " Path for Linux VHD" )]
4040 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
4141 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
42- [string ] $LinuxImagePath = " https ://partner -images.canonical .com/azure/azure_stack/ ubuntu-14 .04-LTS-microsoft_azure_stack-20161208-9 .vhd.zip" ,
42+ [string ] $LinuxImagePath = " http ://cloud -images.ubuntu .com/releases/xenial/release/ ubuntu-16 .04-server-cloudimg-amd64-disk1 .vhd.zip" ,
4343 [parameter (HelpMessage = " Linux OS sku" )]
4444 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
4545 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
46- [string ] $LinuxOSSku = " 14 .04.3 -LTS" ,
46+ [string ] $LinuxOSSku = " 16 .04-LTS" ,
4747 [parameter (HelpMessage = " Fully qualified domain name of the azure stack environment. Ex: contoso.com" )]
4848 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
4949 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
@@ -96,28 +96,35 @@ param (
9696 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
9797 [ValidateNotNullOrEmpty ()]
9898 [string ]$CanaryLogPath = $env: TMP + " \CanaryLogs$ ( (Get-Date ).Ticks) " ,
99- [parameter (HelpMessage = " Specifies the file name for canary log file" )]
99+ [parameter (HelpMessage = " Specifies the file name for canary log file" )]
100100 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
101101 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
102102 [ValidateNotNullOrEmpty ()]
103103 [string ]$CanaryLogFileName = " Canary-Basic-$ ( (Get-Date ).Ticks) .log" ,
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" , " GetAzureStackScaleUnitNode " ),
107+ [string []]$ExclusionList = (" GetAzureStackInfraRoleInstance" ),
108108 [parameter (HelpMessage = " Lists the available usecases in Canary" )]
109109 [Parameter (ParameterSetName = " listavl" , Mandatory = $true )]
110110 [ValidateNotNullOrEmpty ()]
111111 [switch ]$ListAvailable
112112)
113113
114- # requires -Modules AzureRM .Profile , AzureRM .AzureStackAdmin
115- # Requires -RunAsAdministrator
116114Import-Module - Name $PSScriptRoot \Canary.Utilities.psm1 - Force - DisableNameChecking
117- Import-Module - Name $PSScriptRoot \..\Connect\AzureStack.Connect.psm1 - Force
118- Import-Module - Name $PSScriptRoot \..\Infrastructure\AzureStack.Infra.psm1 - Force
119- Import-Module - Name $PSScriptRoot \..\ComputeAdmin\AzureStack.ComputeAdmin.psm1 - Force
115+ if (-not $ListAvailable.IsPresent )
116+ {
117+ # requires -Modules AzureRM .Profile , AzureRM .AzureStackAdmin
118+ # Requires -RunAsAdministrator
120119
120+ Import-Module - Name $PSScriptRoot \..\Connect\AzureStack.Connect.psm1 - Force
121+ Import-Module - Name $PSScriptRoot \..\Infrastructure\AzureStack.Infra.psm1 - Force
122+ Import-Module - Name $PSScriptRoot \..\ComputeAdmin\AzureStack.ComputeAdmin.psm1 - Force
123+ }
124+ else
125+ {
126+ $ErrorActionPreference = " SilentlyContinue"
127+ }
121128$runCount = 1
122129$tmpLogname = $CanaryLogFileName
123130while ($runCount -le $NumberOfIterations )
@@ -148,7 +155,7 @@ while ($runCount -le $NumberOfIterations)
148155 #
149156 # Start Canary
150157 #
151- if ($ListAvailable ){$listAvl = $true } else {$listAvl = $false }
158+ if ($ListAvailable ){Write-Host " List of scenarios in Canary: " - ForegroundColor Green; $listAvl = $true } else {$listAvl = $false }
152159 $CanaryLogFileName = [IO.Path ]::GetFileNameWithoutExtension($tmpLogname ) + " -$runCount " + [IO.Path ]::GetExtension($tmpLogname )
153160 $CanaryLogFile = Join-Path - Path $CanaryLogPath - ChildPath $CanaryLogFileName
154161 Start-Scenario - Name ' Canary' - Type ' Basic' - LogFilename $CanaryLogFile - ContinueOnFailure $ContinueOnFailure - ListAvailable $listAvl - ExclusionList $ExclusionList
@@ -276,7 +283,7 @@ while ($runCount -le $NumberOfIterations)
276283 Get-AzsUpdate - Location $ResourceLocation
277284 }
278285 }
279-
286+
280287 if ($WindowsISOPath )
281288 {
282289 Invoke-Usecase - Name ' UploadWindows2016ImageToPIR' - Description " Uploads a windows server 2016 image to the PIR" - UsecaseBlock `
@@ -322,15 +329,15 @@ while ($runCount -le $NumberOfIterations)
322329 }
323330 }
324331
325- if ($TenantAdminCredentials )
332+ if (( $TenantAdminCredentials ) -or ( $ListAvailable ) )
326333 {
327334 $subscriptionRGName = $CanaryUtilitiesRG + " subscrrg" + [Random ]::new().Next(1 , 999 )
328335 $tenantPlanName = $CanaryUtilitiesRG + " tenantplan" + [Random ]::new().Next(1 , 999 )
329336 $tenantOfferName = $CanaryUtilitiesRG + " tenantoffer" + [Random ]::new().Next(1 , 999 )
330337 $tenantSubscriptionName = $CanaryUtilitiesRG + " tenantsubscription" + [Random ]::new().Next(1 , 999 )
331338 $canaryDefaultTenantSubscription = $CanaryUtilitiesRG + " tenantdefaultsubscription" + [Random ]::new().Next(1 , 999 )
332339
333- if ((-not $TenantArmEndpoint ) -and (-not $listAvl ))
340+ if ((-not $TenantArmEndpoint ) -and (-not $ListAvailable .IsPresent ))
334341 {
335342 throw [System.Exception ] " Tenant ARM endpoint is required."
336343 }
@@ -350,6 +357,7 @@ while ($runCount -le $NumberOfIterations)
350357 - EnableAdfsAuthentication:$asEndpoints.ActiveDirectoryEndpoint.TrimEnd (" /" ).EndsWith(" /adfs" , [System.StringComparison ]::OrdinalIgnoreCase) `
351358 - ErrorAction Stop
352359 }
360+
353361 Invoke-Usecase - Name ' CreateResourceGroupForTenantSubscription' - Description " Create a resource group $subscriptionRGName for the tenant subscription" - UsecaseBlock `
354362 {
355363 if (Get-AzureRmResourceGroup - Name $subscriptionRGName - ErrorAction SilentlyContinue)
@@ -555,7 +563,7 @@ while ($runCount -le $NumberOfIterations)
555563 throw [System.Exception ] " Custom role definition ($customRoleName ) for subscription $tenantSubscriptionName is not available"
556564 }
557565 }
558- }
566+ }
559567
560568 Invoke-Usecase - Name ' RegisterResourceProviders' - Description " Register resource providers" - UsecaseBlock `
561569 {
@@ -1089,7 +1097,7 @@ while ($runCount -le $NumberOfIterations)
10891097
10901098 if (($TenantAdminCredentials ) -or ($listAvl ))
10911099 {
1092- Invoke-Usecase - Name ' TenantRelatedcleanup' - Description " Remove all the tenant related stuff " - UsecaseBlock `
1100+ Invoke-Usecase - Name ' TenantRelatedcleanup' - Description " Remove all the tenant related resources " - UsecaseBlock `
10931101 {
10941102 Invoke-Usecase - Name ' DeleteTenantSubscriptions' - Description " Remove all the tenant related subscriptions" - UsecaseBlock `
10951103 {
@@ -1115,7 +1123,6 @@ while ($runCount -le $NumberOfIterations)
11151123 Remove-AzsVMImage - publisher $linuxImagePublisher - offer $linuxImageOffer - sku $LinuxOSSku - version $linuxImageVersion - Location $ResourceLocation
11161124 }
11171125 }
1118-
11191126 Invoke-Usecase - Name ' DeleteSubscriptionResourceGroup' - Description " Delete the resource group that contains subscription resources" - UsecaseBlock `
11201127 {
11211128 if ($removeRG = Get-AzureRmResourceGroup - Name $subscriptionRGName - ErrorAction Stop)
0 commit comments