Merge pull request #34965 from vdemeester/fix-pkg-mount-unit-test-under-selinux

Fix TestMount under a selinux system
Upstream-commit: 41313c87a25aec122fb43fdaf2433d1b121f1808
Component: engine
This commit is contained in:
Vincent Demeester
2017-09-26 08:37:22 +02:00
committed by GitHub
@@ -8,6 +8,8 @@ import (
"os"
"strings"
"testing"
selinux "github.com/opencontainers/selinux/go-selinux"
)
func TestMount(t *testing.T) {
@@ -101,7 +103,11 @@ func TestMount(t *testing.T) {
t.Fatal(err)
}
defer ensureUnmount(t, target)
validateMount(t, target, tc.expectedOpts, tc.expectedOptional, tc.expectedVFS)
expectedVFS := tc.expectedVFS
if selinux.GetEnabled() && expectedVFS != "" {
expectedVFS = expectedVFS + ",seclabel"
}
validateMount(t, target, tc.expectedOpts, tc.expectedOptional, expectedVFS)
})
}
}