forked from dotnet/macios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[d16-9] [monotouch-test] Rework big parts of KeyChainTest. Fixes #xam…
…arin/maccore@2365. (dotnet#10603) * [monotouch-test] Rework big parts of KeyChainTest. Fixes #xamarin/maccore@2365. 'GenericPassword' keychain items are unique by their Service+Account properties [1]. This means that changing the Label property will not create a different 'GenericPassword', which has a few consequences: * It's possible to filter (and try to delete) using the Label property. * It's possible to try to delete a 'GenericPassword' item, and have that deletion attempt fail with 'no item found', and then subsequently trying to add the same item will fail with a DuplicateItem, because the deletion was filtered using the Label property. The change I've made is to: * Make the Label property much more descriptive, and unique per process. This makes it easier to figure out where things come from in the Keychain Access app. * Make the Service property unique per process. This way these tests are parallel safe and they won't stomp on eachother. * Keep the Account property the same (a constant value), so that it's easy to filter to just these items in the Keychain Access app. * Remove the Label property from all queries, it doesn't matter anyway. The Label property is still set when adding items to the keychain. Finally try to clean up after ourselves as good as possible. This way we don't fill the keychain with test stuff. This involves removing certificates and passwords we add to the keychain at the end of tests. Fixes xamarin/maccore#2365. [1]: https://stackoverflow.com/a/11672200/183422 * Adjust query for RecordTest.AuthenticationType as well to not include fields that don't determine uniqueness. Also make the InternetPassword items we add to the keychain more descriptive and labelled helpfully. * Add debug code. * Revert "Add debug code." This reverts commit a3edac8. Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
- Loading branch information
1 parent
d60da8d
commit 982821c
Showing
2 changed files
with
91 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters