From 0c1dd0e75bd3d33567c40b2cdf3b5af07792498b Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Thu, 26 Mar 2020 11:33:44 -0400 Subject: [PATCH] fixup! tests: Add tests for EC2 Metadata immitation cases --- client/fingerprint/env_aws_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/fingerprint/env_aws_test.go b/client/fingerprint/env_aws_test.go index 379e4ae5d..8ab53af05 100644 --- a/client/fingerprint/env_aws_test.go +++ b/client/fingerprint/env_aws_test.go @@ -180,8 +180,8 @@ func TestNetworkFingerprint_AWS_NoNetwork(t *testing.T) { require.Nil(t, response.NodeResources) } -func TestNetworkFingerprint_AWS_IncompleteImmitation(t *testing.T) { - endpoint, cleanup := startFakeEC2Metadata(t, incompleteAWSImmitationStubs) +func TestNetworkFingerprint_AWS_IncompleteImitation(t *testing.T) { + endpoint, cleanup := startFakeEC2Metadata(t, incompleteAWSImitationStubs) defer cleanup() f := NewEnvAWSFingerprint(testlog.HCLogger(t)) @@ -222,9 +222,9 @@ type routes struct { } type endpoint struct { - Uri string - ContentType string - Body string + Uri string `json:"uri"` + ContentType string `json:"content-type"` + Body string `json:"body"` } // awsStubs mimics normal EC2 instance metadata @@ -326,9 +326,9 @@ var noNetworkAWSStubs = []endpoint{ }, } -// incompleteAWSImmitationsStub mimics environments where some AWS endpoints +// incompleteAWSImitationsStub mimics environments where some AWS endpoints // return empty, namely Hetzner -var incompleteAWSImmitationStubs = []endpoint{ +var incompleteAWSImitationStubs = []endpoint{ { Uri: "/latest/meta-data/hostname", ContentType: "text/plain",