@@ -10,7 +10,7 @@ function Test-AnalysisServicesServer
10
10
)
11
11
12
12
try
13
- {
13
+ {
14
14
# Creating server
15
15
$resourceGroupName = Get-ResourceGroupName
16
16
$serverName = Get-AnalysisServicesServerName
@@ -22,11 +22,14 @@ function Test-AnalysisServicesServer
22
22
Assert-AreEqual $location $serverCreated.Location
23
23
Assert-AreEqual " Microsoft.AnalysisServices/servers" $serverCreated.Type
24
24
Assert-True {$serverCreated.Id -like " *$resourceGroupName *" }
25
- Assert-True {$serverCreated.ServerFullName -ne $null -and $serverCreated.ServerFullName.Contains (" * $serverName * " )}
25
+ Assert-True {$serverCreated.ServerFullName -ne $null -and $serverCreated.ServerFullName.Contains (" $serverName " )}
26
26
27
27
[array ]$serverGet = Get-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName
28
28
$serverGetItem = $serverGet [0 ]
29
+
29
30
Assert-True {$serverGetItem.ProvisioningState -like " Succeeded" }
31
+ Assert-True {$serverGetItem.State -like " Succeeded" }
32
+
30
33
Assert-AreEqual $serverName $serverGetItem.Name
31
34
Assert-AreEqual $location $serverGetItem.Location
32
35
Assert-AreEqual " Microsoft.AnalysisServices/servers" $serverGetItem.Type
@@ -36,7 +39,7 @@ function Test-AnalysisServicesServer
36
39
Assert-True {Test-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName }
37
40
# Test it without specifying a resource group
38
41
Assert-True {Test-AzureRmAnalysisServicesServer - Name $serverName }
39
-
42
+
40
43
# Updating server
41
44
$tagsToUpdate = @ {" TestTag" = " TestUpdate" }
42
45
$serverUpdated = Set-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName - Tag $tagsToUpdate - PassThru
@@ -55,7 +58,7 @@ function Test-AnalysisServicesServer
55
58
# List all servers in resource group
56
59
[array ]$serversInResourceGroup = Get-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName
57
60
Assert-True {$serversInResourceGroup.Count -ge 1 }
58
-
61
+
59
62
$found = 0
60
63
for ($i = 0 ; $i -lt $serversInResourceGroup.Count ; $i ++ )
61
64
{
@@ -95,13 +98,16 @@ function Test-AnalysisServicesServer
95
98
Suspend-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName
96
99
[array ]$serverGet = Get-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName
97
100
$serverGetItem = $serverGet [0 ]
101
+ # this is to ensure backward compatibility compatibility. The servie side would make change to differenciate state and provisioningState in future
102
+ Assert-True {$serverGetItem.State -like " Paused" }
98
103
Assert-True {$serverGetItem.ProvisioningState -like " Paused" }
99
104
100
105
# Resume Analysis Servicesserver
101
106
Resume-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName
102
107
[array ]$serverGet = Get-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName
103
108
$serverGetItem = $serverGet [0 ]
104
109
Assert-True {$serverGetItem.ProvisioningState -like " Succeeded" }
110
+ Assert-True {$serverGetItem.State -like " Succeeded" }
105
111
106
112
# Delete Analysis Servicesserver
107
113
Remove-AzureRmAnalysisServicesServer - ResourceGroupName $resourceGroupName - Name $serverName - PassThru
@@ -124,6 +130,7 @@ Tests Analysis Services server lifecycle Failure scenarios (Create, Update, Get
124
130
#>
125
131
function Test-NegativeAnalysisServicesServer
126
132
{
133
+
127
134
param
128
135
(
129
136
$location = " West US" ,
@@ -193,6 +200,7 @@ function Test-AnalysisServicesServerRestart
193
200
194
201
$serverCreated = New-AzureRmAnalysisServicesServer - ResourceGroupName
$resourceGroupName - Name
$serverName - Location
$location - Sku
' S1' - Administrators
' [email protected] ,[email protected] '
195
202
Assert-True {$serverCreated.ProvisioningState -like " Succeeded" }
203
+ Assert-True {$serverCreated.State -like " Succeeded" }
196
204
197
205
$asAzureProfile = Login- AzureAsAccount - RolloutEnvironment $rolloutEnvironment
198
206
Assert-NotNull $asAzureProfile " Login-AzureAsAccount $rolloutEnvironment must not return null"
0 commit comments