Skip to content

Commit

Permalink
Move expected status definition up
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Schwartz committed Jan 28, 2021
1 parent c6a4dcb commit 7bb30b3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ func TestRestrictedAddresses(t *testing.T) {
"[fc00::1]:54321",
}

expectedStatus := []string{
"ERR_ADDRESS_INVALID",
"ERR_ADDRESS_INVALID",
"ERR_ADDRESS_PRIVATE",
"ERR_ADDRESS_PRIVATE",
}

for _, address := range addresses {
conn, err := client.DialTCP(nil, address)
require.NoError(t, err, "Failed to dial %v", address)
Expand All @@ -213,13 +220,7 @@ func TestRestrictedAddresses(t *testing.T) {
}

proxy.GracefulStop()

assert.ElementsMatch(t, testMetrics.statuses, []string{
"ERR_ADDRESS_INVALID",
"ERR_ADDRESS_INVALID",
"ERR_ADDRESS_PRIVATE",
"ERR_ADDRESS_PRIVATE",
})
assert.ElementsMatch(t, testMetrics.statuses, expectedStatus)
}

// Metrics about one UDP packet.
Expand Down

0 comments on commit 7bb30b3

Please sign in to comment.