Skip to content

Commit 713fa64

Browse files
Merge branch 'renamestaging' into vnext
2 parents 97f182c + 495da3d commit 713fa64

34 files changed

Lines changed: 2756 additions & 4349 deletions

CanaryValidator/Canary.Tests.ps1

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -196,83 +196,83 @@ while ($runCount -le $NumberOfIterations)
196196
{
197197
Invoke-Usecase -Name 'GetAzureStackInfraRole' -Description "List all infrastructure roles" -UsecaseBlock `
198198
{
199-
Get-AzSInfraRole -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
199+
Get-AzsInfrastructureRole -Location $ResourceLocation
200200
}
201201

202202
Invoke-Usecase -Name 'GetAzureStackInfraRoleInstance' -Description "List all infrastructure role instances" -UsecaseBlock `
203203
{
204-
Get-AzSInfraRoleInstance -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
204+
Get-AzsInfrastructureRoleInstance -Location $ResourceLocation
205205
}
206206

207207
Invoke-Usecase -Name 'GetAzureStackLogicalNetwork' -Description "List all logical networks" -UsecaseBlock `
208208
{
209-
Get-AzSLogicalNetwork -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
209+
Get-AzsLogicalNetwork -Location $ResourceLocation
210210
}
211211

212212
Invoke-Usecase -Name 'GetAzureStackStorageCapacity' -Description "List storage capacity" -UsecaseBlock `
213213
{
214-
Get-AzSStorageSubsystem -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
214+
Get-AzSStorageSubsystem -Location $ResourceLocation
215215
}
216216

217217
Invoke-Usecase -Name 'GetAzureStackStorageShare' -Description "List all storage file shares" -UsecaseBlock `
218218
{
219-
Get-AzSStorageShare -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
219+
Get-AzsStorageShare -Location $ResourceLocation
220220
}
221221

222222
Invoke-Usecase -Name 'GetAzureStackScaleUnit' -Description "List Azure Stack scale units in specified Region" -UsecaseBlock `
223223
{
224-
Get-AzSScaleUnit -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
224+
Get-AzsScaleUnit -Location $ResourceLocation
225225
}
226226

227227
Invoke-Usecase -Name 'GetAzureStackScaleUnitNode' -Description "List nodes in scale unit" -UsecaseBlock `
228228
{
229-
Get-AzSScaleUnitNode -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
229+
Get-AzsScaleUnitNode -Location $ResourceLocation
230230
}
231231

232232
Invoke-Usecase -Name 'GetAzureStackIPPool' -Description "List all IP pools" -UsecaseBlock `
233233
{
234-
Get-AzSIPPool -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
234+
Get-AzsIpPool -Location $ResourceLocation
235235
}
236236

237237
Invoke-Usecase -Name 'GetAzureStackMacPool' -Description "List all MAC address pools " -UsecaseBlock `
238238
{
239-
Get-AzSMacPool -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
239+
Get-AzsMacPool -Location $ResourceLocation
240240
}
241241

242242
Invoke-Usecase -Name 'GetAzureStackGatewayPool' -Description "List all gateway pools" -UsecaseBlock `
243243
{
244-
Get-AzSGatewayPool -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
244+
Get-AzsGatewayPool -Location $ResourceLocation
245245
}
246246

247247
Invoke-Usecase -Name 'GetAzureStackSLBMux' -Description "List all SLB MUX instances" -UsecaseBlock `
248248
{
249-
Get-AzSSLBMUX -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
249+
Get-AzsSlbMux -Location $ResourceLocation
250250
}
251251

252252
Invoke-Usecase -Name 'GetAzureStackGateway' -Description "List all gateway" -UsecaseBlock `
253253
{
254-
Get-AzSGateway -AzureStackCredentials $ServiceAdminCredentials -TenantID $TenantID -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
254+
Get-AzsGateway -Location $ResourceLocation
255255
}
256256
}
257257

258258
Invoke-Usecase -Name 'ListHealthResourceProviderAlerts' -Description "List all HealthResourceProvider(HRP) alerts " -UsecaseBlock `
259259
{
260260
Invoke-Usecase -Name 'GetAzureStackAlert' -Description "List all alerts" -UsecaseBlock `
261261
{
262-
Get-AzSAlert -TenantID $TenantID -AzureStackCredentials $ServiceAdminCredentials -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
262+
Get-AzsAlert -Location $ResourceLocation
263263
}
264264
}
265265

266266
Invoke-Usecase -Name 'ListUpdatesResourceProviderInfo' -Description "List URP information like summary of updates available, update to be applied, last update applied etc." -UsecaseBlock `
267267
{
268268
Invoke-Usecase -Name 'GetAzureStackUpdateSummary' -Description "List summary of updates status" -UsecaseBlock `
269269
{
270-
Get-AzSUpdateLocation -TenantID $TenantID -AzureStackCredentials $ServiceAdminCredentials -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
270+
Get-AzSUpdateLocation -Location $ResourceLocation
271271
}
272272

273273
Invoke-Usecase -Name 'GetAzureStackUpdateToApply' -Description "List all updates that can be applied" -UsecaseBlock `
274274
{
275-
Get-AzSUpdate -TenantID $TenantID -AzureStackCredentials $ServiceAdminCredentials -EnvironmentName $SvcAdminEnvironmentName -region $ResourceLocation
275+
Get-AzsUpdate -Location $ResourceLocation
276276
}
277277
}
278278

@@ -282,7 +282,7 @@ while ($runCount -le $NumberOfIterations)
282282
{
283283
if (-not (Get-AzureRmVMImage -Location $ResourceLocation -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Sku "2016-Datacenter-Core" -ErrorAction SilentlyContinue))
284284
{
285-
New-Server2016VMImage -ISOPath $WindowsISOPath -TenantId $TenantID -EnvironmentName $SvcAdminEnvironmentName -Location $ResourceLocation -Version Core -AzureStackCredentials $ServiceAdminCredentials -CreateGalleryItem $false
285+
New-AzsServer2016VMImage -ISOPath $WindowsISOPath -Location $ResourceLocation -Version Core -CreateGalleryItem $false
286286
}
287287
}
288288
}
@@ -302,7 +302,7 @@ while ($runCount -le $NumberOfIterations)
302302
}
303303
New-Item -Path $CanaryCustomImageFolder -ItemType Directory
304304
$CustomVHDPath = CopyImage -ImagePath $LinuxImagePath -OutputFolder $CanaryCustomImageFolder
305-
Add-VMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -tenantID $TenantID -azureStackCredentials $ServiceAdminCredentials -Location $ResourceLocation -CreateGalleryItem $false -EnvironmentName $SvcAdminEnvironmentName
305+
Add-AzsVMImage -publisher $linuxImagePublisher -offer $linuxImageOffer -sku $LinuxOSSku -version $linuxImageVersion -osDiskLocalPath $CustomVHDPath -osType Linux -Location $ResourceLocation -CreateGalleryItem $false
306306
Remove-Item $CanaryCustomImageFolder -Force -Recurse
307307
}
308308
}
@@ -404,20 +404,20 @@ while ($runCount -le $NumberOfIterations)
404404
{
405405
Invoke-Usecase -Name 'ListAssignedRoles' -Description "List assigned roles to Service Principle - $($servicePrincipal.DisplayName)" -UsecaseBlock `
406406
{
407-
Get-AzureRmRoleAssignment -ObjectId $servicePrincipal.Id -ErrorAction Stop
407+
Get-AzureRmRoleAssignment -ObjectId $servicePrincipal.Id -ErrorAction Stop
408408
}
409409

410410
$allAssignedRoles = Get-AzureRmRoleAssignment -ObjectId $servicePrincipal.Id -ErrorAction Stop
411411
if (-not $allAssignedRoles -or ($allAssignedRoles -and -not ($allAssignedRoles | Where-Object {$_.RoleDefinitionName -eq $readerRole.Name})))
412412
{
413413
Invoke-Usecase -Name 'AssignReaderRole' -Description "Assign Reader role to Service Principle - $($servicePrincipal.DisplayName)" -UsecaseBlock `
414414
{
415-
New-AzureRmRoleAssignment -Scope "/Subscriptions/$subscriptionID" -RoleDefinitionName $readerRole.Name -ObjectId $servicePrincipal.Id -ErrorAction Stop
415+
New-AzureRmRoleAssignment -Scope "/Subscriptions/$subscriptionID" -RoleDefinitionName $readerRole.Name -ObjectId $servicePrincipal.Id -ErrorAction Stop
416416
}
417417

418418
Invoke-Usecase -Name 'VerifyReaderRoleAssignment' -Description "Verify if the Service Principle has got Reader role assigned successfully" -UsecaseBlock `
419419
{
420-
if (-not (Get-AzureRmRoleAssignment -RoleDefinitionName $readerRole.Name -Scope "/Subscriptions/$subscriptionID" -ErrorAction Stop))
420+
if (-not (Get-AzureRmRoleAssignment -RoleDefinitionName $readerRole.Name -Scope "/Subscriptions/$subscriptionID" -ErrorAction Stop))
421421
{
422422
throw [System.Exception] "Unable to assign role ($readerRole.Name) to Service Principle ($servicePrincipal.Id) for subscription $tenantSubscriptionName"
423423
}
@@ -427,15 +427,15 @@ while ($runCount -le $NumberOfIterations)
427427
{
428428
Invoke-Usecase -Name 'RemoveReaderRoleAssignment' -Description "Remove Reader role assignment from Service Principle - $($servicePrincipal.DisplayName)" -UsecaseBlock `
429429
{
430-
Remove-AzureRmRoleAssignment -Scope "/Subscriptions/$subscriptionID" -RoleDefinitionName $readerRole.Name -ObjectId $servicePrincipal.Id -Force -ErrorAction Stop
430+
Remove-AzureRmRoleAssignment -Scope "/Subscriptions/$subscriptionID" -RoleDefinitionName $readerRole.Name -ObjectId $servicePrincipal.Id -Force -ErrorAction Stop
431431
}
432432
}
433433
}
434434
}
435435

436436
Invoke-Usecase -Name 'ListExistingRoleDefinitions' -Description "List existing Role Definitions" -UsecaseBlock `
437437
{
438-
$availableRoles = Get-AzureRmRoleDefinition -ErrorAction Stop
438+
$availableRoles = Get-AzureRmRoleDefinition -ErrorAction Stop
439439
if (-not $availableRoles)
440440
{
441441
throw [System.Exception] "No roles are available."
@@ -458,7 +458,7 @@ while ($runCount -le $NumberOfIterations)
458458
{
459459
Invoke-Usecase -Name 'CustomRoleDefinition' -Description "Create a custom Role Definition - $customRoleName" -UsecaseBlock `
460460
{
461-
$role = Get-AzureRmRoleDefinition -Name Reader
461+
$role = Get-AzureRmRoleDefinition -Name Reader
462462
$role.Id = $null
463463
$role.Name = $customRoleName
464464
$role.Description = "Custom role definition for Canary"
@@ -477,14 +477,14 @@ while ($runCount -le $NumberOfIterations)
477477
{
478478
Invoke-Usecase -Name 'RemoveCustomRoleDefinition' -Description "Remove custom role definition - $customRoleName" -UsecaseBlock `
479479
{
480-
Remove-AzureRmRoleDefinition -Name $customRoleName -Scope "/Subscriptions/$subscriptionID" -Force -ErrorAction Stop
480+
Remove-AzureRmRoleDefinition -Name $customRoleName -Scope "/Subscriptions/$subscriptionID" -Force -ErrorAction Stop
481481
}
482482
}
483483
}
484484

485485
Invoke-Usecase -Name 'GetProviderOperations' -Description "Get provider operations for all resource providers" -UsecaseBlock `
486486
{
487-
$resourceProviders = Get-AzureRmResourceProvider -ListAvailable
487+
$resourceProviders = Get-AzureRmResourceProvider -ListAvailable
488488
# Some of the RPs have not implemented their operations API yet. So update this exclusion list whenever any RP implements its operations API
489489
$rpOperationsExclusionList = @("Microsoft.Compute", "Microsoft.Commerce", "Microsoft.Gallery", "Microsoft.Insights")
490490
$totalOperationsPerRP = @()

CanaryValidator/README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Canary validator provides a breadth customer experience with the Azure Stack dep
44
Instructions are relative to the .\CanaryValidator directory.
55
Canary can be invoked either as Service Administrator or Tenant Administrator.
66

7-
# Download Canary
7+
## Download Canary
8+
89
```powershell
910
Invoke-WebRequest https://github.com/Azure/AzureStack-Tools/archive/master.zip -OutFile master.zip
1011
Expand-Archive master.zip -DestinationPath . -Force
1112
Set-Location -Path ".\AzureStack-Tools-master\CanaryValidator" -PassThru
1213
```
1314

14-
# To execute Canary as Tenant Administrator (if Windows Server 2016 or Windows Server 2012-R2 images are already present in the PIR)
15+
## To execute Canary as Tenant Administrator (if Windows Server 2016 or Windows Server 2012-R2 images are already present in the PIR)
16+
1517
```powershell
1618
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
1719
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
@@ -21,7 +23,8 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
2123
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds -TenantArmEndpoint "<Tenant ARM endpoint>" -TenantAdminCredentials $TenantAdminCreds
2224
```
2325

24-
# To execute Canary as Tenant Administrator (if Windows Server 2016 or Windows Server 2012-R2 images are not present in PIR)
26+
## To execute Canary as Tenant Administrator (if Windows Server 2016 or Windows Server 2012-R2 images are not present in PIR)
27+
2528
```powershell
2629
# Download the WS2016 ISO image from: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016, and place it on your local machine
2730
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
@@ -32,7 +35,8 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
3235
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds -TenantArmEndpoint "<Tenant ARM endpoint>" -TenantAdminCredentials $TenantAdminCreds -WindowsISOPath "<path where the WS2016 ISO is present>"
3336
```
3437

35-
# To execute Canary as Service Administrator
38+
## To execute Canary as Service Administrator
39+
3640
```powershell
3741
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
3842
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
@@ -41,7 +45,8 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
4145
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds
4246
```
4347

44-
# To list the usecases in Canary
48+
## To list the usecases in Canary
49+
4550
```powershell
4651
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
4752
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
@@ -100,7 +105,8 @@ Sample output:
100105
DeleteUtilitiesResourceGroup
101106
```
102107

103-
# To exclude certain usecases from getting executed
108+
## To exclude certain usecases from getting executed
109+
104110
```powershell
105111
# Install-Module -Name 'AzureRm.Bootstrapper' -Scope CurrentUser
106112
# Install-AzureRmProfile -profile '2017-03-09-profile' -Force -Scope CurrentUser
@@ -110,16 +116,17 @@ $ServiceAdminCreds = New-Object System.Management.Automation.PSCredential "<Ser
110116
.\Canary.Tests.ps1 -TenantID "<TenantID from Azure Active Directory>" -AdminArmEndpoint "<Administrative ARM endpoint>" -ServiceAdminCredentials $ServiceAdminCreds -ExclusionList "ListFabricResourceProviderInfo","ListUpdateResourceProviderInfo"
111117
```
112118

113-
# Reading the results & logs
119+
## Reading the results & logs
120+
114121
Canary generates log files in the TMP directory ($env:TMP). The logs can be found under the directory "CanaryLogs[DATETIME]". There are two types of logs generated, a text log and a JSON log. JSON log provides a quick and easy view of all the usecases and their corresponding results. Text log provides a more detailed output of each usecase execution, its output and results.
115122

116123
Each usecase entry in the JSON log consists of the following fields.
124+
117125
- Name
118126
- Description
119127
- StartTime
120128
- EndTime
121129
- Result
122130
- Exception (in case a scenario fails)
123131

124-
The exception field is helpful to debug failed usecases.
125-
132+
The exception field is helpful to debug failed use cases.

0 commit comments

Comments
 (0)