Skip to content

Commit 8033a83

Browse files
authored
Merge pull request #964 from zhaoleidd/test_fix
UNITTEST: Bypass userns test on platform without userns support
2 parents fb22165 + bac8b4f commit 8033a83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libcontainer/configs/validate/validator_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ func TestValidateSecurityWithoutNEWNS(t *testing.T) {
148148
}
149149

150150
func TestValidateUsernamespace(t *testing.T) {
151+
if _, err := os.Stat("/proc/self/ns/user"); os.IsNotExist(err) {
152+
t.Skip("userns is unsupported")
153+
}
151154
config := &configs.Config{
152155
Rootfs: "/var",
153156
Namespaces: configs.Namespaces(

0 commit comments

Comments
 (0)