Skip to content

Commit

Permalink
NFSAAS-1707 update from review comments (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardbf authored Mar 25, 2019
1 parent abd3e3c commit 6699f42
Show file tree
Hide file tree
Showing 30 changed files with 2,999 additions and 2,774 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Test-SnapshotCrud
$currentSub = (Get-AzureRmContext).Subscription
$subsid = $currentSub.SubscriptionId

$resourceGroup = "pws-sdk-tests-rg-1"
$resourceGroup = "pws-sdk-tests-rg-2"
$accName = "pws-sdk-acc-2"
$poolName = "pws-sdk-pool-1"
$volName = "pws-sdk-vol-1"
Expand All @@ -30,7 +30,7 @@ function Test-SnapshotCrud
$gibibyte = 1024 * 1024 * 1024
$usageThreshold = 100 * $gibibyte
$doubleUsage = 2 * $usageThreshold
$resourceLocation = "westus2"
$resourceLocation = "eastus"
$subnetName = "default"
$standardPoolSize = 4398046511104
$serviceLevel = "Premium"
Expand Down Expand Up @@ -115,7 +115,7 @@ function Test-SnapshotPipelines
$gibibyte = 1024 * 1024 * 1024
$usageThreshold = 100 * $gibibyte
$doubleUsage = 2 * $usageThreshold
$resourceLocation = "westus2"
$resourceLocation = "eastus"
$subnetName = "default"
$poolSize = 4398046511104
$serviceLevel = "Premium"
Expand Down
16 changes: 8 additions & 8 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/TestController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using Microsoft.Azure.Management.NetApp;
using Microsoft.Azure.Management.Internal.Resources;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Azure.Management.Network;
using SDKNetwork = Microsoft.Azure.Management.Network;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
Expand All @@ -35,7 +35,7 @@ public class TestController : RMTestBase

public ResourceManagementClient ResourceManagementClient { get; private set; }

public NetworkManagementClient NetworkClient { get; private set; }
public SDKNetwork.NetworkManagementClient SDKNetworkClient { get; private set; }

public AzureNetAppFilesManagementClient NetAppFilesManagementClient { get; private set; }

Expand All @@ -50,11 +50,11 @@ protected void SetupManagementClients(MockContext context)
{
ResourceManagementClient = GetResourceManagementClient(context);
NetAppFilesManagementClient = GetNetAppFilesManagementClient(context);
NetworkClient = GetNetworkClient(context);
SDKNetworkClient = GetSDKNetworkClient(context);

_helper.SetupManagementClients(
ResourceManagementClient,
NetworkClient,
SDKNetworkClient,
NetAppFilesManagementClient);
}

Expand Down Expand Up @@ -125,14 +125,14 @@ public void RunPsTestWorkflow(
}
}

protected ResourceManagementClient GetResourceManagementClient(MockContext context)
protected SDKNetwork.NetworkManagementClient GetSDKNetworkClient(MockContext context)
{
return context.GetServiceClient<ResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
return context.GetServiceClient<SDKNetwork.NetworkManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

protected NetworkManagementClient GetNetworkClient(MockContext context)
protected ResourceManagementClient GetResourceManagementClient(MockContext context)
{
return context.GetServiceClient<NetworkManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
return context.GetServiceClient<ResourceManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
}

private static AzureNetAppFilesManagementClient GetNetAppFilesManagementClient(MockContext context)
Expand Down
15 changes: 8 additions & 7 deletions src/NetAppFiles/NetAppFiles.Test/ScenarioTests/VolumeTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Test-VolumeCrud
$currentSub = (Get-AzureRmContext).Subscription
$subsid = $currentSub.SubscriptionId

$resourceGroup = "pws-sdk-tests-rg-1"
$resourceGroup = "pws-sdk-tests-rg-2"
$accName = "pws-sdk-acc-1"
$poolName = "pws-sdk-pool-1"
$volName1 = "pws-sdk-vol-1"
Expand All @@ -30,7 +30,7 @@ function Test-VolumeCrud
$gibibyte = 1024 * 1024 * 1024
$usageThreshold = 100 * $gibibyte
$doubleUsage = 2 * $usageThreshold
$resourceLocation = "westus2"
$resourceLocation = "eastus"
$subnetName = "default"
$poolSize = 4398046511104
$serviceLevel = "Premium"
Expand Down Expand Up @@ -118,14 +118,14 @@ function Test-VolumePipelines
$currentSub = (Get-AzureRmContext).Subscription
$subsid = $currentSub.SubscriptionId

$resourceGroup = "pws-sdk-tests-rg-1"
$resourceGroup = "pws-sdk-tests-rg-2"
$accName = "pws-sdk-acc-1"
$poolName = "pws-sdk-pool-1"
$volName1 = "pws-sdk-vol-1"
$gibibyte = 1024 * 1024 * 1024
$usageThreshold = 100 * $gibibyte
$doubleUsage = 2 * $usageThreshold
$resourceLocation = "westus2"
$resourceLocation = "eastus"
$subnetName = "default"
$poolSize = 4398046511104
$serviceLevel = "Premium"
Expand Down Expand Up @@ -154,9 +154,10 @@ function Test-VolumePipelines
Assert-AreEqual "$accName/$poolName/$volName1" $retrievedVolume.Name

# modify volume by piping from volume
$retrievedVolume = Get-AnfVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -Name $volName1 | Update-AnfVolume -ServiceLevel "Standard"
Assert-AreEqual "Standard" $retrievedVolume.ServiceLevel

$retrievedVolume = Get-AnfVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -Name $volName1 | Update-AnfVolume -UsageThreshold $doubleUsage
Assert-AreEqual "Premium" $retrievedVolume.ServiceLevel # unchanged/not part of the patch
Assert-AreEqual $doubleUsage $retrievedVolume.usageThreshold

# delete the volumes by piping from volume get
Get-AnfVolume -ResourceGroupName $resourceGroup -AccountName $accName -PoolName $poolName -Name $volName1 | Remove-AnfVolume

Expand Down
Loading

0 comments on commit 6699f42

Please sign in to comment.