diff --git a/internals/cli/cmd_add_test.go b/internals/cli/cmd_add_test.go index 9233dd7c..83db69da 100644 --- a/internals/cli/cmd_add_test.go +++ b/internals/cli/cmd_add_test.go @@ -100,10 +100,9 @@ services: } else if path == triggerLayerPath { c.Assert(err, check.ErrorMatches, "triggered") } else if path == unreadableLayerPath { - if os.Getuid() == 0 { - c.Skip("requires running as non-root users") + if os.Getuid() != 0 { + c.Assert(os.IsPermission(err), check.Equals, true) } - c.Assert(os.IsPermission(err), check.Equals, true) } } diff --git a/internals/osutil/io_test.go b/internals/osutil/io_test.go index b6c00d2a..686a9eb6 100644 --- a/internals/osutil/io_test.go +++ b/internals/osutil/io_test.go @@ -85,7 +85,7 @@ func (ts *AtomicWriteTestSuite) TestAtomicWriteFileSymlinkNoFollow(c *C) { defer os.Chmod(rodir, 0700) if os.Getuid() == 0 { - c.Skip("requires running as non-root users") + c.Skip("requires running as non-root user") } err := osutil.AtomicWriteFile(p, []byte("hi"), 0600, 0) c.Assert(err, NotNil) diff --git a/internals/osutil/stat_test.go b/internals/osutil/stat_test.go index b90dad57..51393e06 100644 --- a/internals/osutil/stat_test.go +++ b/internals/osutil/stat_test.go @@ -110,7 +110,7 @@ func makeTestPathInDir(c *C, dir string, path string, mode os.FileMode) string { func (s *StatTestSuite) TestIsWritableDir(c *C) { if os.Getuid() == 0 { - c.Skip("requires running as non-root users") + c.Skip("requires running as non-root user") } for _, t := range []struct { @@ -185,7 +185,7 @@ func (s *StatTestSuite) TestExistsIsDir(c *C) { } if os.Getuid() == 0 { - c.Skip("requires running as non-root users") + c.Skip("requires running as non-root user") } p := makeTestPath(c, "foo/bar", 0) c.Assert(os.Chmod(filepath.Dir(p), 0), IsNil)