]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: accept both unpadded and padded partition sizes
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 25 Feb 2022 14:09:07 +0000 (15:09 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 25 Feb 2022 18:25:04 +0000 (18:25 +0000)
Since util-linux/util-linux@921c7da55ec78350e4067b3fd6b7de6f299106ee
libfdisk aligns the last partition (on GPT) for optimal I/O. Let's
account for that.

Fixes: #22606
test/units/testsuite-58.sh

index 7aed965fb44d7f0a538d6a0f3cb5ad5ed0dea8a6..f1b690a71ff9e923b5a6e4ea04b8617d6a97a49b 100755 (executable)
@@ -184,7 +184,8 @@ sfdisk --dump "$LOOP" | tee /tmp/testsuite-58-issue-21817.dump
 losetup -d "$LOOP"
 
 grep -qiF "p1 : start=        2048, size=      102400, type=${root_guid}," /tmp/testsuite-58-issue-21817.dump
-grep -qF 'p2 : start=      104448, size=      100319,' /tmp/testsuite-58-issue-21817.dump
+# Accept both unpadded (pre-v2.38 util-linux) and padded (v2.38+ util-linux) sizes
+grep -qE "p2 : start=      104448, size=      (100319| 98304)," /tmp/testsuite-58-issue-21817.dump
 
 rm /tmp/testsuite-58-issue-21817.img /tmp/testsuite-58-issue-21817.dump
 rm -r /tmp/testsuite-58-issue-21817-defs/