From d9c9420335a78b54bc04ec0639d89539b4c3972c Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Sun, 14 Jun 2020 22:40:46 -0700 Subject: ip6tables testing We skip gVisor tests for now, as ip6tables aren't yet implemented. --- pkg/test/dockerutil/container.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/test/dockerutil/container.go b/pkg/test/dockerutil/container.go index b59503188..441173ec2 100644 --- a/pkg/test/dockerutil/container.go +++ b/pkg/test/dockerutil/container.go @@ -360,13 +360,18 @@ func (c *Container) SandboxPid(ctx context.Context) (int, error) { } // FindIP returns the IP address of the container. -func (c *Container) FindIP(ctx context.Context) (net.IP, error) { +func (c *Container) FindIP(ctx context.Context, ipv6 bool) (net.IP, error) { resp, err := c.client.ContainerInspect(ctx, c.id) if err != nil { return nil, err } - ip := net.ParseIP(resp.NetworkSettings.DefaultNetworkSettings.IPAddress) + var ip net.IP + if ipv6 { + ip = net.ParseIP(resp.NetworkSettings.DefaultNetworkSettings.GlobalIPv6Address) + } else { + ip = net.ParseIP(resp.NetworkSettings.DefaultNetworkSettings.IPAddress) + } if ip == nil { return net.IP{}, fmt.Errorf("invalid IP: %q", ip) } -- cgit v1.2.3