Exclude more GitLab CI file system tests needing loop devices (#147)

For the first time ever the ubuntu_test GitLab CI job failed running the
JFS grow test like this.  Fragment from tests/test-suite.log:

    [ RUN      ] My/SupportedFileSystemsTest.CreateAndGrow/jfs
    test_SupportedFileSystems.cc:387: Failure
    Failed
    create_loopdev(): Execute: losetup --find --show 'test_SupportedFileSystems.img'
    losetup: cannot find an unused loop device
    create_loopdev(): Losetup failed with exit status 1
    create_loopdev(): Failed to create required loop device
    Error: Could not stat device  - No such file or directory.
    test_SupportedFileSystems.cc:446: Failure
    Value of: lp_device != NULL
      Actual: false
    Expected: true
    test_SupportedFileSystems.cc:649: Failure
    Value of: m_fs_object->create(m_partition, m_operation_detail)
      Actual: false
    Expected: true
    Operation details:
    mkfs.jfs -q -L '' ''    00:00:00  (ERROR)
    mkfs.jfs version 1.1.15, 04-Mar-2011

    The system cannot find the specified device.

    detach_loopdev(): Execute: losetup --detach ''
    losetup: : failed to use device: No such device
    detach_loopdev(): Losetup failed with exit status 1
    detach_loopdev(): Failed to detach loop device.  Test NOT affected
    [  FAILED  ] My/SupportedFileSystemsTest.CreateAndGrow/jfs, where GetParam() = 17 (24 ms)

JFS can only be grown when mounted by the kernel and GParted only
enables JFS grow support when, among other things, kernel support is
detected.

Unknowingly the JFS grow test had always previously been skipped, even
in the ubuntu_test CI job which installs jfsutils, because the kernel
didn't support JFS.  Capture of this test from another run of the
ubuntu_test CI job:

    [ RUN      ] My/SupportedFileSystemsTest.CreateAndGrow/jfs
    test_SupportedFileSystems.cc:641: Skip test.  grow not supported or support not found
    [       OK ] My/SupportedFileSystemsTest.CreateAndGrow/jfs (0 ms)

Plus additional debug added into the job based on what
Utils::kernel_supports_fs() does to identify kernel support:

    $ fgrep jfs /proc/filesystems || true
    $ modprobe jfs || true
    modprobe: FATAL: Module jfs not found in directory /lib/modules/3.10.0-1160.11.1.el7.x86_64
    $ fgrep jfs /proc/filesystems || true

Therefore until now every GitLab job runner machine kernel didn't
support JFS, but for the first time ever this ubuntu_test job ran on a
runner machine where the kernel did support JFS, hence the attempt to
use losetup.

Examining test_SupportFileSystems.cc there are 24 file system tests
which specify SKIP_IF_NOT_ROOT_FOR_REQUIRED_LOOPDEV_FOR_FS(), but only
17 exclusions in .gitlab-ci.yaml [1].  The 7 tests without exclusions
are:

    *.CreateAndReadLabel/lvm2pv
    *.CreateAndReadUUID/lvm2pv
    *.CreateAndWriteLabel/lvm2pv
    *.CreateAndWriteUUID/lvm2pv
    *.CreateAndGrow/jfs
    *.CreateAndGrow/nilfs2
    *.CreateAndShrink/nilfs2

For LVM2 PVs reading and writing of labels and UUIDs aren't implemented
(only reading of UUIDs could be supported as the others are impossible)
so those tests are always skipped.  Add unit test exclusions just for
completeness.

JFS grow is this case.  NILFS2 grow and shrink are more cases where
kernel support is needed.  Add unit test exclusions to stop attempting
to run JFS and NILFS2 resizing tests, which don't currently work because
losetup doesn't work in the GitLab CI docker images [1].

[1] 39fdfe51da
    Exclude unit tests needing losetup in Docker CI image (!59)

Closes #147 - GitLab CI job failure from *.CreateAndGrow/jfs
This commit is contained in:
Mike Fleetwood 2021-03-08 21:29:20 +00:00 committed by Curtis Gedak
parent a41e8b03ec
commit 30ff497c6e
1 changed files with 7 additions and 0 deletions

View File

@ -67,18 +67,25 @@ stages:
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUsage/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUsage/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadLabel/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadLabel/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadLabel/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUUID/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUUID/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUUID/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndWriteLabel/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndWriteLabel/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndWriteUUID/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndWriteUUID/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndCheck/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndRemove/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndGrow/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndGrow/jfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndGrow/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndGrow/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndGrow/xfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndShrink/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndShrink/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndShrink/nilfs2'
# Create needed /dev entries for unit tests in Docker images.
- tests/makedev.sh
- make check