diff --git a/internal/restic/node_test.go b/internal/restic/node_test.go index 7991d33e0..642beadc5 100644 --- a/internal/restic/node_test.go +++ b/internal/restic/node_test.go @@ -197,6 +197,20 @@ var nodeTests = []Node{ {"user.foo", []byte("bar")}, }, }, + { + Name: "testXattrFileMacOSResourceFork", + Type: "file", + Content: IDs{}, + UID: uint32(os.Getuid()), + GID: uint32(os.Getgid()), + Mode: 0604, + ModTime: parseTime("2005-05-14 21:07:03.111"), + AccessTime: parseTime("2005-05-14 21:07:04.222"), + ChangeTime: parseTime("2005-05-14 21:07:05.333"), + ExtendedAttributes: []ExtendedAttribute{ + {"com.apple.ResourceFork", []byte("bar")}, + }, + }, } func TestNodeRestoreAt(t *testing.T) { @@ -216,6 +230,11 @@ func TestNodeRestoreAt(t *testing.T) { extAttrArr[i].Name = strings.ToUpper(extAttrArr[i].Name) } } + for _, attr := range test.ExtendedAttributes { + if strings.HasPrefix(attr.Name, "com.apple.") && runtime.GOOS != "darwin" { + t.Skipf("attr %v only relevant on macOS", attr.Name) + } + } // tempdir might be backed by a filesystem that does not support // extended attributes