Created
August 9, 2019 15:54
-
-
Save Jaykul/444d1ec56b52ecfacd78d826689ad577 to your computer and use it in GitHub Desktop.
A test for our environments, to make sure NAT worked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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