Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Before=coreos-test-installer.service
[Service]
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)"'
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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="'

[Install]
RequiredBy=multi-user.target`

Expand Down
Loading