Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: work around issue with user.Lookup not returning UnknownUserError (
#427) Per golang/go#67912, under some circumstances (on my machine) user.Lookup isn't returning UnknownUserError when it should. So before this fix I get the following test failures: ``` $ go test ./internals/osutil ... FAIL: user_test.go:44: userSuite.TestRealUser user_test.go:71: c.Assert(err, check.IsNil) ... value *errors.errorString = &errors.errorString{s:"user: lookup username guy: no such file or directory"} ("user: lookup username guy: no such file or directory") ... ``` And: ``` $ go test ./internals/daemon ... ---------------------------------------------------------------------- FAIL: api_files_test.go:1128: filesSuite.TestWriteErrors api_files_test.go:1195: checkFileResult(c, r.Result[4], pathUserNotFound, "generic-file-error", ".*unknown user.*") api_files_test.go:273: c.Check(r.Error.Message, Matches, errorMsg) ... value string = "cannot look up user and group: user: lookup username user-not-found: no such file or directory" ... regex string = ".*unknown user.*" api_files_test.go:1196: checkFileResult(c, r.Result[5], pathGroupNotFound, "generic-file-error", ".*unknown group.*") api_files_test.go:273: c.Check(r.Error.Message, Matches, errorMsg) ... value string = "cannot look up user and group: user: lookup groupname group-not-found: no such file or directory" ... regex string = ".*unknown group.*" ... ```
- Loading branch information