1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 09:18:55 +00:00

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

View file

@ -2085,6 +2085,10 @@ func TestMetadataChanged(t *testing.T) {
// make another snapshot // make another snapshot
snapshotID, node3 := snapshot(t, repo, fs, snapshotID, "testfile") 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 // make sure that metadata was recorded successfully
if !cmp.Equal(want, node3) { if !cmp.Equal(want, node3) {