Skip to content

Fix TestMount under a selinux system#34965

Merged
vdemeester merged 1 commit intomoby:masterfrom
vdemeester:fix-pkg-mount-unit-test-under-selinux
Sep 26, 2017
Merged

Fix TestMount under a selinux system#34965
vdemeester merged 1 commit intomoby:masterfrom
vdemeester:fix-pkg-mount-unit-test-under-selinux

Conversation

@vdemeester
Copy link
Copy Markdown
Member

master builds are red under Fedora and Centos since.. a lot while (~4months) 😱
The reason is :

19:09:52 --- FAIL: TestMount (0.14s)
19:09:52     --- FAIL: TestMount/none-remount,size=128k (0.01s)
19:09:52     	mounter_linux_test.go:203: unexpected mount option "seclabel" expected "rw,size=128k"
19:09:52     --- FAIL: TestMount/none-remount,ro,size=128k (0.01s)
19:09:52     	mounter_linux_test.go:203: unexpected mount option "seclabel" expected "ro,size=128k"
19:09:52 FAIL
19:09:52 coverage: 69.3% of statements

This fixes that by taking into account if SELinux is activated or not.

Signed-off-by: Vincent Demeester [email protected]

Signed-off-by: Vincent Demeester <[email protected]>
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdemeester vdemeester merged commit 41313c8 into moby:master Sep 26, 2017
@vdemeester vdemeester deleted the fix-pkg-mount-unit-test-under-selinux branch September 26, 2017 06:37
kolyshkin added a commit to kolyshkin/moby that referenced this pull request May 23, 2018
Sometimes docker-master CI fails on rhel4+selinux configuration,
like this:

--- FAIL: TestMount (0.12s)
    --- FAIL: TestMount/none-remount,size=128k (0.01s)
    	mounter_linux_test.go:209: unexpected mount option "seclabel" expected "rw,size=128k"
    --- FAIL: TestMount/none-remount,ro,size=128k (0.01s)
    	mounter_linux_test.go:209: unexpected mount option "seclabel" expected "ro,size=128k"

Earlier, commit 8bebd42 (PR moby#34965) fixed this failure,
but not entirely (i.e. the test is now flaky). It looks like
either selinux detection code is not always working (it won't
work in d-in-d), or the kernel might or might not add 'seclabel'
option).

As the subject of this test case is definitely not selinux,
it can just ignore the option added by it.

While at it, fix error messages:
 - add missing commas;
 - fix a typo;
 - allow for clear distinction between mount
   and vfs (per-superblock) options.

Signed-off-by: Kir Kolyshkin <[email protected]>

Signed-off-by: Kir Kolyshkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants