Skip to content

Update test for test-ConnectivityTroubleshoot #6286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void TestFlowLog()
NetworkResourcesController.NewInstance.RunPsTest("Test-FlowLog");
}

[Fact(Skip = "Test is failing due to design changes. Service team is going to re-record and submit it.")]
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(Category.Owner, Category.netanalyticsdev)]
public void TestConnectivityCheck()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,18 +600,21 @@ function Test-ConnectivityCheck
# Create Network Watcher
$nw = New-AzureRmNetworkWatcher -Name $nwName -ResourceGroupName $nwRgName -Location $location

#Get Vm
# Get Vm
$vm = Get-AzureRmVM -ResourceGroupName $resourceGroupName

#Install networkWatcherAgent on Vm
# Install networkWatcherAgent on Vm
Set-AzureRmVMExtension -ResourceGroupName "$resourceGroupName" -Location "$location" -VMName $vm.Name -Name "MyNetworkWatcherAgent" -Type "NetworkWatcherAgentWindows" -TypeHandlerVersion "1.4" -Publisher "Microsoft.Azure.NetworkWatcher"

#Connectivity check
$job = Test-AzureRmNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationAddress "bing.com" -DestinationPort 80 -AsJob
# Set up protocol configuration
$config = New-AzureRMNetworkWatcherProtocolConfiguration -Protocol "Http" -Method "Get" -Header @{"accept"="application/json"} -ValidStatusCode @(200,202,204)

# Connectivity check
$job = Test-AzureRmNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationAddress "bing.com" -DestinationPort 80 -ProtocolConfiguration $config -AsJob
$job | Wait-Job
$check = $job | Receive-Job

#Verification
# Verification
Assert-AreEqual $check.ConnectionStatus "Reachable"
Assert-AreEqual $check.ProbesFailed 0
Assert-AreEqual $check.Hops.Count 2
Expand Down

Large diffs are not rendered by default.