@@ -61,12 +61,12 @@ param (
6161 [parameter (HelpMessage = " Resource group under which all the utilities need to be placed" )]
6262 [Parameter (ParameterSetName = " default" , Mandatory = $false )] [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
6363 [ValidateNotNullOrEmpty ()]
64- [string ]$CanaryUtilitiesRG = " canur " + [Random ]::new().Next(1 , 999 ),
64+ [string ]$CanaryUtilitiesRG = " cnur " + [Random ]::new().Next(1 , 99 ),
6565 [parameter (HelpMessage = " Resource group under which the virtual machines need to be placed" )]
6666 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
6767 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
6868 [ValidateNotNullOrEmpty ()]
69- [string ]$CanaryVMRG = " canvr " + [Random ]::new().Next(1 , 999 ),
69+ [string ]$CanaryVMRG = " cnvr " + [Random ]::new().Next(1 , 99 ),
7070 [parameter (HelpMessage = " Location where all the resource need to deployed and placed" )]
7171 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
7272 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
@@ -95,32 +95,44 @@ param (
9595 [Parameter (ParameterSetName = " default" , Mandatory = $false )]
9696 [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
9797 [ValidateNotNullOrEmpty ()]
98- [string ]$CanaryLogFileName = " Canary-Basic-$ ( (Get-Date ).Ticks) .log"
98+ [string ]$CanaryLogFileName = " Canary-Basic-$ ( (Get-Date ).Ticks) .log" ,
99+ [parameter (HelpMessage = " List of usecases to be excluded from execution" )]
100+ [Parameter (ParameterSetName = " default" , Mandatory = $false )]
101+ [Parameter (ParameterSetName = " tenant" , Mandatory = $false )]
102+ [string []]$ExclusionList = (" GetAzureStackInfraRoleInstance" , " GetAzureStackScaleUnitNode" ),
103+ [parameter (HelpMessage = " Lists the available usecases in Canary" )]
104+ [Parameter (ParameterSetName = " listavl" , Mandatory = $true )]
105+ [ValidateNotNullOrEmpty ()]
106+ [switch ]$ListAvailable
99107)
100108
101109# requires -Modules AzureRM .Profile , AzureRM .AzureStackAdmin
102110# Requires -RunAsAdministrator
103- Import-Module - Name $PSScriptRoot \Canary.Utilities.psm1 - Force
111+ Import-Module - Name $PSScriptRoot \Canary.Utilities.psm1 - Force - DisableNameChecking
104112Import-Module - Name $PSScriptRoot \..\Connect\AzureStack.Connect.psm1 - Force
105113Import-Module - Name $PSScriptRoot \..\Infrastructure\AzureStack.Infra.psm1 - Force
106114Import-Module - Name $PSScriptRoot \..\ComputeAdmin\AzureStack.ComputeAdmin.psm1 - Force
107115
108- $storageAccName = $CanaryUtilitiesRG + " sa"
109- $storageCtrName = $CanaryUtilitiesRG + " sc"
110- $keyvaultName = $CanaryUtilitiesRG + " kv"
111- $keyvaultCertName = " ASCanaryVMCertificate"
112- $kvSecretName = $keyvaultName.ToLowerInvariant () + " secret"
113- $VMAdminUserName = " CanaryAdmin"
114- $VMAdminUserPass = " CanaryAdmin@123"
115- $canaryUtilPath = Join-Path - Path $env: TEMP - ChildPath " CanaryUtilities$ ( (Get-Date ).Ticks) "
116- $linuxImagePublisher = " Canonical"
117- $linuxImageOffer = " UbuntuServer"
118- $linuxImageVersion = " 1.0.0"
119-
120116$runCount = 1
121117$tmpLogname = $CanaryLogFileName
122118while ($runCount -le $NumberOfIterations )
123119{
120+ if ($NumberOfIterations -gt 1 )
121+ {
122+ $CanaryUtilitiesRG = $CanaryUtilitiesRG + $runCount
123+ $CanaryVMRG = $CanaryVMRG + $runCount
124+ }
125+ $storageAccName = $CanaryUtilitiesRG + " sa"
126+ $storageCtrName = $CanaryUtilitiesRG + " sc"
127+ $keyvaultName = $CanaryUtilitiesRG + " kv"
128+ $keyvaultCertName = " ASCanaryVMCertificate"
129+ $kvSecretName = $keyvaultName.ToLowerInvariant () + " secret"
130+ $VMAdminUserName = " CanaryAdmin"
131+ $VMAdminUserPass = " CanaryAdmin@123"
132+ $canaryUtilPath = Join-Path - Path $env: TEMP - ChildPath " CanaryUtilities$ ( (Get-Date ).Ticks) "
133+ $linuxImagePublisher = " Canonical"
134+ $linuxImageOffer = " UbuntuServer"
135+ $linuxImageVersion = " 1.0.0"
124136 if (Test-Path - Path $canaryUtilPath )
125137 {
126138 Remove-Item - Path $canaryUtilPath - Force - Recurse
@@ -130,15 +142,15 @@ while ($runCount -le $NumberOfIterations)
130142 #
131143 # Start Canary
132144 #
145+ if ($ListAvailable ){$listAvl = $true } else {$listAvl = $false }
133146 $CanaryLogFileName = [IO.Path ]::GetFileNameWithoutExtension($tmpLogname ) + " -$runCount " + [IO.Path ]::GetExtension($tmpLogname )
134147 $CanaryLogFile = Join-Path - Path $CanaryLogPath - ChildPath $CanaryLogFileName
135-
136- Start-Scenario - Name ' Canary' - Type ' Basic' - LogFilename $CanaryLogFile - ContinueOnFailure $ContinueOnFailure
148+ Start-Scenario - Name ' Canary' - Type ' Basic' - LogFilename $CanaryLogFile - ContinueOnFailure $ContinueOnFailure - ListAvailable $listAvl - ExclusionList $ExclusionList
137149
138150 $SvcAdminEnvironmentName = $EnvironmentName + " -SVCAdmin"
139151 $TntAdminEnvironmentName = $EnvironmentName + " -Tenant"
140152
141- if (-not $EnvironmentDomainFQDN )
153+ if (( -not $EnvironmentDomainFQDN ) -and ( -not $listAvl ) )
142154 {
143155 $endptres = Invoke-RestMethod " ${AdminArmEndpoint} /metadata/endpoints?api-version=1.0" - ErrorAction Stop
144156 $EnvironmentDomainFQDN = $endptres.portalEndpoint
@@ -173,14 +185,98 @@ while ($runCount -le $NumberOfIterations)
173185 $defaultSubscription | Select-AzureRmSubscription
174186 }
175187 }
188+
189+ Invoke-Usecase - Name ' ListFabricResourceProviderInfo' - Description " List FabricResourceProvider(FRP) information like storage shares, capacity, logical networks etc." - UsecaseBlock `
190+ {
191+ Invoke-Usecase - Name ' GetAzureStackInfraRole' - Description " List all infrastructure roles" - UsecaseBlock `
192+ {
193+ Get-AzSInfraRole - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
194+ }
195+
196+ Invoke-Usecase - Name ' GetAzureStackInfraRoleInstance' - Description " List all infrastructure role instances" - UsecaseBlock `
197+ {
198+ Get-AzSInfraRoleInstance - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
199+ }
200+
201+ Invoke-Usecase - Name ' GetAzureStackLogicalNetwork' - Description " List all logical networks" - UsecaseBlock `
202+ {
203+ Get-AzSLogicalNetwork - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
204+ }
205+
206+ Invoke-Usecase - Name ' GetAzureStackStorageCapacity' - Description " List storage capacity" - UsecaseBlock `
207+ {
208+ Get-AzSStorageCapacity - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
209+ }
210+
211+ Invoke-Usecase - Name ' GetAzureStackStorageShare' - Description " List all storage file shares" - UsecaseBlock `
212+ {
213+ Get-AzSStorageShare - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
214+ }
215+
216+ Invoke-Usecase - Name ' GetAzureStackScaleUnit' - Description " List Azure Stack scale units in specified Region" - UsecaseBlock `
217+ {
218+ Get-AzSScaleUnit - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
219+ }
220+
221+ Invoke-Usecase - Name ' GetAzureStackScaleUnitNode' - Description " List nodes in scale unit" - UsecaseBlock `
222+ {
223+ Get-AzSScaleUnitNode - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
224+ }
225+
226+ Invoke-Usecase - Name ' GetAzureStackIPPool' - Description " List all IP pools" - UsecaseBlock `
227+ {
228+ Get-AzSIPPool - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
229+ }
230+
231+ Invoke-Usecase - Name ' GetAzureStackMacPool' - Description " List all MAC address pools " - UsecaseBlock `
232+ {
233+ Get-AzSMacPool - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
234+ }
235+
236+ Invoke-Usecase - Name ' GetAzureStackGatewayPool' - Description " List all gateway pools" - UsecaseBlock `
237+ {
238+ Get-AzSGatewayPool - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
239+ }
240+
241+ Invoke-Usecase - Name ' GetAzureStackSLBMux' - Description " List all SLB MUX instances" - UsecaseBlock `
242+ {
243+ Get-AzSSLBMUX - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
244+ }
245+
246+ Invoke-Usecase - Name ' GetAzureStackGateway' - Description " List all gateway" - UsecaseBlock `
247+ {
248+ Get-AzSGateway - AzureStackCredentials $ServiceAdminCredentials - TenantID $TenantID - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
249+ }
250+ }
251+
252+ Invoke-Usecase - Name ' ListHealthResourceProviderAlerts' - Description " List all HealthResourceProvider(HRP) alerts " - UsecaseBlock `
253+ {
254+ Invoke-Usecase - Name ' GetAzureStackAlert' - Description " List all alerts" - UsecaseBlock `
255+ {
256+ Get-AzSAlert - TenantID $TenantID - AzureStackCredentials $ServiceAdminCredentials - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
257+ }
258+ }
259+
260+ Invoke-Usecase - Name ' ListUpdatesResourceProviderInfo' - Description " List URP information like summary of updates available, update to be applied, last update applied etc." - UsecaseBlock `
261+ {
262+ Invoke-Usecase - Name ' GetAzureStackUpdateSummary' - Description " List summary of updates status" - UsecaseBlock `
263+ {
264+ Get-AzSUpdateSummary - TenantID $TenantID - AzureStackCredentials $ServiceAdminCredentials - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
265+ }
266+
267+ Invoke-Usecase - Name ' GetAzureStackUpdateToApply' - Description " List all updates that can be applied" - UsecaseBlock `
268+ {
269+ Get-AzSUpdate - TenantID $TenantID - AzureStackCredentials $ServiceAdminCredentials - EnvironmentName $SvcAdminEnvironmentName - region $ResourceLocation
270+ }
271+ }
176272
177273 if ($WindowsISOPath )
178274 {
179275 Invoke-Usecase - Name ' UploadWindows2016ImageToPIR' - Description " Uploads a windows server 2016 image to the PIR" - UsecaseBlock `
180276 {
181277 if (-not (Get-AzureRmVMImage - Location $ResourceLocation - PublisherName " MicrosoftWindowsServer" - Offer " WindowsServer" - Sku " 2016-Datacenter-Core" - ErrorAction SilentlyContinue))
182278 {
183- New-Server2016VMImage - ISOPath $WindowsISOPath - TenantId $TenantID - EnvironmentName $SvcAdminEnvironmentName - Version Core - AzureStackCredentials $ServiceAdminCredentials - CreateGalleryItem $false
279+ New-Server2016VMImage - ISOPath $WindowsISOPath - TenantId $TenantID - EnvironmentName $SvcAdminEnvironmentName - Location $ResourceLocation - Version Core - AzureStackCredentials $ServiceAdminCredentials - CreateGalleryItem $false
184280 }
185281 }
186282 }
@@ -200,7 +296,7 @@ while ($runCount -le $NumberOfIterations)
200296 }
201297 New-Item - Path $CanaryCustomImageFolder - ItemType Directory
202298 $CustomVHDPath = CopyImage - ImagePath $LinuxImagePath - OutputFolder $CanaryCustomImageFolder
203- Add-VMImage - publisher $linuxImagePublisher - offer $linuxImageOffer - sku $LinuxOSSku - version $linuxImageVersion - osDiskLocalPath $CustomVHDPath - osType Linux - tenantID $TenantID - azureStackCredentials $ServiceAdminCredentials - CreateGalleryItem $false - EnvironmentName $SvcAdminEnvironmentName
299+ Add-VMImage - publisher $linuxImagePublisher - offer $linuxImageOffer - sku $LinuxOSSku - version $linuxImageVersion - osDiskLocalPath $CustomVHDPath - osType Linux - tenantID $TenantID - azureStackCredentials $ServiceAdminCredentials - Location $ResourceLocation - CreateGalleryItem $false - EnvironmentName $SvcAdminEnvironmentName
204300 Remove-Item $CanaryCustomImageFolder - Force - Recurse
205301 }
206302 }
@@ -214,11 +310,11 @@ while ($runCount -le $NumberOfIterations)
214310
215311 if ($TenantAdminCredentials )
216312 {
217- $subscriptionRGName = " ascansubscrrg " + [Random ]::new().Next(1 , 999 )
218- $tenantPlanName = " ascantenantplan " + [Random ]::new().Next(1 , 999 )
219- $tenantOfferName = " ascantenantoffer " + [Random ]::new().Next(1 , 999 )
220- $tenantSubscriptionName = " ascanarytenantsubscription " + [Random ]::new().Next(1 , 999 )
221- $canaryDefaultTenantSubscription = " canarytenantdefaultsubscription " + [Random ]::new().Next(1 , 999 )
313+ $subscriptionRGName = $CanaryUtilitiesRG + " subscrrg " + [Random ]::new().Next(1 , 999 )
314+ $tenantPlanName = $CanaryUtilitiesRG + " tenantplan " + [Random ]::new().Next(1 , 999 )
315+ $tenantOfferName = $CanaryUtilitiesRG + " tenantoffer " + [Random ]::new().Next(1 , 999 )
316+ $tenantSubscriptionName = $CanaryUtilitiesRG + " tenantsubscription " + [Random ]::new().Next(1 , 999 )
317+ $canaryDefaultTenantSubscription = $CanaryUtilitiesRG + " tenantdefaultsubscription " + [Random ]::new().Next(1 , 999 )
222318
223319 if (-not $TenantArmEndpoint )
224320 {
@@ -771,7 +867,7 @@ while ($runCount -le $NumberOfIterations)
771867 }
772868 }
773869
774- if ($TenantAdminCredentials )
870+ if (( $TenantAdminCredentials ) -or ( $listAvl ) )
775871 {
776872 Invoke-Usecase - Name ' TenantRelatedcleanup' - Description " Remove all the tenant related stuff" - UsecaseBlock `
777873 {
@@ -805,7 +901,10 @@ while ($runCount -le $NumberOfIterations)
805901
806902 End - Scenario
807903 $runCount += 1
808- Get-CanaryResult
904+ if (-not $ListAvailable )
905+ {
906+ Get-CanaryResult
907+ }
809908}
810909
811910if ($NumberOfIterations -gt 1 )
0 commit comments