Skip to content

Commit 6699f42

Browse files
authored
NFSAAS-1707 update from review comments (#11)
1 parent abd3e3c commit 6699f42

File tree

30 files changed

+2999
-2774
lines changed

30 files changed

+2999
-2774
lines changed

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/SnapshotTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-SnapshotCrud
2121
$currentSub = (Get-AzureRmContext).Subscription
2222
$subsid = $currentSub.SubscriptionId
2323

24-
$resourceGroup = "pws-sdk-tests-rg-1"
24+
$resourceGroup = "pws-sdk-tests-rg-2"
2525
$accName = "pws-sdk-acc-2"
2626
$poolName = "pws-sdk-pool-1"
2727
$volName = "pws-sdk-vol-1"
@@ -30,7 +30,7 @@ function Test-SnapshotCrud
3030
$gibibyte = 1024 * 1024 * 1024
3131
$usageThreshold = 100 * $gibibyte
3232
$doubleUsage = 2 * $usageThreshold
33-
$resourceLocation = "westus2"
33+
$resourceLocation = "eastus"
3434
$subnetName = "default"
3535
$standardPoolSize = 4398046511104
3636
$serviceLevel = "Premium"
@@ -115,7 +115,7 @@ function Test-SnapshotPipelines
115115
$gibibyte = 1024 * 1024 * 1024
116116
$usageThreshold = 100 * $gibibyte
117117
$doubleUsage = 2 * $usageThreshold
118-
$resourceLocation = "westus2"
118+
$resourceLocation = "eastus"
119119
$subnetName = "default"
120120
$poolSize = 4398046511104
121121
$serviceLevel = "Premium"

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/TestController.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
using Microsoft.Azure.Management.NetApp;
2222
using Microsoft.Azure.Management.Internal.Resources;
2323
using Microsoft.Azure.Test.HttpRecorder;
24-
using Microsoft.Azure.Management.Network;
24+
using SDKNetwork = Microsoft.Azure.Management.Network;
2525
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
2626
using Microsoft.WindowsAzure.Commands.ScenarioTest;
2727
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
@@ -35,7 +35,7 @@ public class TestController : RMTestBase
3535

3636
public ResourceManagementClient ResourceManagementClient { get; private set; }
3737

38-
public NetworkManagementClient NetworkClient { get; private set; }
38+
public SDKNetwork.NetworkManagementClient SDKNetworkClient { get; private set; }
3939

4040
public AzureNetAppFilesManagementClient NetAppFilesManagementClient { get; private set; }
4141

@@ -50,11 +50,11 @@ protected void SetupManagementClients(MockContext context)
5050
{
5151
ResourceManagementClient = GetResourceManagementClient(context);
5252
NetAppFilesManagementClient = GetNetAppFilesManagementClient(context);
53-
NetworkClient = GetNetworkClient(context);
53+
SDKNetworkClient = GetSDKNetworkClient(context);
5454

5555
_helper.SetupManagementClients(
5656
ResourceManagementClient,
57-
NetworkClient,
57+
SDKNetworkClient,
5858
NetAppFilesManagementClient);
5959
}
6060

@@ -125,14 +125,14 @@ public void RunPsTestWorkflow(
125125
}
126126
}
127127

128-
protected ResourceManagementClient GetResourceManagementClient(MockContext context)
128+
protected SDKNetwork.NetworkManagementClient GetSDKNetworkClient(MockContext context)
129129
{
130-
return context.GetServiceClient<ResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
130+
return context.GetServiceClient<SDKNetwork.NetworkManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
131131
}
132132

133-
protected NetworkManagementClient GetNetworkClient(MockContext context)
133+
protected ResourceManagementClient GetResourceManagementClient(MockContext context)
134134
{
135-
return context.GetServiceClient<NetworkManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
135+
return context.GetServiceClient<ResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
136136
}
137137

138138
private static AzureNetAppFilesManagementClient GetNetAppFilesManagementClient(MockContext context)

src/NetAppFiles/NetAppFiles.Test/ScenarioTests/VolumeTests.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Test-VolumeCrud
2121
$currentSub = (Get-AzureRmContext).Subscription
2222
$subsid = $currentSub.SubscriptionId
2323

24-
$resourceGroup = "pws-sdk-tests-rg-1"
24+
$resourceGroup = "pws-sdk-tests-rg-2"
2525
$accName = "pws-sdk-acc-1"
2626
$poolName = "pws-sdk-pool-1"
2727
$volName1 = "pws-sdk-vol-1"
@@ -30,7 +30,7 @@ function Test-VolumeCrud
3030
$gibibyte = 1024 * 1024 * 1024
3131
$usageThreshold = 100 * $gibibyte
3232
$doubleUsage = 2 * $usageThreshold
33-
$resourceLocation = "westus2"
33+
$resourceLocation = "eastus"
3434
$subnetName = "default"
3535
$poolSize = 4398046511104
3636
$serviceLevel = "Premium"
@@ -118,14 +118,14 @@ function Test-VolumePipelines
118118
$currentSub = (Get-AzureRmContext).Subscription
119119
$subsid = $currentSub.SubscriptionId
120120

121-
$resourceGroup = "pws-sdk-tests-rg-1"
121+
$resourceGroup = "pws-sdk-tests-rg-2"
122122
$accName = "pws-sdk-acc-1"
123123
$poolName = "pws-sdk-pool-1"
124124
$volName1 = "pws-sdk-vol-1"
125125
$gibibyte = 1024 * 1024 * 1024
126126
$usageThreshold = 100 * $gibibyte
127127
$doubleUsage = 2 * $usageThreshold
128-
$resourceLocation = "westus2"
128+
$resourceLocation = "eastus"
129129
$subnetName = "default"
130130
$poolSize = 4398046511104
131131
$serviceLevel = "Premium"
@@ -154,9 +154,10 @@ function Test-VolumePipelines
154154
Assert-AreEqual "$accName/$poolName/$volName1" $retrievedVolume.Name
155155

156156
# modify volume by piping from volume
157-
$retrievedVolume = Get-AnfVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -Name $volName1 | Update-AnfVolume -ServiceLevel "Standard"
158-
Assert-AreEqual "Standard" $retrievedVolume.ServiceLevel
159-
157+
$retrievedVolume = Get-AnfVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -Name $volName1 | Update-AnfVolume -UsageThreshold $doubleUsage
158+
Assert-AreEqual "Premium" $retrievedVolume.ServiceLevel # unchanged/not part of the patch
159+
Assert-AreEqual $doubleUsage $retrievedVolume.usageThreshold
160+
160161
# delete the volumes by piping from volume get
161162
Get-AnfVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -Name $volName1 | Remove-AnfVolume
162163

0 commit comments

Comments
 (0)