Skip to content

CI: update tests to be more resilient against CLI output format and for libnetwork changes#42050

Merged
tiborvass merged 3 commits into
moby:masterfrom
thaJeztah:ci_fixes
Mar 24, 2021
Merged

CI: update tests to be more resilient against CLI output format and for libnetwork changes#42050
tiborvass merged 3 commits into
moby:masterfrom
thaJeztah:ci_fixes

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Feb 19, 2021

Copy link
Copy Markdown
Member

relates to / in preparation of #41908 ("vendor: docker/libnetwork b3507428be5b458cb0e2b4086b13531fb0706e46")

integration/container: wrap some long lines for readability

Just some minor code-style changes for readability

integration: update getExternalAddress to prefer IPv4

Rootlesskit doesn't currently handle IPv6 addresses, causing TestNetworkLoopbackNat and TestNetworkNat to fail;

Error starting userland proxy:
error while calling PortManager.AddPort(): listen tcp: address :::8080: too many colons in address

This patch:

  • Updates getExternalAddress() to pick IPv4 address if both IPv6 and IPv4 are found
  • Update TestNetworkNat to net.JoinHostPort(), so that square brackets are used for IPv6 addresses (e.g. [::]:8080)

integration-cli: rely less on "docker port" output format

Also re-formatting some lines for readability.

@thaJeztah

Copy link
Copy Markdown
Member Author

@AkihiroSuda this one LGTY? (you LGTM'd #41908 some time back, which also had these changes)

Comment thread integration-cli/docker_cli_port_test.go Outdated
Comment on lines 164 to 165

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussing with @tonistiigi - making this slightly more strict (only replace first [ and ] before port number

Rootlesskit doesn't currently handle IPv6 addresses, causing TestNetworkLoopbackNat
and TestNetworkNat to fail;

    Error starting userland proxy:
    error while calling PortManager.AddPort(): listen tcp: address :::8080: too many colons in address

This patch:

- Updates `getExternalAddress()` to pick IPv4 address if both IPv6 and IPv4 are found
- Update TestNetworkNat to net.JoinHostPort(), so that square brackets are used for
  IPv6 addresses (e.g. `[::]:8080`)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Also re-formatting some lines for readability.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants