ADBDEV-6534: Fix IPv6 checking in cdbsenddummypacket unit test #1102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix IPv6 checking in cdbsenddummypacket unit test
cdbsenddummypacket unit test checks for IPv6 availability to skip IPv6-related
tests. However, the checking was not sufficient since if IPv6 is present in
the system but disabled. In that case
socket()
succeeds, causing the test tobelieve IPv6 is available, but later
bind()
fails witherrno = EADDRNOTAVAIL
.This patch fixes the test failing by implementing a more detailed check for
IPv6 availability. This is only necessary for manual runs of this test since
CI pipeline already has IPv6 enabled.
Note: commit b9cb522 is related, but the
complicated IPv6 check there is only necessary because it was used for regular
GPDB operation, requiring it to check non-loopback addresses too. This is not
necessary here because the tests only need loopback IPv6 address to pass, not
full IPv6 support.
To test manually, disable IPv6 on the host machine or run this inside a Docker container with IPv6 disabled. For example, on Ubuntu: