pkg/archive: TestUntarParentPathPermissions requires root

=== RUN   TestUntarParentPathPermissions
    archive_unix_test.go:171: assertion failed: error is not nil: chown /tmp/TestUntarParentPathPermissions694189715/foo: operation not permitted

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
(cherry picked from commit f23c1c297d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Shengjing Zhu 2021-02-27 21:52:03 +08:00 committed by Sebastiaan van Stijn
parent 363e9a88a1
commit a0670c6d3d
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -160,6 +160,7 @@ func TestTarWithHardLinkAndRebase(t *testing.T) {
// TestUntarParentPathPermissions is a regression test to check that missing
// parent directories are created with the expected permissions
func TestUntarParentPathPermissions(t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
buf := &bytes.Buffer{}
w := tar.NewWriter(buf)
err := w.WriteHeader(&tar.Header{Name: "foo/bar"})