From 44eaf330564974723a2f0d7ad35ad333f2adc300 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Thu, 17 Mar 2016 01:27:16 +0100 Subject: [PATCH] api/endpoints/util: Add some IPv6 address testcases Signed-off-by: Thomas Graf --- pkg/api/endpoints/util_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/api/endpoints/util_test.go b/pkg/api/endpoints/util_test.go index a2f960317df..7e003e66dd7 100644 --- a/pkg/api/endpoints/util_test.go +++ b/pkg/api/endpoints/util_test.go @@ -66,6 +66,16 @@ func TestPackSubsets(t *testing.T) { Addresses: []api.EndpointAddress{{IP: "1.2.3.4"}}, Ports: []api.EndpointPort{{Port: 111}}, }}, + }, { + name: "one set, one ip, one port (IPv6)", + given: []api.EndpointSubset{{ + Addresses: []api.EndpointAddress{{IP: "beef::1:2:3:4"}}, + Ports: []api.EndpointPort{{Port: 111}}, + }}, + expect: []api.EndpointSubset{{ + Addresses: []api.EndpointAddress{{IP: "beef::1:2:3:4"}}, + Ports: []api.EndpointPort{{Port: 111}}, + }}, }, { name: "one set, one notReady ip, one port", given: []api.EndpointSubset{{ @@ -169,6 +179,16 @@ func TestPackSubsets(t *testing.T) { Addresses: []api.EndpointAddress{{IP: "1.2.3.4"}}, Ports: []api.EndpointPort{{Port: 111}}, }}, + }, { + name: "one set, dup ips, one port (IPv6)", + given: []api.EndpointSubset{{ + Addresses: []api.EndpointAddress{{IP: "beef::1"}, {IP: "beef::1"}}, + Ports: []api.EndpointPort{{Port: 111}}, + }}, + expect: []api.EndpointSubset{{ + Addresses: []api.EndpointAddress{{IP: "beef::1"}}, + Ports: []api.EndpointPort{{Port: 111}}, + }}, }, { name: "one set, dup ips with target-refs, one port", given: []api.EndpointSubset{{