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.

high

This is a good improvement to remove the hardcoded multipath device name. However, this new command has a potential issue. If multipath -l -v 1 fails or returns an empty string (e.g., when no multipath devices are configured), the command effectively becomes lsblk -pno NAME "/dev/mapper/". This will list all devices under /dev/mapper/, and if the root filesystem is on any other type of device-mapper device (like an LVM volume), the grep will succeed, leading to a false positive.

A simpler and more robust approach would be to use udevadm to check the properties of the root device directly. This is also consistent with how multipath devices are verified in other tests in this repository (see mantle/kola/tests/misc/multipath.go).

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 -e "dm-uuid-mpath-" -e "DM_MPATH"'

[Install]
RequiredBy=multi-user.target`

Expand Down
Loading