-
Notifications
You must be signed in to change notification settings - Fork 183
[rhcos-4.18] kola/testiso: Adapt test for mpath name variations #4357
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rhcos-4.18] kola/testiso: Adapt test for mpath name variations #4357
Conversation
We adjust test to be compatible with both mpath friendly and non-friendly names.
|
Hi @openshift-cherrypick-robot. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
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.
Code Review
This pull request adapts a test for multipath device name variations by replacing a hardcoded device name with a dynamic check. While the intent is correct, the implementation can be made more robust and simpler. I've provided a suggestion to use udevadm to check for multipath properties, which is a more reliable method and aligns with existing patterns in the codebase.
| Type=oneshot | ||
| RemainAfterExit=yes | ||
| ExecStart=/bin/bash -c '[[ $(findmnt -nvro SOURCE /sysroot) == /dev/mapper/mpatha4 ]]' | ||
| ExecStart=/bin/bash -c 'lsblk -pno NAME "/dev/mapper/$(multipath -l -v 1)" | grep -qw "$(findmnt -nvr /sysroot -o SOURCE)"' |
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.
The current command to verify the multipath root is a bit complex and might be brittle. It relies on parsing the output of multipath -l and assumes that lsblk and findmnt will use consistent naming for device mapper devices, which may not always be the case (e.g., /dev/dm-X vs /dev/mapper/device-name).
A more robust and simpler approach is to use udevadm to check for multipath properties on the source device of /sysroot. This is also consistent with how multipath is verified in other tests in this repository (see mantle/kola/tests/misc/multipath.go).
This approach directly checks if the root filesystem's source device has the DM_MPATH udev property, which is a reliable way to confirm it's a multipath device.
| ExecStart=/bin/bash -c 'lsblk -pno NAME "/dev/mapper/$(multipath -l -v 1)" | grep -qw "$(findmnt -nvr /sysroot -o SOURCE)"' | |
| ExecStart=/bin/bash -c 'udevadm info $(findmnt -nvr /sysroot -o SOURCE) | grep -q "DM_MPATH="' |
yasminvalim
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.
/lgtm
This is an automated cherry-pick of #4151
/assign joelcapitao