- Notifications
You must be signed in to change notification settings - Fork2.9k
test/system: Fix the IPv6 address mismatch error#27623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
For IPv6 addresses within the same scope group, Linux kernel preservesinsertion order, where the first inserted address appears last. As aresult, the ordering inside pasta differs from the host, causing atest to fail when they compare only the first address on each side.Fix this by checking that the container’s first address matches any ofthe host’s addresses.Signed-off-by: Yumei Huang <yuhuang@redhat.com>
Honny1 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks, LGTM.
PTAL@Luap99
[APPROVALNOTIFIER] This PR isAPPROVED This pull-request has been approved by:Honny1,huangyum The full list of commands accepted by this bot can be foundhere. The pull request process is describedhere Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Luap99 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| echo"${host_addresses}"| grep -qw"${container_address}" | ||
| assert$? -eq 0"Container address not matching host" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
can't you just useassert "${host_addresses}" =~ "${container_address}"?
Right this the assert for exit code is unnecessary as the command run with set -e meaining if the grep fails it exits right away without reaching the exit code check anyway.
And then then generally leads to a poor error message compared to our assert helper.
| local ifname="${2:-$(default_ifname"${ip_ver}")}" | ||
| local expr='[.[0].addr_info[] | select(.deprecated != true)]' | ||
| ip -j -"${ip_ver}" addr show"${ifname}"| jq -rM"${expr}"| greplocal| cut -d'"' -f4| tr'\n''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why all this grep, cur, tr thing? If we only want the local addresses we can just add them to the jq filter.
'[.[0].addr_info[] | select(.deprecated != true)].[].local'which seems to return the same result unless I am missing something
sbrivio-rh commentedNov 29, 2025
Thanks@Luap99 for the Cc:, I wasn't aware of this. This comes fromhttps://bugs.passt.top/show_bug.cgi?id=175#c12 by the way. I'll review it, I have some comments on top of what you already mentioned. |
sbrivio-rh commentedNov 29, 2025
Do we have a way to block merges for given paths if a given reviewer didn't have the chance to check yet? Or at least something like the Linux kernel's Otherwise these changes risk just being LGTMed away. I'm not sure if anything automated is feasible / worth the effort though. |
Uh oh!
There was an error while loading.Please reload this page.
For IPv6 addresses within the same scope group, Linux kernel preserves insertion order, where the first inserted address appears last. As a result, the ordering inside pasta differs from the host, causing a test to fail when they compare only the first address on each side. Fix this by checking that the container’s first address matches any of the host’s addresses.
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. SeeCONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
None