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 <zhaolei@cn.fujitsu.com>
This commit is contained in:
parent
bd1d3ac048
commit
bac8b4f0b4
|
@ -148,6 +148,9 @@ func TestValidateSecurityWithoutNEWNS(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestValidateUsernamespace(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{
|
config := &configs.Config{
|
||||||
Rootfs: "/var",
|
Rootfs: "/var",
|
||||||
Namespaces: configs.Namespaces(
|
Namespaces: configs.Namespaces(
|
||||||
|
|
Loading…
Reference in New Issue