Ignore username difference in TestMetadataChanged.

In some (rare) cases "fake" UID 51234 may exist in a system running a
test. When this is the case, `cmp.Equal(want, node3)` will fail based on
difference between empty string and an actual username present in a
system.

Fixes github issue #2372
This commit is contained in:
Vladimir Rusinov 2019-08-13 22:25:00 +01:00
parent 604b18aa74
commit db20c0b8d0
1 changed files with 4 additions and 0 deletions

View File

@ -2085,6 +2085,10 @@ func TestMetadataChanged(t *testing.T) {
// make another snapshot
snapshotID, node3 := snapshot(t, repo, fs, snapshotID, "testfile")
// Override username and group to empty string - in case underlying system has user with UID 51234
// See https://github.com/restic/restic/issues/2372
node3.User = ""
node3.Group = ""
// make sure that metadata was recorded successfully
if !cmp.Equal(want, node3) {