Fix TestMount under a selinux system

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2017-09-25 10:42:20 +02:00
parent c982ee805d
commit 8bebd42df2
No known key found for this signature in database
GPG Key ID: 083CC6FD6EB699A3
1 changed files with 7 additions and 1 deletions

View File

@ -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)
})
}
}