From e952f26d802bdff4140ccbc9b6ee2adea9456b1c Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Mon, 26 May 2025 11:43:47 +0200 Subject: [PATCH 1/2] mantle/kola/tests: adapt mpath verification The test needs to be adapted so it doesn't verify that we're on multipath based on whether the device is `/dev/mapper/mpath` or not, but instead based on udevadm output. This verification works whether or not the `user_friendly_names` option is used while configuring multipath. --- mantle/kola/tests/misc/multipath.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mantle/kola/tests/misc/multipath.go b/mantle/kola/tests/misc/multipath.go index a4db9dcb4e..1f7b58421d 100644 --- a/mantle/kola/tests/misc/multipath.go +++ b/mantle/kola/tests/misc/multipath.go @@ -151,7 +151,8 @@ func verifyBootDropins(c cluster.TestCluster, m platform.Machine, checkBootuuid func verifyMultipath(c cluster.TestCluster, m platform.Machine, path string) { srcdev := string(c.MustSSHf(m, "findmnt -nvr %s -o SOURCE", path)) - if !strings.HasPrefix(srcdev, "/dev/mapper/mpath") { + udevinfo := string(c.MustSSHf(m, "udevadm info %s", srcdev)) + if !strings.Contains(udevinfo, "/dev/disk/by-id/dm-uuid-mpath-") && !strings.Contains(udevinfo, "DM_MPATH") { c.Fatalf("mount %s has non-multipath source %s", path, srcdev) } } From 5290a964515f319e54c1a3d50af656fb36aec7c3 Mon Sep 17 00:00:00 2001 From: Joel Capitao Date: Mon, 26 May 2025 12:03:05 +0200 Subject: [PATCH 2/2] mantle/kola/tests: use WWID in multipath.partition In order to have a more generic test, let's not use user-friendly names while configuring multipath and specify instead a World Wide ID to the stub device. We also adapt the systemd units accordingly. --- mantle/kola/tests/misc/multipath.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mantle/kola/tests/misc/multipath.go b/mantle/kola/tests/misc/multipath.go index 1f7b58421d..1a8ba983c4 100644 --- a/mantle/kola/tests/misc/multipath.go +++ b/mantle/kola/tests/misc/multipath.go @@ -51,7 +51,7 @@ systemd: [Service] Type=oneshot - ExecStart=/usr/sbin/mpathconf --enable + ExecStart=/usr/sbin/mpathconf --enable --user_friendly_names n [Install] WantedBy=multi-user.target @@ -61,8 +61,8 @@ systemd: [Unit] Description=Set Up Multipath On /var/lib/containers ConditionFirstBoot=true - Requires=dev-mapper-mpatha.device - After=dev-mapper-mpatha.device + Requires=dev-disk-by\x2did-dm\x2duuid\x2dmpath\x2d0x0000000000000001.device + After=dev-disk-by\x2did-dm\x2duuid\x2dmpath\x2d0x0000000000000001.device # See https://github.com/coreos/coreos-assembler/pull/2457 # and https://github.com/openshift/os/issues/743 After=ostree-remount.service @@ -71,7 +71,7 @@ systemd: [Service] Type=oneshot - ExecStart=/usr/sbin/mkfs.xfs -L containers -m reflink=1 /dev/mapper/mpatha + ExecStart=/usr/sbin/mkfs.xfs -L containers -m reflink=1 /dev/disk/by-id/dm-uuid-mpath-0x0000000000000001 # This is usually created by tmpfiles.d, but we run earlier than that. ExecStart=/usr/bin/mkdir -p /var/lib/containers @@ -119,7 +119,7 @@ func init() { ClusterSize: 1, Platforms: []string{"qemu"}, UserData: mpath_on_var_lib_containers, - AdditionalDisks: []string{"1G:mpath"}, + AdditionalDisks: []string{"1G:mpath,wwn=1"}, }) }