Skip to content

Instantly share code, notes, and snippets.

@Jaykul
Created August 9, 2019 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jaykul/444d1ec56b52ecfacd78d826689ad577 to your computer and use it in GitHub Desktop.
Save Jaykul/444d1ec56b52ecfacd78d826689ad577 to your computer and use it in GitHub Desktop.
A test for our environments, to make sure NAT worked
Describe "Outbound traffic from App Servers should be load balanced" {
$Servers = Invoke-Command -Cn ($Env:COMPUTERNAME -replace "MGT", "DC") {
Get-ADComputer -Filter * | Where-Object Name -notmatch "SQL|DB|ETL|Cluster|DC" | Select-Object -ExpandProperty Name
}
It "Appears all traffic comes from a single IP Address" {
$IPs = Invoke-Command -EnableNetworkAccess -Cn $Servers { Invoke-RestMethod http://ipinfo.io/json }
$Servers.Count | Should -BeGreaterThan 4
$Ips.Count | Should -Be $Servers.Count
@($IPs | Select-Object ip -Unique).Count | Should -Be 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment