From bac8b4f0b46f83537d27aeab85fa4d3e0248141f Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Mon, 25 Jul 2016 15:35:04 +0800 Subject: [PATCH] UNITTEST: Bypass userns test on platform without userns support We should bypass userns test instead of show fail in platform without userns support. Signed-off-by: Zhao Lei --- libcontainer/configs/validate/validator_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcontainer/configs/validate/validator_test.go b/libcontainer/configs/validate/validator_test.go index 991aee237..c2100d3c9 100644 --- a/libcontainer/configs/validate/validator_test.go +++ b/libcontainer/configs/validate/validator_test.go @@ -148,6 +148,9 @@ func TestValidateSecurityWithoutNEWNS(t *testing.T) { } func TestValidateUsernamespace(t *testing.T) { + if _, err := os.Stat("/proc/self/ns/user"); os.IsNotExist(err) { + t.Skip("userns is unsupported") + } config := &configs.Config{ Rootfs: "/var", Namespaces: configs.Namespaces(