Skip to content

Commit bcfff4f

Browse files
authored
Merge pull request Azure#9521 from EvgenyAgafonchikov/test-fix
Fixed tests failing in live mode
2 parents 78da0d0 + 3a21026 commit bcfff4f

File tree

10 files changed

+4213
-3328
lines changed

10 files changed

+4213
-3328
lines changed

src/Network/Network.Test/ScenarioTests/AvailablePrivateEndpointTypeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public AvailablePrivateEndpointTypeTests(Xunit.Abstractions.ITestOutputHelper ou
2727

2828
[Fact(Skip = "TODO: record")]
2929
[Trait(Category.AcceptanceType, Category.CheckIn)]
30-
[Trait(Category.Owner, NrpTeamAlias.wanrpdev)]
30+
[Trait(Category.Owner, NrpTeamAlias.sdnnrp)]
3131
public void TestAvailablePrivateEndpointTypeCRUD()
3232
{
3333
TestRunner.RunTestScript("Test-AvailablePrivateEndpointTypeCRUD");

src/Network/Network.Test/ScenarioTests/NetworkCloudExceptionTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function Test-NotFound
3030
New-AzResourceGroup -Name $rgName -Location $location
3131

3232
# Get PublicIpAddress that doesn't exist
33-
Assert-ThrowsLike { $ip = Get-AzPublicIpAddress -ResourceGroupName $rgName -Name $resourceName } "*was not found.*StatusCode:*404*ReasonPhrase:*Not Found*OperationID :*";
33+
Assert-ThrowsLike { $ip = Get-AzPublicIpAddress -ResourceGroupName $rgName -Name $resourceName } "*was not found.*";
3434
}
3535
finally
3636
{
@@ -57,7 +57,7 @@ function Test-InvalidName
5757
# Create the resource group
5858
New-AzResourceGroup -Name $rgName -Location $location
5959

60-
Assert-ThrowsLike { $ip = New-AzPublicIpAddress -ResourceGroupName $rgName -Name $resourceInvalidName -Location $location -AllocationMethod Dynamic } "*Resource name ! is invalid.*StatusCode: 400*ReasonPhrase: Bad Request*OperationID :*";
60+
Assert-ThrowsLike { $ip = New-AzPublicIpAddress -ResourceGroupName $rgName -Name $resourceInvalidName -Location $location -AllocationMethod Dynamic } "*Resource name ! is invalid.*";
6161
}
6262
finally
6363
{
@@ -89,7 +89,7 @@ function Test-DuplicateResource
8989
$subnet = New-AzVirtualNetworkSubnetConfig -Name $resourceName -AddressPrefix $subnetAddressPrefix
9090
$vnet = New-AzVirtualNetwork -ResourceGroupName $rgName -Name $resourceName -Location $location -AddressPrefix $vnetAddressPrefix -Subnet $subnet
9191
$vnet.Subnets.Add($subnet);
92-
Assert-ThrowsLike { Set-AzVirtualNetwork -VirtualNetwork $vnet } "*Cannot parse the request.*StatusCode: 400*ReasonPhrase: Bad Request*OperationID*";
92+
Assert-ThrowsLike { Set-AzVirtualNetwork -VirtualNetwork $vnet } "*Cannot parse the request.*";
9393
}
9494
finally
9595
{
@@ -121,7 +121,7 @@ function Test-IntersectAddressSpace
121121
$subnet = New-AzVirtualNetworkSubnetConfig -Name $resourceName -AddressPrefix $subnetAddressPrefix
122122
$vnet = New-AzVirtualNetwork -ResourceGroupName $rgName -Name $resourceName -Location $location -AddressPrefix $vnetAddressPrefix -Subnet $subnet
123123
Add-AzVirtualNetworkSubnetConfig -Name "${resourceName}2" -AddressPrefix $subnetAddressPrefix -VirtualNetwork $vnet
124-
Assert-ThrowsLike { Set-AzVirtualNetwork -VirtualNetwork $vnet } "*Subnet*is not valid in virtual network*StatusCode: 400*ReasonPhrase: Bad Request*OperationID*";
124+
Assert-ThrowsLike { Set-AzVirtualNetwork -VirtualNetwork $vnet } "*Subnet*is not valid in virtual network*";
125125
}
126126
finally
127127
{

src/Network/Network.Test/ScenarioTests/NetworkWatcherAPITests.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ function Test-PacketCapture
505505
Assert-AreEqual $pc1.Filters[0].RemoteIPAddress 127.0.0.1-127.0.0.255
506506
Assert-AreEqual $pc1.Filters[1].LocalIPAddress 127.0.0.1;127.0.0.5
507507
Assert-AreEqual $pc1.StorageLocation.FilePath C:\tmp\Capture.cap
508-
Assert-AreEqual $pcList.Count 2
508+
509+
$currentCount = $pcList.Count;
509510

510511
#Stop packet capture
511512
$job = Stop-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName1 -AsJob
@@ -520,7 +521,7 @@ function Test-PacketCapture
520521

521522
#List packet captures
522523
$pcList = Get-AzNetworkWatcherPacketCapture -NetworkWatcher $nw
523-
Assert-AreEqual $pcList.Count 1
524+
Assert-AreEqual $pcList.Count ($currentCount - 1)
524525

525526
#Remove packet capture
526527
Remove-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName2

src/Network/Network.Test/ScenarioTests/VirtualNetworkTests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function Test-subnetDelegationCRUD
223223
$resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" }
224224

225225
# Create a delegation
226-
$delegation = New-AzDelegation -Name "sqlDelegation" -ServiceName "Microsoft.Sql/servers"
226+
$delegation = New-AzDelegation -Name "sqlDelegation" -ServiceName "Microsoft.Sql/managedInstances"
227227

228228
# Create the Virtual Network
229229
$subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 -delegation $delegation
@@ -253,7 +253,7 @@ function Test-subnetDelegationCRUD
253253
$vnetExpected = Get-AzvirtualNetwork -Name $vnetName -ResourceGroupName $rgname
254254
Assert-AreEqual 2 @($vnetExpected.Subnets).Count
255255
Assert-AreEqual 1 @($vnetExpected.Subnets[0].Delegations).Count
256-
Assert-AreEqual "Microsoft.Sql/servers" $vnetExpected.Subnets[0].Delegations[0].ServiceName
256+
Assert-AreEqual "Microsoft.Sql/managedInstances" $vnetExpected.Subnets[0].Delegations[0].ServiceName
257257
Assert-AreEqual 1 @($vnetExpected.Subnets[1].Delegations).Count
258258
Assert-AreEqual "Microsoft.Netapp/volumes" $vnetExpected.Subnets[1].Delegations[0].ServiceName
259259

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkCloudExceptionTests/TestDuplicateResource.json

Lines changed: 343 additions & 271 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkCloudExceptionTests/TestIntersectAddressSpace.json

Lines changed: 306 additions & 288 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkCloudExceptionTests/TestInvalidName.json

Lines changed: 137 additions & 134 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkCloudExceptionTests/TestNotFound.json

Lines changed: 118 additions & 118 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.NetworkWatcherAPITests/TestPacketCapture.json

Lines changed: 2521 additions & 1811 deletions
Large diffs are not rendered by default.

src/Network/Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.VirtualNetworkTests/TestVirtualNetworkSubnetDelegationCRUD.json

Lines changed: 778 additions & 697 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)