Skip to content

Commit

Permalink
Fail only on non-zero alignment_offset
Browse files Browse the repository at this point in the history
Signed-off-by: Bryan Gurney <[email protected]>
  • Loading branch information
bgurney-rh committed Nov 17, 2023
1 parent 6aa45f5 commit 8d7d665
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d7d665

Please sign in to comment.