Skip to content

Commit 20fb3d8

Browse files
authored
Merge pull request Azure#579 from Azure/dev
huangpf PR: dev <- Azure:dev
2 parents 47fc67d + 1953321 commit 20fb3d8

File tree

21 files changed

+1167
-1123
lines changed

21 files changed

+1167
-1123
lines changed

ChangeLog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
##2016.07.11 version 1.6.0
1+
* Azure Redis Cache
2+
* New cmdlet added for New-AzureRmRedisCacheScheduleEntry
3+
* New cmdlet added for New-AzureRmRedisCachePatchSchedule
4+
* New cmdlet added for Get-AzureRmRedisCachePatchSchedule
5+
* New cmdlet added for Remove-AzureRmRedisCachePatchSchedule
6+
##2016.07.11 version 1.6.0
27
* **Behavioral change for -Force, –Confirm and $ConfirmPreference parameters for all cmdlets. We are changing this implementation to be in line with PowerShell guidelines. For most cmdlets, this means removing the Force parameter and to skip the ShouldProcess prompt, users will need to include the parameter: ‘-Confirm:$false’ in their PowerShell scripts.** This changes are addressing following issues:
38
* Correct implementation of –WhatIf functionality, allowing a user to determine the effects of a cmdlet or script without making any actual changes
49
* Control over prompting using a session-wide $ConfirmPreference, so that the user is prompted based on the impact of a prospective change (as reported in the ConfirmImpact setting in the cmdlet)

src/ResourceManager/AzureBatch/Commands.Batch.Test/Commands.Batch.Test.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@
329329
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestCreateAndRemoveBatchAccountViaPiping.json">
330330
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
331331
</None>
332-
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestCreateExistingBatchAccount.json">
333-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
334-
</None>
335332
<None Include="SessionRecords\Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests\TestCreatesNewBatchAccount.json">
336333
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
337334
</None>

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchAccountTests.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ public void TestCreatesNewBatchAccount()
3535
BatchController.NewInstance.RunPsTest("Test-CreatesNewBatchAccount");
3636
}
3737

38-
[Fact]
39-
public void TestCreateExistingBatchAccount()
40-
{
41-
BatchController.NewInstance.RunPsTest("Test-CreateExistingBatchAccount");
42-
}
43-
4438
[Fact]
4539
public void TestUpdatesExistingBatchAccount()
4640
{

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/BatchAccountTests.ps1

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,6 @@ function Test-CreatesNewBatchAccount
5757
}
5858
}
5959

60-
<#
61-
.SYNOPSIS
62-
Tests creating an account that already exists throws
63-
#>
64-
function Test-CreateExistingBatchAccount
65-
{
66-
# Setup
67-
$account = Get-BatchAccountName
68-
$resourceGroup = Get-ResourceGroupName
69-
$location = Get-BatchAccountProviderLocation
70-
71-
try
72-
{
73-
New-AzureRmResourceGroup -Name $resourceGroup -Location $location
74-
75-
# Test
76-
New-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Location $location -Tag @{Name = "testtag"; Value = "testval"}
77-
78-
Assert-Throws { New-AzureRmBatchAccount -Name $account -ResourceGroupName $resourceGroup -Location $location }
79-
}
80-
finally
81-
{
82-
# Cleanup
83-
Clean-BatchAccountAndResourceGroup $account $resourceGroup
84-
}
85-
}
86-
8760
<#
8861
.SYNOPSIS
8962
Tests updating existing Batch account

src/ResourceManager/AzureBatch/Commands.Batch.Test/SessionRecords/Microsoft.Azure.Commands.Batch.Test.ScenarioTests.BatchAccountTests/TestCreateExistingBatchAccount.json

Lines changed: 0 additions & 859 deletions
This file was deleted.

src/ResourceManager/AzureBatch/Commands.Batch/Models/BatchClient.Accounts.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ public partial class BatchClient
4040
/// <returns>A BatchAccountContext object representing the new account</returns>
4141
public virtual BatchAccountContext CreateAccount(string resourceGroupName, string accountName, string location, Hashtable[] tags, string autoStorageAccountId)
4242
{
43-
// use the group lookup to validate whether account already exists. We don't care about the returned
44-
// group name nor the exception
45-
if (GetGroupForAccountNoThrow(accountName) != null)
46-
{
47-
throw new CloudException(Resources.AccountAlreadyExists);
48-
}
49-
5043
Dictionary<string, string> tagDictionary = Helpers.CreateTagDictionary(tags, validate: true);
5144

5245
AutoStorageBaseProperties autoStorage = (string.IsNullOrEmpty(autoStorageAccountId)) ? null : new AutoStorageBaseProperties

src/ResourceManager/AzureBatch/Commands.Batch/Properties/Resources.Designer.cs

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/AzureBatch/Commands.Batch/Properties/Resources.resx

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -117,9 +117,6 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<data name="AccountAlreadyExists" xml:space="preserve">
121-
<value>AccountAlreadyExists: Account already exists.</value>
122-
</data>
123120
<data name="AccountAndKeyInUse" xml:space="preserve">
124121
<value>Executing cmdlet with Batch account {0} with its {1} key. To change which key to use, set the KeyInUse property on the BatchAccountContext.</value>
125122
</data>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@
233233
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCacheClustering.json">
234234
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
235235
</None>
236+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCachePatchSchedules.json">
237+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
238+
</None>
236239
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCachePipeline.json">
237240
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
238241
</None>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,12 @@ public void TestImportAzureRmRedisCache()
103103
{
104104
RedisCacheController.NewInstance.RunPowerShellTest("Test-ImportAzureRmRedisCache");
105105
}
106+
107+
[Fact]
108+
[Trait(Category.AcceptanceType, Category.CheckIn)]
109+
public void TestRedisCachePatchSchedules()
110+
{
111+
RedisCacheController.NewInstance.RunPowerShellTest("Test-RedisCachePatchSchedules");
112+
}
106113
}
107114
}

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,63 @@ function Test-ImportAzureRmRedisCache
463463
Import-AzureRmRedisCache -ResourceGroupName $resourceGroupName -Name $cacheName -Files $files -Force
464464
}
465465

466+
<#
467+
.SYNOPSIS
468+
Tests schedule patching
469+
#>
470+
function Test-RedisCachePatchSchedules
471+
{
472+
$resourceGroupName = "SiddharthsSub"
473+
$cacheName = "sunny-premium"
474+
475+
$weekend = New-AzureRmRedisCacheScheduleEntry -DayOfWeek "Weekend" -StartHourUtc 2 -MaintenanceWindow "06:00:00"
476+
$thursday = New-AzureRmRedisCacheScheduleEntry -DayOfWeek "Thursday" -StartHourUtc 10 -MaintenanceWindow "09:00:00"
477+
478+
$createResult = New-AzureRmRedisCachePatchSchedule -ResourceGroupName $resourceGroupName -Name $cacheName -Entries @($weekend, $thursday)
479+
Assert-True {$createResult.Count -eq 3}
480+
foreach ($scheduleEntry in $createResult)
481+
{
482+
if($scheduleEntry.DayOfWeek -eq "Thursday")
483+
{
484+
Assert-AreEqual 10 $scheduleEntry.StartHourUtc
485+
Assert-AreEqual "09:00:00" $scheduleEntry.MaintenanceWindow
486+
}
487+
elseif($scheduleEntry.DayOfWeek -eq "Saturday" -or $scheduleEntry.DayOfWeek -eq "Sunday")
488+
{
489+
Assert-AreEqual 2 $scheduleEntry.StartHourUtc
490+
Assert-AreEqual "06:00:00" $scheduleEntry.MaintenanceWindow
491+
}
492+
else
493+
{
494+
Assert-True $false "Unknown DayOfWeek."
495+
}
496+
}
497+
498+
$getResult = Get-AzureRmRedisCachePatchSchedule -ResourceGroupName $resourceGroupName -Name $cacheName
499+
Assert-True {$getResult.Count -eq 3}
500+
foreach ($scheduleEntry in $getResult)
501+
{
502+
if($scheduleEntry.DayOfWeek -eq "Thursday")
503+
{
504+
Assert-AreEqual 10 $scheduleEntry.StartHourUtc
505+
Assert-AreEqual "09:00:00" $scheduleEntry.MaintenanceWindow
506+
}
507+
elseif($scheduleEntry.DayOfWeek -eq "Saturday" -or $scheduleEntry.DayOfWeek -eq "Sunday")
508+
{
509+
Assert-AreEqual 2 $scheduleEntry.StartHourUtc
510+
Assert-AreEqual "06:00:00" $scheduleEntry.MaintenanceWindow
511+
}
512+
else
513+
{
514+
Assert-True $false "Unknown DayOfWeek."
515+
}
516+
}
517+
518+
Remove-AzureRmRedisCachePatchSchedule -ResourceGroupName $resourceGroupName -Name $cacheName
519+
520+
Assert-ThrowsContains {Get-AzureRmRedisCachePatchSchedule -ResourceGroupName $resourceGroupName -Name $cacheName} "There are no patch schedules found for redis cache 'sunny-premium'"
521+
}
522+
466523
<#
467524
.SYNOPSIS
468525
Sleeps but only during recording.

0 commit comments

Comments
 (0)