2018-06-22 03:31:33 -06:00
|
|
|
stages:
|
|
|
|
- build
|
2018-06-22 05:56:01 -06:00
|
|
|
- test
|
2018-06-22 03:31:33 -06:00
|
|
|
|
2022-06-16 05:01:12 -06:00
|
|
|
.alpine_image_template: &alpine_image_definition
|
|
|
|
# Use official Alpine image https://hub.docker.com/_/alpine/.
|
|
|
|
image: alpine:latest
|
|
|
|
before_script:
|
|
|
|
- cat /proc/version
|
|
|
|
- cat /etc/os-release
|
|
|
|
- apk update
|
2022-09-23 01:33:15 -06:00
|
|
|
- apk add gnome-common yelp-tools automake autoconf glib-dev libtool g++
|
|
|
|
parted-dev gtkmm3-dev itstool make git polkit-dev
|
2022-06-16 06:47:28 -06:00
|
|
|
# Extra packages only needed during the test stage.
|
|
|
|
- apk add btrfs-progs btrfs-progs-extra e2fsprogs e2fsprogs-extra exfatprogs
|
|
|
|
dosfstools mtools f2fs-tools jfsutils cryptsetup lvm2 udftools
|
2022-06-19 02:32:27 -06:00
|
|
|
xfsprogs xfsprogs-extra xvfb-run kmod gzip
|
2022-06-16 05:01:12 -06:00
|
|
|
|
2018-06-23 06:28:57 -06:00
|
|
|
.centos_image_template: ¢os_image_definition
|
|
|
|
# Use official CentOS image https://hub.docker.com/_/centos/.
|
2019-09-29 03:13:49 -06:00
|
|
|
image: centos:centos7
|
2018-06-23 06:28:57 -06:00
|
|
|
before_script:
|
2022-06-18 14:35:58 -06:00
|
|
|
- cat /proc/version
|
|
|
|
- cat /etc/os-release
|
2018-06-23 06:28:57 -06:00
|
|
|
- yum update -y
|
2022-09-23 01:33:15 -06:00
|
|
|
- yum install -y which gnome-common yelp-tools glib2-devel gcc-c++
|
|
|
|
libuuid-devel parted-devel gtkmm30-devel make polkit file
|
|
|
|
polkit-devel gettext-devel
|
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
|
2021-01-13 04:25:41 -07:00
|
|
|
- yum install -y btrfs-progs e2fsprogs exfatprogs 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
|
2020-09-17 09:44:31 -06:00
|
|
|
- systemd-machine-id-setup
|
2018-06-23 06:28:57 -06:00
|
|
|
|
2018-06-23 06:47:43 -06:00
|
|
|
.ubuntu_image_template: &ubuntu_image_definition
|
|
|
|
# Use official Ubuntu image https://hub.docker.com/_/ubuntu/.
|
|
|
|
image: ubuntu:latest
|
|
|
|
before_script:
|
2022-06-18 14:35:58 -06:00
|
|
|
- cat /proc/version
|
|
|
|
- cat /etc/os-release
|
2020-05-22 08:59:35 -06:00
|
|
|
- export DEBIAN_FRONTEND=noninteractive
|
2022-07-01 05:53:22 -06:00
|
|
|
- apt update
|
|
|
|
- apt install -y build-essential gnome-common yelp-tools libglib2.0-dev-bin
|
|
|
|
uuid-dev libparted-dev libgtkmm-3.0-dev policykit-1
|
2019-07-17 06:08:08 -06:00
|
|
|
# Extra packages only needed during the test stage.
|
2022-07-01 05:53:22 -06:00
|
|
|
- apt install -y btrfs-progs e2fsprogs exfatprogs f2fs-tools dosfstools
|
|
|
|
mtools hfsutils hfsprogs jfsutils util-linux cryptsetup-bin
|
|
|
|
dmsetup lvm2 nilfs-tools ntfs-3g reiser4progs reiserfsprogs
|
|
|
|
udftools xfsprogs xfsdump xvfb kmod
|
2018-06-23 06:47:43 -06:00
|
|
|
|
2018-06-23 06:28:57 -06:00
|
|
|
.build_stage_template: &build_stage_definition
|
2018-06-22 03:31:33 -06:00
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- ./autogen.sh
|
2018-07-06 00:35:10 -06:00
|
|
|
- nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1
|
|
|
|
- echo nproc=$nproc
|
|
|
|
- make -j $nproc
|
2018-06-22 03:31:33 -06:00
|
|
|
- make install
|
2019-12-03 07:08:06 -07:00
|
|
|
# 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
|
2018-06-22 05:56:01 -06:00
|
|
|
|
2018-06-23 06:28:57 -06:00
|
|
|
.test_stage_template: &test_stage_definition
|
2018-06-22 05:56:01 -06:00
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- ./autogen.sh
|
2018-07-06 00:35:10 -06:00
|
|
|
- nproc=`grep -c '^processor' /proc/cpuinfo` || nproc=1
|
|
|
|
- echo nproc=$nproc
|
|
|
|
- make -j $nproc
|
2020-03-11 01:55:53 -06:00
|
|
|
# Exclude specific unit tests which fail without being able to create
|
|
|
|
# loop devices in Docker images.
|
2022-07-04 11:30:15 -06:00
|
|
|
- export GTEST_FILTER=`tests/exclude_loopdev_tests.sh tests/test_SupportedFileSystems.cc`
|
|
|
|
- echo $GTEST_FILTER
|
2021-03-08 08:40:43 -07:00
|
|
|
- fgrep -v nodev /proc/filesystems | sort
|
Create block special devices needed by test_BlockSpecial in GitLab CI jobs (!59)
From 23-Feb-2020 onwards, GNOME GitLab Continuous Integration test jobs
have been failing running unit tests which previously succeeded. With
some extra debugging added into test_BlockSpecial to print 'bname' and
'bs' values in the failing tests, here are fragments from
tests/test-suite.log for the the test_BlockSpecial failures in a test CI
job:
FAIL: test_BlockSpecial
=======================
...
[ RUN ] BlockSpecialTest.NamedBlockSpecialObjectBlockDevice
bname="/dev/sr0"
bs=BlockSpecial{"/dev/sr0",0,0}
test_BlockSpecial.cc:218: Failure
Value of: bs.m_major > 0 || bs.m_minor > 0
Actual: false
Expected: true
[ FAILED ] BlockSpecialTest.NamedBlockSpecialObjectBlockDevice (0 ms)
...
[ RUN ] BlockSpecialTest.TwoNamedBlockSpecialObjectBlockDevices
bname1="/dev/sr0"
bname2="/dev/sda"
bs1=BlockSpecial{"/dev/sr0",0,0}
bs2=BlockSpecial{"/dev/sda",0,0}
test_BlockSpecial.cc:250: Failure
Value of: bs1.m_major != bs2.m_major || bs1.m_minor != bs2.m_minor
Actual: false
Expected: true
[ FAILED ] BlockSpecialTest.TwoNamedBlockSpecialObjectBlockDevices (1 ms)
Contents of /proc/partitions inside the Docker image when this test CI
job failed:
$ cat /proc/partitions
major minor #blocks name
11 0 1048575 sr0
8 0 573367448 sda
8 1 573366407 sda1
And the listing of /dev/:
$ ls -l /dev/
total 0
lrwxrwxrwx 1 root root 11 Mar 3 09:00 core -> /proc/kcore
lrwxrwxrwx 1 root root 13 Mar 3 09:00 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 Mar 3 09:00 full
drwxrwxrwt 2 root root 40 Mar 3 09:00 mqueue
crw-rw-rw- 1 root root 1, 3 Mar 3 09:00 null
lrwxrwxrwx 1 root root 8 Mar 3 09:00 ptmx -> pts/ptmx
drwxr-xr-x 2 root root 0 Mar 3 09:00 pts
crw-rw-rw- 1 root root 1, 8 Mar 3 09:00 random
drwxrwxrwt 2 root root 40 Mar 3 09:00 shm
lrwxrwxrwx 1 root root 15 Mar 3 09:00 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 Mar 3 09:00 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 Mar 3 09:00 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root root 5, 0 Mar 3 09:00 tty
crw-rw-rw- 1 root root 1, 9 Mar 3 09:00 urandom
crw-rw-rw- 1 root root 1, 5 Mar 3 09:00 zero
See how the test_BlockSpecial fixtures are getting major=0 and minor=0
for the block special devices they are testing with. This is happening
because there aren't any entries in /dev for those disks and partitions
listed in /proc/partitions. Assume that Docker in GNOME GitLab has
changed and that unneeded and unwanted devices in /dev are no longer
being created inside images.
In the test CI jobs execute new script, tests/makedev.sh, to create just
the first two block special devices mentioned in /proc/partitions needed
by test_BlockSpecial.
Closes !59 - Fix GNOME GitLab CI test job failures because of missing
/dev entries
2020-03-08 03:34:15 -06:00
|
|
|
# Create needed /dev entries for unit tests in Docker images.
|
|
|
|
- tests/makedev.sh
|
2018-06-22 05:56:01 -06:00
|
|
|
- make check
|
2018-07-06 04:28:55 -06:00
|
|
|
- make distcheck
|
2021-03-08 08:40:43 -07:00
|
|
|
- fgrep -v nodev /proc/filesystems | sort
|
2019-12-03 07:08:06 -07:00
|
|
|
# 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
|
2018-06-23 06:28:57 -06:00
|
|
|
|
2022-06-16 05:01:12 -06:00
|
|
|
# Check GParted can be built and installed on Alpine Linux, CentOS and Ubuntu.
|
|
|
|
alpine_build:
|
|
|
|
<<: *alpine_image_definition
|
|
|
|
<<: *build_stage_definition
|
|
|
|
|
2018-06-23 06:28:57 -06:00
|
|
|
centos_build:
|
|
|
|
<<: *centos_image_definition
|
|
|
|
<<: *build_stage_definition
|
|
|
|
|
2018-06-23 06:47:43 -06:00
|
|
|
ubuntu_build:
|
|
|
|
<<: *ubuntu_image_definition
|
|
|
|
<<: *build_stage_definition
|
|
|
|
|
2022-06-16 06:47:28 -06:00
|
|
|
# Check GParted unit tests and distcheck pass on Alpine Linux, CentOS and
|
|
|
|
# Ubuntu.
|
|
|
|
alpine_test:
|
|
|
|
<<: *alpine_image_definition
|
|
|
|
<<: *test_stage_definition
|
|
|
|
|
2018-06-23 06:28:57 -06:00
|
|
|
centos_test:
|
|
|
|
<<: *centos_image_definition
|
|
|
|
<<: *test_stage_definition
|
2018-06-24 06:51:21 -06:00
|
|
|
|
|
|
|
ubuntu_test:
|
|
|
|
<<: *ubuntu_image_definition
|
|
|
|
<<: *test_stage_definition
|