Davide Pesavento | 534b841 | 2018-12-08 19:19:09 -0500 | [diff] [blame] | 1 | In tests, we set a test-specific HOME, which causes macOS Keychain to look for |
| 2 | the default keychain of a "different" user. If the default keychain does not |
| 3 | exist, all subsequent calls to macOS Keychain will fail. User interaction |
| 4 | (such as entering the password) is required to create a keychain. However, |
| 5 | user interaction is not feasible in automated tests. |
| 6 | |
| 7 | This problem is caused by macOS's assumption that a user must have a login |
| 8 | keychain, which is also the user's default keychain, because a user account is |
| 9 | always created with a login keychain by default. Thus, macOS infers the user |
| 10 | according to the HOME env, and does not expect the user to change the HOME env |
| 11 | during normal use. |