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:
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user