Skip to content

Commit 2ef923b

Browse files
committed
Merge pull request #225 from amarzavery/dev
Updated the installation test script with New-AzureProfile cmdlet
2 parents a5b4091 + a93426d commit 2ef923b

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

tools/InstallationTests/InstallationTest.ps1

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ function Test-UpdateStorageAccount
4343
Assert-AreEqual $storageAccountName $accounts[1].StorageAccountName
4444
}
4545

46-
function Test-GetBatchAccountWithSubscriptionDataFile
46+
[CmdletBinding]
47+
function Get-IncompleteHelp
4748
{
48-
param([PSCredential] $credential)
49-
Get-AzureSubscription | Remove-AzureSubscription -Force
50-
$account = Add-AzureAccount -Credential $credential -SubscriptionDataFile "File.txt"
51-
Select-AzureSubscription -SubscriptionId $account.Subscriptions.Split("`r`n")[0] -SubscriptionDataFile "File.txt"
52-
Get-AzureBatchAccount
53-
Add-AzureAccount -Credential $credential
49+
Get-Help azure | where {[System.String]::IsNullOrEmpty($_.Synopsis) -or `
50+
[System.String]::Equals($_.Synopsis, (Get-Command $_.Name).Definition, `
51+
[System.StringComparison]::OrdinalIgnoreCase)} | % {Write-Output $_.Name}
5452
}

tools/InstallationTests/RunInstallationTests.ps1

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ $global:passedTests = @()
2424
$global:failedTests = @()
2525
$global:times = @{}
2626
$VerbosePreference = "SilentlyContinue"
27+
28+
2729
function Run-TestProtected
2830
{
2931
param([ScriptBlock]$script, [string] $testName)
@@ -100,14 +102,19 @@ Get-AzureSubscription | Remove-AzureSubscription -Force
100102
Add-AzureAccount -Credential $credential
101103
$ErrorActionPreference = "Stop"
102104
Switch-AzureMode AzureServiceManagement
105+
$subscription = $(Get-AzureSubscription -Current).SubscriptionName
106+
$profile = $(New-AzureProfile -SubscriptionId $subscription -Credential $credential)
107+
Select-AzureProfile $profile
103108
$global:startTime = Get-Date
104109
Run-TestProtected { Test-SetAzureStorageBlobContent } "Test-SetAzureStorageBlobContent"
105110
Run-TestProtected { Test-GetModuleVersion $expectedVersion} "Test-GetModuleVersion"
106111
Run-TestProtected { Test-UpdateStorageAccount } "Test-UpdateStorageAccount"
107112
$serviceCommands | % { Run-TestProtected $_ $_.ToString() }
108113
Write-Host -ForegroundColor Green "STARTING RESOURCE MANAGER TESTS"
109114
Switch-AzureMode AzureResourceManager > $null
110-
Run-TestProtected { Test-GetBatchAccountWithSubscriptionDataFile $credential} "Test-GetBatchAccountWithSubscriptionDataFile"
115+
$subscription = $(Get-AzureSubscription -Current).SubscriptionName
116+
$profile = $(New-AzureProfile -SubscriptionId $subscription -Credential $credential)
117+
Select-AzureProfile $profile
111118
$resourceCommands | % { Run-TestProtected $_ $_.ToString() }
112119
Write-Host
113120
Write-Host -ForegroundColor Green "$global:passedCount / $global:totalCount Installation Tests Pass"
@@ -134,5 +141,21 @@ Write-Host
134141
Write-Host -ForegroundColor Green "Start Time: $global:startTime"
135142
Write-Host -ForegroundColor Green "End Time: $global:endTime"
136143
Write-Host -ForegroundColor Green "Elapsed: "($global:endTime - $global:startTime).ToString()
144+
Write-Host "============================================================================================="
145+
Write-Host
146+
Write-Host "===================="
147+
Write-Host "Help Check: ARM Mode"
148+
Write-Host "===================="
149+
Switch-AzureMode AzureResourceManager
150+
Get-IncompleteHelp
151+
Write-Host
152+
Write-Host "===================="
153+
Write-Host "Help Check: ASM Mode"
154+
Write-Host "===================="
155+
Switch-AzureMode AzureServiceManagement
156+
Get-IncompleteHelp
157+
Write-Host
158+
Write-Host "============================================================================================="
159+
Write-Host
137160

138-
$ErrorActionPreference = "Continue"
161+
$ErrorActionPreference = "Continue"

0 commit comments

Comments
 (0)