Skip to content

Commit 1a0c010

Browse files
author
Radhika Kashyap
committed
Merge branch 'dev' of github.com:Azure/azure-powershell into GetRoleDefinitions
Conflicts: src/ResourceManager/RedisCache/Commands.RedisCache.Test/packages.config src/ResourceManager/RedisCache/Commands.RedisCache/packages.config
2 parents 08cb6ab + 40edc5b commit 1a0c010

File tree

16 files changed

+1840
-1130
lines changed

16 files changed

+1840
-1130
lines changed

ChangeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* Added Batch cmdlets
33
* Start-AzureBatchPoolResize
44
* Stop-AzureBatchPoolResize
5+
* RedisCache cmdlets
6+
* Set-AzureRedisCache - Added support for scaling, using RedisConfiguration instead of MaxMemoryPolicy #513
7+
* New-AzureRedisCache - Using RedisConfiguration instead of MaxMemoryPolicy #513
58

69
2015.06.05 version 0.9.3
710
* Fixed bug in Websites cmdlets related to slots #454

src/ResourceManager/RedisCache/Commands.RedisCache.Test/Commands.RedisCache.Test.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
<Reference Include="Microsoft.Azure.Common.NetFramework">
5757
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
5858
</Reference>
59-
<Reference Include="Microsoft.Azure.Management.Redis">
60-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.0.14.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll</HintPath>
59+
<Reference Include="Microsoft.Azure.Management.Redis, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
60+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.1.0.0-preview\lib\net40\Microsoft.Azure.Management.Redis.dll</HintPath>
6161
</Reference>
6262
<Reference Include="Microsoft.Azure.ResourceManager">
6363
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
@@ -161,9 +161,6 @@
161161
<None Include="ScenarioTests\RedisCacheTests.ps1">
162162
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
163163
</None>
164-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestCreateExistingRedisCacheTest.json">
165-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
166-
</None>
167164
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
168165
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
169166
</None>

src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ public void TestSetNonExistingRedisCacheTest()
3434
RunPowerShellTest("Test-SetNonExistingRedisCacheTest");
3535
}
3636

37-
[Fact]
38-
[Trait(Category.AcceptanceType, Category.CheckIn)]
39-
public void TestCreateExistingRedisCacheTest()
40-
{
41-
RunPowerShellTest("Test-CreateExistingRedisCacheTest");
42-
}
43-
4437
[Fact]
4538
[Trait(Category.AcceptanceType, Category.CheckIn)]
4639
public void TestRedisCachePipeline()

src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Test-RedisCache
5252
}
5353

5454
# Updating Cache
55-
$cacheUpdated = Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -MaxMemoryPolicy AllKeysLRU -EnableNonSslPort $false
55+
$cacheUpdated = Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -RedisConfiguration @{"maxmemory-policy" = "allkeys-lru"} -EnableNonSslPort $true
5656

5757
Assert-AreEqual $cacheName $cacheUpdated.Name
5858
Assert-AreEqual $location $cacheUpdated.Location
@@ -65,8 +65,8 @@ function Test-RedisCache
6565
Assert-AreEqual "2.8" $cacheUpdated.RedisVersion
6666
Assert-AreEqual "250MB" $cacheUpdated.Size
6767
Assert-AreEqual "Basic" $cacheUpdated.Sku
68-
Assert-AreEqual "AllKeysLRU" $cacheUpdated.MaxMemoryPolicy.Replace("-", "")
69-
Assert-False { $cacheUpdated.EnableNonSslPort }
68+
Assert-AreEqual "allkeys-lru" $cacheUpdated.RedisConfiguration.Item("maxmemory-policy")
69+
Assert-True { $cacheUpdated.EnableNonSslPort }
7070

7171
Assert-NotNull $cacheUpdated.PrimaryKey "PrimaryKey do not exists"
7272
Assert-NotNull $cacheUpdated.SecondaryKey "SecondaryKey do not exists"
@@ -153,22 +153,6 @@ function Test-SetNonExistingRedisCacheTest
153153
Assert-Throws {Set-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -MaxMemoryPolicy AllKeysLRU}
154154
}
155155

156-
<#
157-
.SYNOPSIS
158-
Tests creating redis cache that already exists.
159-
#>
160-
function Test-CreateExistingRedisCacheTest
161-
{
162-
# Setup
163-
# resource group should exists
164-
$resourceGroupName = "MyResourceGroup"
165-
$cacheName = "myportalcache"
166-
$location = "North Central US"
167-
168-
# Creating Cache
169-
Assert-ThrowsContains {New-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size 250MB -Sku Standard} "already exists"
170-
}
171-
172156
<#
173157
.SYNOPSIS
174158
Tests redis cache.
@@ -182,7 +166,7 @@ function Test-RedisCachePipeline
182166
$location = "North Central US"
183167

184168
# Creating Cache
185-
$cacheCreated = New-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size 250MB -Sku Basic -EnableNonSslPort $false
169+
$cacheCreated = New-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Location $location -Size 250MB -Sku Basic -EnableNonSslPort $true
186170

187171
Assert-AreEqual $cacheName $cacheCreated.Name
188172
Assert-AreEqual $location $cacheCreated.Location
@@ -195,7 +179,7 @@ function Test-RedisCachePipeline
195179
Assert-AreEqual "2.8" $cacheCreated.RedisVersion
196180
Assert-AreEqual "250MB" $cacheCreated.Size
197181
Assert-AreEqual "Basic" $cacheCreated.Sku
198-
Assert-False { $cacheCreated.EnableNonSslPort }
182+
Assert-True { $cacheCreated.EnableNonSslPort }
199183

200184
Assert-NotNull $cacheCreated.PrimaryKey "PrimaryKey do not exists"
201185
Assert-NotNull $cacheCreated.SecondaryKey "SecondaryKey do not exists"
@@ -224,7 +208,7 @@ function Test-RedisCachePipeline
224208
}
225209

226210
# Updating Cache using pipeline
227-
Get-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName | Set-AzureRedisCache -MaxMemoryPolicy AllKeysRandom -EnableNonSslPort $true
211+
Get-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName | Set-AzureRedisCache -RedisConfiguration @{"maxmemory-policy" = "allkeys-random"} -EnableNonSslPort $false
228212
$cacheUpdatedPiped = Get-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName
229213

230214
Assert-AreEqual $cacheName $cacheUpdatedPiped.Name
@@ -238,8 +222,8 @@ function Test-RedisCachePipeline
238222
Assert-AreEqual "2.8" $cacheUpdatedPiped.RedisVersion
239223
Assert-AreEqual "250MB" $cacheUpdatedPiped.Size
240224
Assert-AreEqual "Basic" $cacheUpdatedPiped.Sku
241-
Assert-AreEqual "AllKeysRandom" $cacheUpdatedPiped.MaxMemoryPolicy.Replace("-", "")
242-
Assert-True { $cacheUpdatedPiped.EnableNonSslPort }
225+
Assert-AreEqual "allkeys-random" $cacheUpdatedPiped.RedisConfiguration.Item("maxmemory-policy")
226+
Assert-False { $cacheUpdatedPiped.EnableNonSslPort }
243227

244228
# Get cache keys
245229
$cacheKeysBeforeUpdate = Get-AzureRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName | Get-AzureRedisCacheKey

0 commit comments

Comments
 (0)