Skip to content

Commit 2af72ea

Browse files
committed
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.
1 parent 3774d13 commit 2af72ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mantle/kola/tests/misc/multipath.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func init() {
119119
ClusterSize: 1,
120120
Platforms: []string{"qemu"},
121121
UserData: mpath_on_var_lib_containers,
122-
AdditionalDisks: []string{"1G:mpath"},
122+
AdditionalDisks: []string{"1G:mpath,wwn=1"},
123123
})
124124
}
125125

@@ -151,7 +151,8 @@ func verifyBootDropins(c cluster.TestCluster, m platform.Machine, checkBootuuid
151151

152152
func verifyMultipath(c cluster.TestCluster, m platform.Machine, path string) {
153153
srcdev := string(c.MustSSHf(m, "findmnt -nvr %s -o SOURCE", path))
154-
if !strings.HasPrefix(srcdev, "/dev/mapper/mpath") {
154+
udevinfo := string(c.MustSSHf(m, "udevadm info %s", srcdev))
155+
if !strings.Contains(udevinfo, "/dev/disk/by-id/dm-uuid-mpath-") && !strings.Contains(udevinfo, "DM_MPATH") {
155156
c.Fatalf("mount %s has non-multipath source %s", path, srcdev)
156157
}
157158
}

0 commit comments

Comments
 (0)