From 7bb30b38b9b716154bd73a26d5d7b6ab07758346 Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Thu, 28 Jan 2021 13:54:12 -0500 Subject: [PATCH] Move expected status definition up --- integration_test/integration_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/integration_test/integration_test.go b/integration_test/integration_test.go index 906d854c..de674e7e 100644 --- a/integration_test/integration_test.go +++ b/integration_test/integration_test.go @@ -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) @@ -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.