Commit 44eaf330 authored by Thomas Graf's avatar Thomas Graf

api/endpoints/util: Add some IPv6 address testcases

Signed-off-by: 's avatarThomas Graf <tgraf@suug.ch>
parent 865d233a
...@@ -67,6 +67,16 @@ func TestPackSubsets(t *testing.T) { ...@@ -67,6 +67,16 @@ func TestPackSubsets(t *testing.T) {
Ports: []api.EndpointPort{{Port: 111}}, 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", name: "one set, one notReady ip, one port",
given: []api.EndpointSubset{{ given: []api.EndpointSubset{{
NotReadyAddresses: []api.EndpointAddress{{IP: "1.2.3.4"}}, NotReadyAddresses: []api.EndpointAddress{{IP: "1.2.3.4"}},
...@@ -170,6 +180,16 @@ func TestPackSubsets(t *testing.T) { ...@@ -170,6 +180,16 @@ func TestPackSubsets(t *testing.T) {
Ports: []api.EndpointPort{{Port: 111}}, 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", name: "one set, dup ips with target-refs, one port",
given: []api.EndpointSubset{{ given: []api.EndpointSubset{{
Addresses: []api.EndpointAddress{ Addresses: []api.EndpointAddress{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment