Skip to content

Commit cf6ae75

Browse files
SiddharthChatrolaMsshahabhijeet
authored andcommitted
PowerShell changes corresponding to breaking change in swagger and .net management API (#3271)
* Added validation for ResourceGroupName and Cache Name * Adding reference to Commands.Resources.Rest in Powershell project * PowerShell changes corresponding to breaking change in swagger and .net management api * code review comments fixed * Fix build failures: adding app.config * Remove app.config
1 parent 7a22019 commit cf6ae75

31 files changed

+10535
-2722
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,17 @@
5757
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.11.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
5858
<Private>True</Private>
5959
</Reference>
60-
<Reference Include="Microsoft.Azure.Management.Redis, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61-
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.3.1.0-preview\lib\net45\Microsoft.Azure.Management.Redis.dll</HintPath>
60+
<Reference Include="Microsoft.Azure.Management.Redis, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
61+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Redis.4.2.0-preview\lib\net45\Microsoft.Azure.Management.Redis.dll</HintPath>
62+
<Private>True</Private>
63+
</Reference>
64+
<Reference Include="Microsoft.Azure.Management.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.5.0.2-preview\lib\net45\Microsoft.Azure.Management.Storage.dll</HintPath>
6366
<Private>True</Private>
6467
</Reference>
6568
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
66-
<SpecificVersion>False</SpecificVersion>
6769
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
70+
<Private>True</Private>
6871
</Reference>
6972
<Reference Include="Microsoft.Azure.Test.Framework">
7073
<SpecificVersion>False</SpecificVersion>
@@ -199,6 +202,10 @@
199202
<Project>{d3804b64-c0d3-48f8-82ec-1f632f833c9e}</Project>
200203
<Name>Commands.Common.Authentication</Name>
201204
</ProjectReference>
205+
<ProjectReference Include="..\..\..\Common\Commands.Common.Storage\Commands.Common.Storage.csproj">
206+
<Project>{65c3a86a-716d-4e7d-ab67-1db00b3bf72d}</Project>
207+
<Name>Commands.Common.Storage</Name>
208+
</ProjectReference>
202209
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
203210
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
204211
<Name>Commands.Common</Name>
@@ -211,6 +218,10 @@
211218
<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
212219
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>
213220
</ProjectReference>
221+
<ProjectReference Include="..\..\Storage\Commands.Management.Storage\Commands.Management.Storage.csproj">
222+
<Project>{a50ab133-5c04-4a17-9054-f8343683ec23}</Project>
223+
<Name>Commands.Management.Storage</Name>
224+
</ProjectReference>
214225
<ProjectReference Include="..\Commands.RedisCache\Commands.RedisCache.csproj">
215226
<Project>{c972e3ef-4461-4758-ba31-93e0947b1253}</Project>
216227
<Name>Commands.RedisCache</Name>
@@ -222,10 +233,10 @@
222233
<None Include="ScenarioTests\RedisCacheTests.ps1">
223234
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
224235
</None>
225-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestExportAzureRmRedisCache.json">
236+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestDiagnosticOperations.json">
226237
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
227238
</None>
228-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestImportAzureRmRedisCache.json">
239+
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestImportExportReboot.json">
229240
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
230241
</None>
231242
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCache.json">
@@ -243,21 +254,9 @@
243254
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRedisCachePipeline.json">
244255
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
245256
</None>
246-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestRemoveAzureRedisCacheDiagnostics.json">
247-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
248-
</None>
249-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestResetAzureRmRedisCache.json">
250-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
251-
</None>
252-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestSetAzureRedisCacheDiagnostics.json">
253-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
254-
</None>
255257
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestSetNonExistingRedisCacheTest.json">
256258
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
257259
</None>
258-
<None Include="SessionRecords\Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests.RedisCacheTests\TestSetRedisCacheBugFixTest.json">
259-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
260-
</None>
261260
</ItemGroup>
262261
<ItemGroup>
263262
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using LegacyTest = Microsoft.Azure.Test;
2626
using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
2727
using TestUtilities = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities;
28+
using Microsoft.Azure.Management.Storage;
2829

2930
namespace Microsoft.Azure.Commands.RedisCache.Test.ScenarioTests
3031
{
@@ -39,6 +40,8 @@ public class RedisCacheController
3940

4041
public RedisManagementClient RedisManagementClient { get; private set; }
4142

43+
public StorageManagementClient StorageClient { get; private set; }
44+
4245
public RedisCacheController()
4346
{
4447
helper = new EnvironmentSetupHelper();
@@ -57,10 +60,12 @@ private void SetupManagementClients(MockContext context)
5760
RedisManagementClient = GetRedisManagementClient(context);
5861
InsightsManagementClient = GetInsightsManagementClient();
5962
ResourceManagementClient = GetResourceManagementClient();
60-
helper.SetupManagementClients(ResourceManagementClient,
61-
InsightsManagementClient,
62-
RedisManagementClient
63-
);
63+
StorageClient = GetStorageManagementClient(context);
64+
helper.SetupManagementClients(
65+
RedisManagementClient,
66+
StorageClient,
67+
ResourceManagementClient,
68+
InsightsManagementClient);
6469
}
6570

6671
public void RunPowerShellTest(params string[] scripts)
@@ -82,7 +87,10 @@ public void RunPowerShellTest(params string[] scripts)
8287
"ScenarioTests\\" + callingClassName + ".ps1",
8388
helper.RMProfileModule,
8489
helper.RMResourceModule,
85-
helper.GetRMModulePath(@"AzureRM.RedisCache.psd1"));
90+
helper.RMStorageDataPlaneModule,
91+
helper.RMStorageModule,
92+
helper.GetRMModulePath(@"AzureRM.RedisCache.psd1"),
93+
"AzureRM.Resources.ps1");
8694

8795
if (scripts != null)
8896
{
@@ -91,6 +99,11 @@ public void RunPowerShellTest(params string[] scripts)
9199
}
92100
}
93101

102+
private StorageManagementClient GetStorageManagementClient(MockContext context)
103+
{
104+
return context.GetServiceClient<StorageManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
105+
}
106+
94107
private RedisManagementClient GetRedisManagementClient(MockContext context)
95108
{
96109
return context.GetServiceClient<RedisManagementClient>(TestEnvironmentFactory.GetTestEnvironment());

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

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ public void TestRedisCachePipeline()
4848
RedisCacheController.NewInstance.RunPowerShellTest("Test-RedisCachePipeline");
4949
}
5050

51-
[Fact]
52-
[Trait(Category.AcceptanceType, Category.CheckIn)]
53-
public void TestSetRedisCacheBugFixTest()
54-
{
55-
RedisCacheController.NewInstance.RunPowerShellTest("Test-SetRedisCacheBugFixTest");
56-
}
57-
5851
[Fact]
5952
[Trait(Category.AcceptanceType, Category.CheckIn)]
6053
public void TestMaxMemoryPolicyErrorCheck()
@@ -68,47 +61,26 @@ public void TestRedisCacheClustering()
6861
{
6962
RedisCacheController.NewInstance.RunPowerShellTest("Test-RedisCacheClustering");
7063
}
71-
64+
7265
[Fact]
7366
[Trait(Category.AcceptanceType, Category.CheckIn)]
74-
public void TestSetAzureRedisCacheDiagnostics()
75-
{
76-
RedisCacheController.NewInstance.RunPowerShellTest("Test-SetAzureRedisCacheDiagnostics");
77-
}
78-
79-
[Fact]
80-
[Trait(Category.AcceptanceType, Category.CheckIn)]
81-
public void TestRemoveAzureRedisCacheDiagnostics()
82-
{
83-
RedisCacheController.NewInstance.RunPowerShellTest("Test-RemoveAzureRedisCacheDiagnostics");
84-
}
85-
86-
[Fact]
87-
[Trait(Category.AcceptanceType, Category.CheckIn)]
88-
public void TestResetAzureRmRedisCache()
89-
{
90-
RedisCacheController.NewInstance.RunPowerShellTest("Test-ResetAzureRmRedisCache");
91-
}
92-
93-
[Fact]
94-
[Trait(Category.AcceptanceType, Category.CheckIn)]
95-
public void TestExportAzureRmRedisCache()
67+
public void TestRedisCachePatchSchedules()
9668
{
97-
RedisCacheController.NewInstance.RunPowerShellTest("Test-ExportAzureRmRedisCache");
69+
RedisCacheController.NewInstance.RunPowerShellTest("Test-RedisCachePatchSchedules");
9870
}
9971

10072
[Fact]
10173
[Trait(Category.AcceptanceType, Category.CheckIn)]
102-
public void TestImportAzureRmRedisCache()
74+
public void TestImportExportReboot()
10375
{
104-
RedisCacheController.NewInstance.RunPowerShellTest("Test-ImportAzureRmRedisCache");
76+
RedisCacheController.NewInstance.RunPowerShellTest("Test-ImportExportReboot");
10577
}
10678

10779
[Fact]
10880
[Trait(Category.AcceptanceType, Category.CheckIn)]
109-
public void TestRedisCachePatchSchedules()
81+
public void TestDiagnosticOperations()
11082
{
111-
RedisCacheController.NewInstance.RunPowerShellTest("Test-RedisCachePatchSchedules");
83+
RedisCacheController.NewInstance.RunPowerShellTest("Test-DiagnosticOperations");
11284
}
11385
}
11486
}

0 commit comments

Comments
 (0)