mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
Disable UID/GID/mode/symlink tests on Windows.
Mode will not match the unix mode, since it can only partially be represented. UID/GID are not relevant on Windows. Symlinks cannot be created by non-admins on Windows.
This commit is contained in:
parent
8d419713de
commit
3a4c02912a
1 changed files with 12 additions and 7 deletions
19
node_test.go
19
node_test.go
|
@ -119,6 +119,9 @@ func TestNodeRestoreAt(t *testing.T) {
|
|||
nodePath := filepath.Join(tempdir, test.Name)
|
||||
OK(t, test.CreateAt(nodePath, nil))
|
||||
|
||||
if test.Type == "symlink" && runtime.GOOS == "windows" {
|
||||
continue
|
||||
}
|
||||
if test.Type == "dir" {
|
||||
OK(t, test.RestoreTimestamps(nodePath))
|
||||
}
|
||||
|
@ -135,14 +138,16 @@ func TestNodeRestoreAt(t *testing.T) {
|
|||
"%v: type doesn't match (%v != %v)", test.Type, test.Type, n2.Type)
|
||||
Assert(t, test.Size == n2.Size,
|
||||
"%v: size doesn't match (%v != %v)", test.Size, test.Size, n2.Size)
|
||||
Assert(t, test.UID == n2.UID,
|
||||
"%v: UID doesn't match (%v != %v)", test.Type, test.UID, n2.UID)
|
||||
Assert(t, test.GID == n2.GID,
|
||||
"%v: GID doesn't match (%v != %v)", test.Type, test.GID, n2.GID)
|
||||
|
||||
if test.Type != "symlink" {
|
||||
Assert(t, test.Mode == n2.Mode,
|
||||
"%v: mode doesn't match (%v != %v)", test.Type, test.Mode, n2.Mode)
|
||||
if runtime.GOOS != "windows" {
|
||||
Assert(t, test.UID == n2.UID,
|
||||
"%v: UID doesn't match (%v != %v)", test.Type, test.UID, n2.UID)
|
||||
Assert(t, test.GID == n2.GID,
|
||||
"%v: GID doesn't match (%v != %v)", test.Type, test.GID, n2.GID)
|
||||
if test.Type != "symlink" {
|
||||
Assert(t, test.Mode == n2.Mode,
|
||||
"%v: mode doesn't match (%v != %v)", test.Type, test.Mode, n2.Mode)
|
||||
}
|
||||
}
|
||||
|
||||
AssertFsTimeEqual(t, "AccessTime", test.Type, test.AccessTime, n2.AccessTime)
|
||||
|
|
Loading…
Add table
Reference in a new issue