gparted/.gitlab-ci.yml

91 lines
2.9 KiB
YAML
Raw Normal View History

stages:
- build
- test
.centos_image_template: &centos_image_definition
# Use official CentOS image https://hub.docker.com/_/centos/.
image: centos:centos7
before_script:
- yum update -y
- yum install -y which gnome-common yelp-tools glib2-devel intltool
gcc-c++ libuuid-devel parted-devel gtkmm30-devel make
polkit file
Add initial create ext2 only FileSystem interface class test (!49) This is the first step of adding testing of the derived FileSystem interface classes which call the file system specific executables. Rather than mocking command execution and returned output the tests run the real commands, effectively making this integration testing. Test case setup determines the file system supported actions using get_filesystem_support() and individual tests are skipped if a feature is not supported, just as GParted does for it's actions. Each test creates it's own sparse image file and a fresh file system, performs a test on one FileSystem interface call and deletes the image file. This makes each test independent and allows them to run as a non-root user, provided the file system command itself doesn't require root. Errors reported for a failed interface call will include the GParted OperationDetails, which in turn includes the file system specific command used and stdout and stderr from it's execution. For example, temporarily breaking the test code to create a 10 KiB image file instead of 256 MiB one produces this: $ ./test_ext2 Running main() from test_ext2.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from ext2Test [ RUN ] ext2Test.Create test_ext2.cc:199: Failure Value of: s_ext2_obj->create(m_partition, m_operation_detail) Actual: false Expected: true Operation details: <b><i>mkfs.ext2 -F -L &apos;&apos; &apos;/home/centos/programming/c/gparted/tests/test_ext2.img&apos;</i></b> 00:00:00 (ERROR) <i></i> <i>mke2fs 1.42.9 (28-Dec-2013) /home/centos/programming/c/gparted/tests/test_ext2.img: Not enough space to build proposed filesystem while setting up superblock </i> [ FAILED ] ext2Test.Create (25 ms) [----------] 1 test from ext2Test (25 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (30 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] ext2Test.Create 1 FAILED TEST $ echo $? 1 Also as Utils:: and FileSystem::execute_command() are needed, this requires linking with GParted_Core for GParted_Core::mainthread and therefore with most of the non-UI classes in gpartedbin. Closes !49 - Add file system interface tests
2019-07-17 06:08:08 -06:00
# Extra packages only needed during the test stage.
Extend tests to all fully supported file systems (!49) Extend testing to all fully supported file systems, those with an implemented FileSystem derived class. Note that in main() GParted threading needs to now be initialised before InitGoogleTest() because it calls INSTANTIATE_TEST_CASE_P() which in turn calls get_supported_fstypes() which eventually constructs all the individual file system interface objects and discovers available support, some of which use execute_command(). Example call chain: InitGoogleTest() INSTANTIATE_TEST_CASE_P() get_supported_fstypes() setup_supported_filesystems() {SupportedFileSystems}->find_supported_filesystems() {btrfs}->get_filesystem_support() Utils::execute_command() In the CentOS 7 GitLab CI image the EPEL (Extra Packages for Enterprise Linux) repository is added to provide f2fs-tools and ntfsprogs. 23 of 210 tests fail on CentOS 7 and 22 on Ubuntu 18.04 LTS. The following commits will resolve these test failures. $ ./test_SupportedFileSystems Running main() from test_SupportedFileSystems.cc [==========] Running 210 tests from 1 test case. [----------] Global test environment set-up. [----------] 210 tests from My/SupportedFileSystemsTest ... [----------] 210 tests from My/SupportedFileSystemsTest (11066 ms total) [----------] Global test environment tear-down [==========] 210 tests from 1 test case ran. (11067 ms total) [ PASSED ] 187 tests. [ FAILED ] 23 tests, listed below: [ FAILED ] My/SupportedFileSystemsTest.Create/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/jfs, where GetParam() = 17 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/ntfs, where GetParam() = 23 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadLabel/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadLabel/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/fat16, where GetParam() = 13 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/fat32, where GetParam() = 14 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/jfs, where GetParam() = 17 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndWriteLabel/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndWriteUUID/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndCheck/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndCheck/minix, where GetParam() = 21 [ FAILED ] My/SupportedFileSystemsTest.CreateAndRemove/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndGrow/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndGrow/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndGrow/xfs, where GetParam() = 27 [ FAILED ] My/SupportedFileSystemsTest.CreateAndShrink/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndShrink/lvm2pv, where GetParam() = 20 23 FAILED TESTS Closes !49 - Add file system interface tests
2019-08-05 09:13:04 -06:00
# Install EPEL repo first for f2fs-tools and ntfsprogs.
- yum install -y epel-release
- yum install -y btrfs-progs e2fsprogs f2fs-tools dosfstools mtools
hfsplus-tools util-linux cryptsetup device-mapper lvm2
ntfsprogs udftools xfsprogs xfsdump
Prevent file system tests core dumping in GitLab CI Ubuntu image (!49) With the previous commit, execution of test_SupportedFileSystems is failing in the GitLab CI Ubuntu image. Fragment from file tests/test-suite.log: FAIL: test_SupportedFileSystems =============================== Terminate called after throwing an instance of 'Glib::ConvertError' Aborted (core dumped) FAIL test_SupportedFileSystems (exit status: 134) This core dump can be re-created locally by (1) removing modprobe from the PATH, and (2) executing the test program in the C locale. $ LC_ALL=C ./test_SupportedFileSystems Running main() from test_SupportedFileSystems.cc terminate called after throwing an instance of 'Glib::ConvertError' Aborted $ echo $? 134 Backtrace from gdb: (gdb) backtrace #0 0x00007f4f93002337 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55 #1 0x00007f4f93003a28 in __GI_abort () at abort.c:90 #2 0x00007f4f93b2e7d5 in __gnu_cxx::__verbose_terminate_handler() () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95 #3 0x00007f4f93b2c746 in __cxxabiv1::__terminate(void (*)()) (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38 #4 0x00007f4f93b2c773 in std::terminate() () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48 #5 0x00007f4f93b2c993 in __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) (obj=0x260d4b0, tinfo=0x7f4f966c1930 <typeinfo for Glib::ConvertError>, dest=0x7f4f96486fa0 <Glib::ConvertError::~ConvertError()>) at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:87 #6 0x00007f4f96486e27 in Glib::ConvertError::throw_func(_GError*) (gobject=0x260bf90) at convert.cc:329 #7 0x00007f4f9649b5d7 in Glib::Error::throw_exception(_GError*) (gobject=0x260bf90) at error.cc:175 #8 0x00007f4f964a7155 in Glib::operator<<(std::ostream&, Glib::ustring const&) (os=warning: RTTI symbol not found for class 'std::ostream' ..., utf8_string=...) at ustring.cc:1430 #9 0x000000000044d66f in GParted::Utils::execute_command(Glib::ustring const&, char const*, Glib::ustring&, Glib::ustring&, bool) (command=..., input=input@entry=0x0, output=..., error=..., use_C_locale=use_C_locale@entry=true) at ../src/Utils.cc:688 #10 0x000000000044dae9 in GParted::Utils::kernel_supports_fs(Glib::ustring const&) (use_C_locale=true, error=..., output=..., command=...) at ../src/Utils.cc:659 #11 0x000000000044dae9 in GParted::Utils::kernel_supports_fs(Glib::ustring const&) (fs=...) at ../src/Utils.cc:480 #12 0x0000000000460008 in GParted::jfs::get_filesystem_support() (this=0x25e8e60) at ../src/jfs.cc:59 #13 0x00000000004464f9 in GParted::SupportedFileSystems::find_supported_filesystems() (this=0x25e8690) at ../src/SupportedFileSystems.cc:120 #14 0x0000000000412360 in GParted::SupportedFileSystemsTest::setup_supported_filesystems() () at test_SupportedFileSystems.cc:278 #15 0x00000000004151b0 in GParted::SupportedFileSystemsTest::get_supported_fstypes() () at test_SupportedFileSystems.cc:256 #16 0x00000000004152c0 in GParted::gtest_MySupportedFileSystemsTest_EvalGenerator_() () at test_SupportedFileSystems.cc:495 #17 0x000000000041c7d6 in testing::internal::ParameterizedTestCaseInfo<GParted::SupportedFileSystemsTest>::RegisterTests() (this=0x2528ac0) at ../lib/gtest/include/gtest/internal/gtest-param-util.h:549 #18 0x0000000000479fb5 in testing::internal::UnitTestImpl::RegisterParameterizedTests() (this=0x25288d0) at ./include/gtest/internal/gtest-param-util.h:709 #19 0x0000000000479fb5 in testing::internal::UnitTestImpl::RegisterParameterizedTests() (this=this@entry=0x2528800) at ./src/gtest.cc:2658 #20 0x000000000048a001 in testing::internal::UnitTestImpl::PostFlagParsingInit() (this=0x2528800) at ./src/gtest.cc:4980 #21 0x000000000049e399 in testing::internal::InitGoogleTestImpl<char>(int*, char**) (argc=argc@entry=0x7ffe9d208a3c, argv=argv@entry=0x7ffe9d208b38) at ./src/gtest.cc:5934 #22 0x000000000048d285 in testing::InitGoogleTest(int*, char**) (argc=argc@entry=0x7ffe9d208a3c, argv=argv@entry=0x7ffe9d208b38) at ./src/gtest.cc:5952 #23 0x0000000000410404 in main(int, char**) (argc=1, argv=0x7ffe9d208b38) at test_SupportedFileSystems.cc:557 The test program runs when executed in my locale and produces these messages: $ ./test_SupportedFileSystems Running main() from test_SupportedFileSystems.cc Failed to execute child process “modprobe” (No such file or directory) Failed to execute child process “modprobe” (No such file or directory) [==========] Running 210 tests from 1 test case. ... So the test program is aborting when trying to print the failed to execute child process message, but only in the C locale. This doesn't affect the CentOS GitLab CI image because that installs the kmod package with modprobe by default, however the Ubuntu image doesn't have the kmod package. Fix this by explicitly installing the kmod package into both the CentOS and Ubuntu GitLab CI images. Closes !49 - Add file system interface tests
2019-10-16 00:36:41 -06:00
xorg-x11-server-Xvfb kmod
- cat /etc/os-release
.ubuntu_image_template: &ubuntu_image_definition
# Use official Ubuntu image https://hub.docker.com/_/ubuntu/.
image: ubuntu:latest
before_script:
- apt-get update
- apt-get install -y gnome-common yelp-tools libglib2.0-dev-bin
uuid-dev libparted-dev libgtkmm-3.0-dev make
policykit-1
Add initial create ext2 only FileSystem interface class test (!49) This is the first step of adding testing of the derived FileSystem interface classes which call the file system specific executables. Rather than mocking command execution and returned output the tests run the real commands, effectively making this integration testing. Test case setup determines the file system supported actions using get_filesystem_support() and individual tests are skipped if a feature is not supported, just as GParted does for it's actions. Each test creates it's own sparse image file and a fresh file system, performs a test on one FileSystem interface call and deletes the image file. This makes each test independent and allows them to run as a non-root user, provided the file system command itself doesn't require root. Errors reported for a failed interface call will include the GParted OperationDetails, which in turn includes the file system specific command used and stdout and stderr from it's execution. For example, temporarily breaking the test code to create a 10 KiB image file instead of 256 MiB one produces this: $ ./test_ext2 Running main() from test_ext2.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from ext2Test [ RUN ] ext2Test.Create test_ext2.cc:199: Failure Value of: s_ext2_obj->create(m_partition, m_operation_detail) Actual: false Expected: true Operation details: <b><i>mkfs.ext2 -F -L &apos;&apos; &apos;/home/centos/programming/c/gparted/tests/test_ext2.img&apos;</i></b> 00:00:00 (ERROR) <i></i> <i>mke2fs 1.42.9 (28-Dec-2013) /home/centos/programming/c/gparted/tests/test_ext2.img: Not enough space to build proposed filesystem while setting up superblock </i> [ FAILED ] ext2Test.Create (25 ms) [----------] 1 test from ext2Test (25 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (30 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] ext2Test.Create 1 FAILED TEST $ echo $? 1 Also as Utils:: and FileSystem::execute_command() are needed, this requires linking with GParted_Core for GParted_Core::mainthread and therefore with most of the non-UI classes in gpartedbin. Closes !49 - Add file system interface tests
2019-07-17 06:08:08 -06:00
# Extra packages only needed during the test stage.
Extend tests to all fully supported file systems (!49) Extend testing to all fully supported file systems, those with an implemented FileSystem derived class. Note that in main() GParted threading needs to now be initialised before InitGoogleTest() because it calls INSTANTIATE_TEST_CASE_P() which in turn calls get_supported_fstypes() which eventually constructs all the individual file system interface objects and discovers available support, some of which use execute_command(). Example call chain: InitGoogleTest() INSTANTIATE_TEST_CASE_P() get_supported_fstypes() setup_supported_filesystems() {SupportedFileSystems}->find_supported_filesystems() {btrfs}->get_filesystem_support() Utils::execute_command() In the CentOS 7 GitLab CI image the EPEL (Extra Packages for Enterprise Linux) repository is added to provide f2fs-tools and ntfsprogs. 23 of 210 tests fail on CentOS 7 and 22 on Ubuntu 18.04 LTS. The following commits will resolve these test failures. $ ./test_SupportedFileSystems Running main() from test_SupportedFileSystems.cc [==========] Running 210 tests from 1 test case. [----------] Global test environment set-up. [----------] 210 tests from My/SupportedFileSystemsTest ... [----------] 210 tests from My/SupportedFileSystemsTest (11066 ms total) [----------] Global test environment tear-down [==========] 210 tests from 1 test case ran. (11067 ms total) [ PASSED ] 187 tests. [ FAILED ] 23 tests, listed below: [ FAILED ] My/SupportedFileSystemsTest.Create/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/jfs, where GetParam() = 17 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUsage/ntfs, where GetParam() = 23 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadLabel/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadLabel/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/fat16, where GetParam() = 13 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/fat32, where GetParam() = 14 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/jfs, where GetParam() = 17 [ FAILED ] My/SupportedFileSystemsTest.CreateAndReadUUID/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndWriteLabel/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndWriteUUID/nilfs2, where GetParam() = 22 [ FAILED ] My/SupportedFileSystemsTest.CreateAndCheck/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndCheck/minix, where GetParam() = 21 [ FAILED ] My/SupportedFileSystemsTest.CreateAndRemove/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndGrow/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndGrow/lvm2pv, where GetParam() = 20 [ FAILED ] My/SupportedFileSystemsTest.CreateAndGrow/xfs, where GetParam() = 27 [ FAILED ] My/SupportedFileSystemsTest.CreateAndShrink/btrfs, where GetParam() = 7 [ FAILED ] My/SupportedFileSystemsTest.CreateAndShrink/lvm2pv, where GetParam() = 20 23 FAILED TESTS Closes !49 - Add file system interface tests
2019-08-05 09:13:04 -06:00
- apt-get install -y btrfs-progs e2fsprogs f2fs-tools dosfstools mtools
hfsutils hfsprogs jfsutils util-linux cryptsetup-bin
dmsetup lvm2 nilfs-tools ntfs-3g reiser4progs
Prevent file system tests core dumping in GitLab CI Ubuntu image (!49) With the previous commit, execution of test_SupportedFileSystems is failing in the GitLab CI Ubuntu image. Fragment from file tests/test-suite.log: FAIL: test_SupportedFileSystems =============================== Terminate called after throwing an instance of 'Glib::ConvertError' Aborted (core dumped) FAIL test_SupportedFileSystems (exit status: 134) This core dump can be re-created locally by (1) removing modprobe from the PATH, and (2) executing the test program in the C locale. $ LC_ALL=C ./test_SupportedFileSystems Running main() from test_SupportedFileSystems.cc terminate called after throwing an instance of 'Glib::ConvertError' Aborted $ echo $? 134 Backtrace from gdb: (gdb) backtrace #0 0x00007f4f93002337 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55 #1 0x00007f4f93003a28 in __GI_abort () at abort.c:90 #2 0x00007f4f93b2e7d5 in __gnu_cxx::__verbose_terminate_handler() () at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95 #3 0x00007f4f93b2c746 in __cxxabiv1::__terminate(void (*)()) (handler=<optimized out>) at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38 #4 0x00007f4f93b2c773 in std::terminate() () at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48 #5 0x00007f4f93b2c993 in __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) (obj=0x260d4b0, tinfo=0x7f4f966c1930 <typeinfo for Glib::ConvertError>, dest=0x7f4f96486fa0 <Glib::ConvertError::~ConvertError()>) at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:87 #6 0x00007f4f96486e27 in Glib::ConvertError::throw_func(_GError*) (gobject=0x260bf90) at convert.cc:329 #7 0x00007f4f9649b5d7 in Glib::Error::throw_exception(_GError*) (gobject=0x260bf90) at error.cc:175 #8 0x00007f4f964a7155 in Glib::operator<<(std::ostream&, Glib::ustring const&) (os=warning: RTTI symbol not found for class 'std::ostream' ..., utf8_string=...) at ustring.cc:1430 #9 0x000000000044d66f in GParted::Utils::execute_command(Glib::ustring const&, char const*, Glib::ustring&, Glib::ustring&, bool) (command=..., input=input@entry=0x0, output=..., error=..., use_C_locale=use_C_locale@entry=true) at ../src/Utils.cc:688 #10 0x000000000044dae9 in GParted::Utils::kernel_supports_fs(Glib::ustring const&) (use_C_locale=true, error=..., output=..., command=...) at ../src/Utils.cc:659 #11 0x000000000044dae9 in GParted::Utils::kernel_supports_fs(Glib::ustring const&) (fs=...) at ../src/Utils.cc:480 #12 0x0000000000460008 in GParted::jfs::get_filesystem_support() (this=0x25e8e60) at ../src/jfs.cc:59 #13 0x00000000004464f9 in GParted::SupportedFileSystems::find_supported_filesystems() (this=0x25e8690) at ../src/SupportedFileSystems.cc:120 #14 0x0000000000412360 in GParted::SupportedFileSystemsTest::setup_supported_filesystems() () at test_SupportedFileSystems.cc:278 #15 0x00000000004151b0 in GParted::SupportedFileSystemsTest::get_supported_fstypes() () at test_SupportedFileSystems.cc:256 #16 0x00000000004152c0 in GParted::gtest_MySupportedFileSystemsTest_EvalGenerator_() () at test_SupportedFileSystems.cc:495 #17 0x000000000041c7d6 in testing::internal::ParameterizedTestCaseInfo<GParted::SupportedFileSystemsTest>::RegisterTests() (this=0x2528ac0) at ../lib/gtest/include/gtest/internal/gtest-param-util.h:549 #18 0x0000000000479fb5 in testing::internal::UnitTestImpl::RegisterParameterizedTests() (this=0x25288d0) at ./include/gtest/internal/gtest-param-util.h:709 #19 0x0000000000479fb5 in testing::internal::UnitTestImpl::RegisterParameterizedTests() (this=this@entry=0x2528800) at ./src/gtest.cc:2658 #20 0x000000000048a001 in testing::internal::UnitTestImpl::PostFlagParsingInit() (this=0x2528800) at ./src/gtest.cc:4980 #21 0x000000000049e399 in testing::internal::InitGoogleTestImpl<char>(int*, char**) (argc=argc@entry=0x7ffe9d208a3c, argv=argv@entry=0x7ffe9d208b38) at ./src/gtest.cc:5934 #22 0x000000000048d285 in testing::InitGoogleTest(int*, char**) (argc=argc@entry=0x7ffe9d208a3c, argv=argv@entry=0x7ffe9d208b38) at ./src/gtest.cc:5952 #23 0x0000000000410404 in main(int, char**) (argc=1, argv=0x7ffe9d208b38) at test_SupportedFileSystems.cc:557 The test program runs when executed in my locale and produces these messages: $ ./test_SupportedFileSystems Running main() from test_SupportedFileSystems.cc Failed to execute child process “modprobe” (No such file or directory) Failed to execute child process “modprobe” (No such file or directory) [==========] Running 210 tests from 1 test case. ... So the test program is aborting when trying to print the failed to execute child process message, but only in the C locale. This doesn't affect the CentOS GitLab CI image because that installs the kmod package with modprobe by default, however the Ubuntu image doesn't have the kmod package. Fix this by explicitly installing the kmod package into both the CentOS and Ubuntu GitLab CI images. Closes !49 - Add file system interface tests
2019-10-16 00:36:41 -06:00
reiserfsprogs udftools xfsprogs xfsdump xvfb kmod
- cat /etc/os-release
.build_stage_template: &build_stage_definition
stage: build
script:
- ./autogen.sh
- nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1
- echo nproc=$nproc
- make -j $nproc
- make install
# Save all files on job failure for investigation.
artifacts:
when: on_failure
name: "$CI_PROJECT_NAME-ci-job-$CI_JOB_ID-$CI_JOB_NAME"
untracked: true
paths:
- ./
expire_in: 1 week
.test_stage_template: &test_stage_definition
stage: test
script:
- ./autogen.sh
- nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1
- echo nproc=$nproc
- make -j $nproc
Exclude unit test which fails in Docker CI image (!4) Fragment of the tests/test-suite.log from the Docker CI image showing details of the unit test failure: Running main() from gtest_main.cc [==========] Running 26 tests from 1 test case. [----------] Global test environment set-up. [----------] 26 tests from BlockSpecialTest ... [ RUN ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches test_BlockSpecial.cc:137: Failure Failed get_link_name(): Failed to open directory '/dev/disk/by-id' test_BlockSpecial.cc:168: Failure Failed follow_link_name(): Failed to resolve symbolic link '' test_BlockSpecial.cc:255: Failure Expected: (lnk.m_name.c_str()) != (bs.m_name.c_str()), actual: "" vs "" [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches (0 ms) ... [==========] 26 tests from 1 test case ran. (1 ms total) [ PASSED ] 25 tests. [ FAILED ] 1 test, listed below: [ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches 1 FAILED TEST So the code is trying to find a symbolic link to a block device to use in the test. It is trying to read the directory /dev/disk/by-id to find a symbolic link, but the directory doesn't exist in the Docker CI image. The used directory was recently changed [1] to use one which existed on all distributions. Docker images don't even have the /dev/disk directory. Exclude just this specific test. [1] 7fe41480749c795dfb79daeba7b058cece2dfdd2 Use /dev/disk/by-id/ to get device symlink in test_BlockSpecial Closes !4 - Add GitLab CI jobs to build and test GParted
2018-06-22 08:27:29 -06:00
# Exclude specific unit test which fails without /dev/disk in Docker images.
- export GTEST_FILTER='-BlockSpecialTest.NamedBlockSpecialObjectBySymlinkMatches'
- make check
- make distcheck
# Save all files on job failure for investigation.
artifacts:
when: on_failure
name: "$CI_PROJECT_NAME-ci-job-$CI_JOB_ID-$CI_JOB_NAME"
untracked: true
paths:
- ./
expire_in: 1 week
# Check GParted can be built and installed on CentOS and Ubuntu.
centos_build:
<<: *centos_image_definition
<<: *build_stage_definition
ubuntu_build:
<<: *ubuntu_image_definition
<<: *build_stage_definition
# Check GParted unit tests and distcheck pass on CentOS and Ubuntu.
centos_test:
<<: *centos_image_definition
<<: *test_stage_definition
ubuntu_test:
<<: *ubuntu_image_definition
<<: *test_stage_definition