Skip to content

Commit 3ed8855

Browse files
authored
Merge pull request #6151 from wastoresh/worm
[Storage] Support Immutability Policy in AzureRm.Storage
2 parents f2d35e8 + bb439f1 commit 3ed8855

File tree

35 files changed

+10044
-20
lines changed

35 files changed

+10044
-20
lines changed

src/ResourceManager/Storage/AzureRM.Storage.psd1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,17 @@ CmdletsToExport = 'Get-AzureRmStorageAccount', 'Get-AzureRmStorageAccountKey',
8585
'Update-AzureRmStorageAccountNetworkRuleSet',
8686
'Get-AzureRmStorageAccountNetworkRuleSet',
8787
'Add-AzureRmStorageAccountNetworkRule',
88-
'Remove-AzureRmStorageAccountNetworkRule'
88+
'Remove-AzureRmStorageAccountNetworkRule',
89+
'Get-AzureRmStorageContainer',
90+
'Update-AzureRmStorageContainer',
91+
'New-AzureRmStorageContainer',
92+
'Remove-AzureRmStorageContainer',
93+
'Add-AzureRmStorageContainerLegalHold',
94+
'Remove-AzureRmStorageContainerLegalHold',
95+
'Set-AzureRmStorageContainerImmutabilityPolicy',
96+
'Get-AzureRmStorageContainerImmutabilityPolicy',
97+
'Remove-AzureRmStorageContainerImmutabilityPolicy',
98+
'Lock-AzureRmStorageContainerImmutabilityPolicy'
8999

90100
# Variables to export from this module
91101
# VariablesToExport = @()

src/ResourceManager/Storage/Commands.Management.Storage.Test/Commands.Management.Storage.Test.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
<ItemGroup>
142142
<Compile Include="Properties\AssemblyInfo.cs" />
143143
<Compile Include="ScenarioTests\StorageAccountTests.cs" />
144+
<Compile Include="ScenarioTests\StorageBlobTests.cs" />
144145
<Compile Include="TestController.cs" />
145146
</ItemGroup>
146147
<ItemGroup>
@@ -166,18 +167,24 @@
166167
<SubType>Designer</SubType>
167168
</None>
168169
<None Include="ScenarioTests\Common.ps1">
169-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
170+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
170171
</None>
171172
<None Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\AzureRM.Resources.ps1">
172173
<Link>ScenarioTests\AzureRM.Resources.ps1</Link>
173174
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
174175
</None>
175176
<None Include="ScenarioTests\StorageAccountTests.ps1">
176-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
177+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
178+
</None>
179+
<None Include="ScenarioTests\StorageBlobTests.ps1">
180+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
177181
</None>
178182
<None Include="SessionRecords\Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageAccountTests\*.json">
179183
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
180184
</None>
185+
<None Include="SessionRecords\Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests.StorageBlobTests\*.json">
186+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
187+
</None>
181188
</ItemGroup>
182189
<ItemGroup>
183190
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
16+
using Microsoft.Azure.ServiceManagemenet.Common.Models;
17+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
18+
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
19+
using Xunit;
20+
using Xunit.Abstractions;
21+
22+
namespace Microsoft.Azure.Commands.Management.Storage.Test.ScenarioTests
23+
{
24+
public class StorageBlobTests : RMTestBase
25+
{
26+
public StorageBlobTests(ITestOutputHelper output)
27+
{
28+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
29+
}
30+
31+
[Fact]
32+
[Trait(Category.AcceptanceType, Category.CheckIn)]
33+
public void TestStorageBlobContainer()
34+
{
35+
TestController.NewInstance.RunPsTest("Test-StorageBlobContainer");
36+
}
37+
38+
[Fact]
39+
[Trait(Category.AcceptanceType, Category.CheckIn)]
40+
public void TestStorageBlobContainerLegalHold()
41+
{
42+
TestController.NewInstance.RunPsTest("Test-StorageBlobContainerLegalHold");
43+
}
44+
45+
[Fact]
46+
[Trait(Category.AcceptanceType, Category.CheckIn)]
47+
public void TestStorageBlobContainerImmutabilityPolicy()
48+
{
49+
TestController.NewInstance.RunPsTest("Test-StorageBlobContainerImmutabilityPolicy");
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)