mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix TestMount under a selinux system
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
c982ee805d
commit
8bebd42df2
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
selinux "github.com/opencontainers/selinux/go-selinux"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMount(t *testing.T) {
|
func TestMount(t *testing.T) {
|
||||||
|
@ -101,7 +103,11 @@ func TestMount(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
defer ensureUnmount(t, target)
|
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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue