Exclude unit tests needing losetup in Docker CI image (!59)

test_SupportedFileSystems is another unit test that has been failing
since 23-Feb-2020 in GNOME GitLab Continuous Integration test jobs.
Fragments from tests/test-suite.log from a failed test CI job:

    FAIL: test_SupportedFileSystems
    ===============================
    ...
    [ RUN      ] My/SupportedFileSystemsTest.Create/lvm2pv
    test_SupportedFileSystems.cc:387: Failure
    Failed
    create_loopdev(): Execute: losetup --find --show 'test_SupportedFileSystems.img'
    losetup: test_SupportedFileSystems.img: failed to set up loop device: No such file or directory
    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:490: Failure
    Value of: m_fs_object->create(m_partition, m_operation_detail)
      Actual: false
    Expected: true
    Operation details:
    lvm pvcreate -M 2 ''    00:00:00  (ERROR)

      WARNING: Failed to connect to lvmetad. Falling back to device scanning.
      Device  not found.

    detach_loopdev(): Execute: losetup --detach ''
    losetup: /dev/: detach failed: Inappropriate ioctl for device
    detach_loopdev(): Losetup failed with exit status 1
    detach_loopdev(): Failed to detach loop device.  Test NOT affected
    [  FAILED  ] My/SupportedFileSystemsTest.Create/lvm2pv, where GetParam() = 20 (64 ms)
    ...
    [ RUN      ] My/SupportedFileSystemsTest.CreateAndReadUsage/btrfs
    test_SupportedFileSystems.cc:387: Failure
    Failed
    create_loopdev(): Execute: losetup --find --show 'test_SupportedFileSystems.img'
    losetup: test_SupportedFileSystems.img: failed to set up loop device: No such file or directory
    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:503: Failure
    Value of: m_fs_object->create(m_partition, m_operation_detail)
      Actual: false
    Expected: true
    Operation details:
    mkfs.btrfs -L '' ''    00:00:00  (ERROR)
    btrfs-progs v4.9.1
    See http://btrfs.wiki.kernel.org for more information.

    ERROR: failed to check size for : No such file or directory

    detach_loopdev(): Execute: losetup --detach ''
    losetup: /dev/: detach failed: Inappropriate ioctl for device
    detach_loopdev(): Losetup failed with exit status 1
    detach_loopdev(): Failed to detach loop device.  Test NOT affected
    [  FAILED  ] My/SupportedFileSystemsTest.CreateAndReadUsage/btrfs, where GetParam() = 7 (11 ms)

All the test_SupportedFileSystems unit tests which need a loop device
are failing when running losetup like this:
    losetup: <IMAGE_NAME>: failed to setup loop device: No such file or directory

losetup uses /dev/loop-control [1][2] which no longer exists in the
Docker image.  However even after creating /dev/loop-control in the
image, losetup continues to fail.  Also tried stracing losetup but that
fails like this, presumably because it is not allowed inside the Docker
image:
    $ strace losetup --find --show /tmp/disk.img
    strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
    +++ exited with 1 +++

For now I have run out of ways to investigate and resolve this, so just
exclude the 12 tests which required loop devices.  All the tests still
execute when run locally outside the restricted GNOME GitLab CI Docker
setup.

Closes !59 - Fix GNOME GitLab CI test job failures because of missing
             /dev entries
This commit is contained in:
Mike Fleetwood 2020-03-11 07:55:53 +00:00 committed by Curtis Gedak
parent 57983b9fc2
commit 39fdfe51da

View file

@ -60,6 +60,25 @@ stages:
- make -j $nproc
# Exclude specific unit test which fails without /dev/disk in Docker images.
- export GTEST_FILTER='-BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches'
# Exclude specific unit tests which fail without being able to create
# loop devices in Docker images.
- GTEST_FILTER+=':My/SupportedFileSystemsTest.Create/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUsage/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUsage/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUsage/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadLabel/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadLabel/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUUID/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndReadUUID/nilfs2'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndWriteLabel/nilfs2'
- 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/lvm2pv'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndGrow/xfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndShrink/btrfs'
- GTEST_FILTER+=':My/SupportedFileSystemsTest.CreateAndShrink/lvm2pv'
# Create needed /dev entries for unit tests in Docker images.
- tests/makedev.sh
- make check