Skip to content

Commit b34b213

Browse files
vladraiHovsep
authored andcommitted
[Release 1.6.0] Updating DNS powershell to new SDK (#2572)
* powershell fixes for new sdk * adding dns1.6.0 pkg * powershell to add new recordset with records * Removing location * Updating Management.Dns nuget * Fixing powershell tests to work with new DNS nuget * Fixing DNS tests * Forcing test json to be copied to output folder * Making zone scenarios to be copied as well * Fixing test records directory
1 parent 03cfa01 commit b34b213

File tree

73 files changed

+14955
-9374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+14955
-9374
lines changed

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
</Reference>
7878
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7979
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.1.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
80+
<Private>True</Private>
8081
</Reference>
8182
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8283
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.4-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
@@ -123,6 +124,7 @@
123124
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
124125
</Reference>
125126
<Reference Include="System.Net.Http.WebRequest" />
127+
<Reference Include="System.Runtime.Serialization" />
126128
<Reference Include="System.Xml.Linq" />
127129
<Reference Include="System.Data.DataSetExtensions" />
128130
<Reference Include="Microsoft.CSharp" />

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/packages.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<package id="Hyak.Common" version="1.0.3" targetFramework="net45" />
44
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
55
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
6-
<package id="Microsoft.Azure.Management.Resources" version="2.18.14-preview" targetFramework="net45" />
76
<package id="Microsoft.Azure.Management.ResourceManager" version="1.1.1-preview" targetFramework="net45" />
87
<package id="Microsoft.Azure.Test.Framework" version="1.0.6026.28191-prerelease" targetFramework="net45" />
98
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5945.28173-prerelease" targetFramework="net45" />

src/ResourceManager/Dns/Commands.Dns.Test/Commands.Dns.Test.csproj

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,61 @@
5656
<SpecificVersion>False</SpecificVersion>
5757
<HintPath>..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll</HintPath>
5858
</Reference>
59-
<Reference Include="Microsoft.Azure.Management.Authorization">
59+
<Reference Include="Microsoft.Azure.Management.Authorization, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60+
<SpecificVersion>False</SpecificVersion>
6061
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
62+
<Private>True</Private>
6163
</Reference>
6264
<Reference Include="Microsoft.Azure.Management.Dns, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6365
<SpecificVersion>False</SpecificVersion>
64-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Dns.1.2.1-preview\lib\net40\Microsoft.Azure.Management.Dns.dll</HintPath>
66+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Dns.1.7.2-preview\lib\net45\Microsoft.Azure.Management.Dns.dll</HintPath>
67+
<Private>True</Private>
6568
</Reference>
66-
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
69+
<Reference Include="Microsoft.Azure.Management.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6770
<SpecificVersion>False</SpecificVersion>
68-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ResourceManager.1.1.1-preview\lib\net45\Microsoft.Azure.Management.ResourceManager.dll</HintPath>
72+
<Private>True</Private>
6973
</Reference>
7074
<Reference Include="Microsoft.Azure.Test.Framework">
7175
<SpecificVersion>False</SpecificVersion>
7276
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6026.28191-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
7377
</Reference>
7478
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7579
<SpecificVersion>False</SpecificVersion>
76-
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5945.28173-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
80+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.6.3-preview\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
81+
<Private>True</Private>
7782
</Reference>
7883
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.27.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
84+
<SpecificVersion>False</SpecificVersion>
7985
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.27.306291202\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
86+
<Private>True</Private>
87+
</Reference>
88+
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms, Version=2.27.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
89+
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.27.306291202\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
90+
<Private>True</Private>
8091
</Reference>
8192
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8293
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
8394
<Private>True</Private>
8495
</Reference>
96+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
97+
<SpecificVersion>False</SpecificVersion>
98+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.1.0\lib\net45\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
99+
<Private>True</Private>
100+
</Reference>
85101
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
102+
<SpecificVersion>False</SpecificVersion>
86103
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.4-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
87104
<Private>True</Private>
88105
</Reference>
106+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
107+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.2.6-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
108+
<Private>True</Private>
109+
</Reference>
110+
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
111+
<SpecificVersion>False</SpecificVersion>
112+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.20.0-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
113+
</Reference>
89114
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
90115
<SpecificVersion>False</SpecificVersion>
91116
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
@@ -123,6 +148,7 @@
123148
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll</HintPath>
124149
</Reference>
125150
<Reference Include="System.Net.Http.WebRequest" />
151+
<Reference Include="System.Runtime.Serialization" />
126152
<Reference Include="System.Xml.Linq" />
127153
<Reference Include="System.Data.DataSetExtensions" />
128154
<Reference Include="Microsoft.CSharp" />
@@ -155,8 +181,6 @@
155181
<Compile Include="ScenarioTests\ZoneTests.cs" />
156182
<Compile Include="ScenarioTests\RecordsTests.cs" />
157183
<Compile Include="ScenarioTests\DnsTestsBase.cs" />
158-
<Compile Include="UnitTests\GetAzureDnsRecordSetTests.cs" />
159-
<Compile Include="UnitTests\GetAzureDnsZoneTests.cs" />
160184
</ItemGroup>
161185
<ItemGroup>
162186
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj">
@@ -210,15 +234,24 @@
210234
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetAAAA.json">
211235
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
212236
</None>
237+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetAAAANonEmpty.json">
238+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
239+
</None>
213240
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetAddRecordTypeMismatch.json">
214241
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
215242
</None>
216243
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetAddTwoCnames.json">
217244
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
218245
</None>
246+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetANonEmpty.json">
247+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
248+
</None>
219249
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetCNAME.json">
220250
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
221251
</None>
252+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetCNAMENonEmpty.json">
253+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
254+
</None>
222255
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetCrud.json">
223256
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
224257
</None>
@@ -237,15 +270,27 @@
237270
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetGet.json">
238271
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
239272
</None>
240-
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetGetWithEndsWith.json">
273+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetMX.json">
241274
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
242275
</None>
243-
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetMX.json">
276+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetMXNonEmpty.json">
277+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
278+
</None>
279+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetnewAlreadyExists.json">
244280
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
245281
</None>
246282
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetNS.json">
247283
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
248284
</None>
285+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetNSNonEmpty.json">
286+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
287+
</None>
288+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetPTR.json">
289+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
290+
</None>
291+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetPTRNonEmpty.json">
292+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
293+
</None>
249294
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetRemoveRecordTypeMismatch.json">
250295
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
251296
</None>
@@ -255,9 +300,21 @@
255300
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetSRV.json">
256301
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
257302
</None>
303+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetSRVNonEmpty.json">
304+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
305+
</None>
258306
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetTXT.json">
259307
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
260308
</None>
309+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetTXTLegacyLengthValidation.json">
310+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
311+
</None>
312+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetTXTLengthValidation.json">
313+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
314+
</None>
315+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.RecordsTests\TestRecordSetTXTNonEmpty.json">
316+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
317+
</None>
261318
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests\TestZoneCrud.json">
262319
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
263320
</None>
@@ -273,7 +330,10 @@
273330
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests\TestZoneList.json">
274331
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
275332
</None>
276-
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests\TestZoneListWithEndsWith.json">
333+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests\TestZoneListSubscription.json">
334+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
335+
</None>
336+
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests\TestZoneNewAlreadyExists.json">
277337
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
278338
</None>
279339
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.DnsTests.ZoneTests\TestZoneRemoveEtagMismatch.json">

src/ResourceManager/Dns/Commands.Dns.Test/ScenarioTests/Common.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,20 @@ function TestSetup-CreateResourceGroup
6969
$rglocation = Get-ProviderLocation "microsoft.compute"
7070
$resourceGroup = New-AzureRmResourceGroup -Name $resourceGroupName -location $rglocation
7171
return $resourceGroup
72+
}
73+
74+
function Get-RandomZoneName
75+
{
76+
$prefix = getAssetName;
77+
return $prefix + ".pstest.test" ;
78+
}
79+
80+
function Get-TxtOfSpecifiedLength([int] $length)
81+
{
82+
$returnValue = "";
83+
for ($i = 0; $i -lt $length ; $i++)
84+
{
85+
$returnValue += "a";
86+
}
87+
return $returnValue;
7288
}

src/ResourceManager/Dns/Commands.Dns.Test/ScenarioTests/DnsTestsBase.cs

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using System.Collections.Generic;
1516
using Microsoft.Azure.Commands.Common.Authentication;
1617
using Microsoft.Azure.Test.HttpRecorder;
17-
using System.Collections.Generic;
18+
using RestTestFramework = Microsoft.Rest.ClientRuntime.Azure.TestFramework;
1819

1920
namespace Microsoft.Azure.Commands.ScenarioTest.DnsTests
2021
{
@@ -23,23 +24,26 @@ namespace Microsoft.Azure.Commands.ScenarioTest.DnsTests
2324
using Microsoft.Azure.Management.Dns;
2425
using Microsoft.Azure.Management.Resources;
2526
using Microsoft.Azure.Subscriptions;
26-
using Microsoft.Azure.Test;
27+
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2728
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2829
using System;
30+
using System.IO;
2931
using System.Linq;
3032
using WindowsAzure.Commands.Test.Utilities.Common;
33+
using LegacyTest = Microsoft.Azure.Test;
34+
using TestEnvironmentFactory = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
35+
using TestUtilities = Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities;
3136

3237
public class DnsTestsBase : RMTestBase
3338
{
34-
private CSMTestEnvironmentFactory csmTestFactory;
39+
private LegacyTest.CSMTestEnvironmentFactory csmTestFactory;
3540

3641

3742
private readonly EnvironmentSetupHelper helper;
3843

3944

4045
public ResourceManagementClient ResourceManagementClient { get; private set; }
4146

42-
4347
public SubscriptionClient SubscriptionClient { get; private set; }
4448

4549

@@ -67,13 +71,13 @@ protected DnsTestsBase()
6771
}
6872

6973

70-
protected void SetupManagementClients()
74+
protected void SetupManagementClients(MockContext context)
7175
{
7276
this.ResourceManagementClient = this.GetResourceManagementClient();
7377
this.SubscriptionClient = this.GetSubscriptionClient();
7478
this.GalleryClient = this.GetGalleryClient();
7579
this.AuthorizationManagementClient = this.GetAuthorizationManagementClient();
76-
this.DnsClient = this.GetFeatureClient();
80+
this.DnsClient = this.GetFeatureClient(context);
7781

7882

7983
this.helper.SetupManagementClients(
@@ -104,7 +108,7 @@ public void RunPowerShellTest(params string[] scripts)
104108

105109
public void RunPsTestWorkflow(
106110
Func<string[]> scriptBuilder,
107-
Action<CSMTestEnvironmentFactory> initialize,
111+
Action<LegacyTest.CSMTestEnvironmentFactory> initialize,
108112
Action cleanup,
109113
string callingClassType,
110114
string mockName)
@@ -116,13 +120,11 @@ public void RunPsTestWorkflow(
116120
var providersToIgnore = new Dictionary<string, string>();
117121
providersToIgnore.Add("Microsoft.Azure.Management.Resources.ResourceManagementClient", "2016-02-01");
118122
HttpMockServer.Matcher = new PermissiveRecordMatcherWithApiExclusion(true, d, providersToIgnore);
123+
HttpMockServer.RecordsDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionRecords");
119124

120-
using (UndoContext context = UndoContext.Current)
125+
using (MockContext context = MockContext.Start(callingClassType, mockName))
121126
{
122-
context.Start(callingClassType, mockName);
123-
124-
125-
this.csmTestFactory = new CSMTestEnvironmentFactory();
127+
this.csmTestFactory = new LegacyTest.CSMTestEnvironmentFactory();
126128

127129

128130
if (initialize != null)
@@ -131,7 +133,7 @@ public void RunPsTestWorkflow(
131133
}
132134

133135

134-
this.SetupManagementClients();
136+
this.SetupManagementClients(context);
135137

136138

137139
this.helper.SetupEnvironment(AzureModule.AzureResourceManager);
@@ -171,34 +173,29 @@ public void RunPsTestWorkflow(
171173
}
172174
}
173175

174-
175176
protected ResourceManagementClient GetResourceManagementClient()
176177
{
177-
return TestBase.GetServiceClient<ResourceManagementClient>(this.csmTestFactory);
178+
return LegacyTest.TestBase.GetServiceClient<ResourceManagementClient>(this.csmTestFactory);
178179
}
179180

180-
181181
private AuthorizationManagementClient GetAuthorizationManagementClient()
182182
{
183-
return TestBase.GetServiceClient<AuthorizationManagementClient>(this.csmTestFactory);
183+
return LegacyTest.TestBase.GetServiceClient<AuthorizationManagementClient>(this.csmTestFactory);
184184
}
185185

186-
187186
private SubscriptionClient GetSubscriptionClient()
188187
{
189-
return TestBase.GetServiceClient<SubscriptionClient>(this.csmTestFactory);
188+
return LegacyTest.TestBase.GetServiceClient<SubscriptionClient>(this.csmTestFactory);
190189
}
191190

192-
193191
private GalleryClient GetGalleryClient()
194192
{
195-
return TestBase.GetServiceClient<GalleryClient>(this.csmTestFactory);
193+
return LegacyTest.TestBase.GetServiceClient<GalleryClient>(this.csmTestFactory);
196194
}
197195

198-
199-
private DnsManagementClient GetFeatureClient()
196+
private DnsManagementClient GetFeatureClient(MockContext context)
200197
{
201-
return TestBase.GetServiceClient<DnsManagementClient>(this.csmTestFactory);
198+
return context.GetServiceClient<DnsManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
202199
}
203200
}
204201
}

0 commit comments

Comments
 (0)