diff --git a/testlib/infra.py b/testlib/infra.py index 0682c66..21a30c2 100644 --- a/testlib/infra.py +++ b/testlib/infra.py @@ -180,7 +180,14 @@ def tearDown(self): misaligned_devices = [] for dev in os.listdir("/sys/class/block"): if fnmatch.fnmatch(dev, "dm-*"): - misaligned_devices.append(dev) + dev_sysfspath = os.path.join( + "/sys/class/block", dev, "alignment_offset" + ) + with open(dev_sysfspath, "r", encoding="utf-8") as dev_sysfs: + dev_align = dev_sysfs.read().rstrip() + if int(dev_align) != 0: + misaligned_devices.append(dev) + self.assertEqual(misaligned_devices, []) except FileNotFoundError: pass