Skip to content

Commit 8bebd42

Browse files
committed
Fix TestMount under a selinux system
Signed-off-by: Vincent Demeester <[email protected]>
1 parent c982ee8 commit 8bebd42

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/mount/mounter_linux_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"os"
99
"strings"
1010
"testing"
11+
12+
selinux "github.com/opencontainers/selinux/go-selinux"
1113
)
1214

1315
func TestMount(t *testing.T) {
@@ -101,7 +103,11 @@ func TestMount(t *testing.T) {
101103
t.Fatal(err)
102104
}
103105
defer ensureUnmount(t, target)
104-
validateMount(t, target, tc.expectedOpts, tc.expectedOptional, tc.expectedVFS)
106+
expectedVFS := tc.expectedVFS
107+
if selinux.GetEnabled() && expectedVFS != "" {
108+
expectedVFS = expectedVFS + ",seclabel"
109+
}
110+
validateMount(t, target, tc.expectedOpts, tc.expectedOptional, expectedVFS)
105111
})
106112
}
107113
}

0 commit comments

Comments
 (0)