Skip to content

Commit

Permalink
fix test namespace (Azure#23755)
Browse files Browse the repository at this point in the history
fix wait for completion in base test class
add bastion host create test
  • Loading branch information
m-nash authored Sep 8, 2021
1 parent ed1a5ba commit 56f2c96
Show file tree
Hide file tree
Showing 53 changed files with 175,458 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected void CleanupResourceGroups()
try
{
var sub = _cleanupClient.GetSubscriptions().GetIfExists(TestEnvironment.SubscriptionId);
sub.Value?.GetResourceGroups().Get(resourceGroup).Value.Delete();
sub.Value?.GetResourceGroups().Get(resourceGroup).Value.Delete(waitForCompletion: false);
}
catch (RequestFailedException e) when (e.Status == 404)
{
Expand All @@ -117,7 +117,7 @@ protected void CleanupResourceGroups()
{
try
{
_cleanupClient.GetManagementGroup(mgmtGroupId).Delete();
_cleanupClient.GetManagementGroup(mgmtGroupId).Delete(waitForCompletion: false);
}
catch (RequestFailedException e) when (e.Status == 404 || e.Status == 403)
{
Expand Down Expand Up @@ -202,11 +202,11 @@ public void OneTimeCleanupResourceGroups()
Parallel.ForEach(OneTimeResourceGroupCleanupPolicy.ResourceGroupsCreated, resourceGroup =>
{
var sub = _cleanupClient.GetSubscriptions().GetIfExists(SessionEnvironment.SubscriptionId);
sub.Value?.GetResourceGroups().Get(resourceGroup).Value.Delete();
sub.Value?.GetResourceGroups().Get(resourceGroup).Value.Delete(waitForCompletion: false);
});
Parallel.ForEach(OneTimeManagementGroupCleanupPolicy.ManagementGroupsCreated, mgmtGroupId =>
{
_cleanupClient.GetManagementGroup(mgmtGroupId).Delete();
_cleanupClient.GetManagementGroup(mgmtGroupId).Delete(waitForCompletion: false);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Resources.Models;
using Azure.ResourceManager.Network.Models;
using Azure.ResourceManager.Network.Tests.Tests;
using Azure.ResourceManager.TestFramework;

using NUnit.Framework;

namespace Azure.ResourceManager.Network.Tests.Helpers
{
[RunFrequency(RunTestFrequency.Manually)]
public class NetworkServiceClientTestBase : ManagementRecordedTestBase<NetworkManagementTestEnvironment>
{
private const string dummySSHKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com";
public NetworkServiceClientTestBase(bool isAsync) : base(isAsync)
{
}

public NetworkServiceClientTestBase(bool isAsync, RecordedTestMode mode) : base(isAsync, mode)
{
}

public bool IsTestTenant = false;
public static TimeSpan ZeroPollingInterval { get; } = TimeSpan.FromSeconds(0);
public Dictionary<string, string> Tags { get; internal set; }
Expand Down
Loading

0 comments on commit 56f2c96

Please sign in to comment.