]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tests: Fix test/misc/swaplabel failure due to change in mkswap behaviour.
authorMark Hindley <mark@hindley.org.uk>
Mon, 18 Oct 2021 17:53:01 +0000 (17:53 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Oct 2021 09:38:27 +0000 (11:38 +0200)
commita02721f35b30d4ee0133446f016442f63117ddf6
treea9d17eb2c54f37424169582d536dc997306938fc
parent403f9c7af6632d10bad8688306ec0f41af586d67
tests: Fix test/misc/swaplabel failure due to change in mkswap behaviour.

mkswap now warns if the image file has holes. If fallocate is used to create the
file, use POSIX semantics to ensure the file has no holes.

This fixes the test failure

misc: swaplabel                      ... FAILED (misc/swaplabel)
========= script: /build/util-linux-2.37.2/tests/ts/misc/swaplabel =================
================= OUTPUT =====================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= EXPECTED ===================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= O/E diff ===================
==============================================

The additional error appears in swaplabel.err:

 mkswap: <swapfile> contains holes or other unsupported extents.
         This swap file can be rejected by kernel on swap activation!
         Use --verbose for more details.

[zeha@debian.org: this appears to be important/required when building
inside cowbuilder, on an ext3 filesystem.]

Signed-off-by: Mark Hindley <mark@hindley.org.uk>
tests/ts/misc/swaplabel