Skip to content

Commit 3d73567

Browse files
committed
Update expectation to account for both ipv 4 and 6
This commit updates the test expectation to handle both ipv4 and ipv6 loopback addresses. Both forms appear to be present across the test matrix. This should allow us to maintain the compatability regarless of the representation of the loopback address.
1 parent d1b1aba commit 3d73567

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/inputs/tcp_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def get_port
9090
aggregate_failures("event #{i}") do
9191
expect(event.get("message")).to eq("#{i} ☹")
9292
expect(event.get(ecs_select[disabled: "host", v1: "[@metadata][input][tcp][source][name]"])).to eq("localhost").or eq("ip6-localhost")
93-
expect(event.get(ecs_select[disabled: "[@metadata][ip_address]", v1: "[@metadata][input][tcp][source][ip]"])).to eq('127.0.0.1')
93+
ip_address = event.get(ecs_select[disabled: "[@metadata][ip_address]", v1: "[@metadata][input][tcp][source][ip]"])
94+
# Account for both ipv4 or ipv6 localhost
95+
expect(["127.0.0.1", "::1", "0:0:0:0:0:0:0:1"]).to include(ip_address)
9496
end
9597
end
9698
end

0 commit comments

Comments
 (0)