]> git.saurik.com Git - apple/security.git/blob - RegressionTests/manifeststresstest/Monkey.h
Security-59306.11.20.tar.gz
[apple/security.git] / RegressionTests / manifeststresstest / Monkey.h
1 //
2 // Monkey.h
3 // Security
4 //
5 // Created by Ben Williamson on 6/1/17.
6 //
7 //
8
9 #import <Foundation/Foundation.h>
10
11 @class Config;
12 @class Keychain;
13
14 // A monkey has an array of items that it has created.
15 // It can randomly choose to add an item, delete an item, or update the data in an item.
16 //
17 // All items exist within the access group "manifeststresstest"
18 // which is set to have the appropriate view hint so that it syncs via CKKS.
19 //
20 // Items are generic password items, having a service, an account and data.
21 // The service, account and data values are chosen from sets of a limited size, to encourage
22 // the possibility of collisions.
23
24
25 // Adds and deletes generic password items
26
27 @interface Monkey : NSObject
28
29 @property (nonatomic, strong) Keychain *keychain; // if nil, this is a dry run
30 @property (nonatomic, assign) unsigned step;
31
32 // Incremented when we try to add an item and it already exists.
33 @property (nonatomic, assign) unsigned addDuplicateCounter;
34
35 // Incremented when we try to update or delete an item and it does not exist.
36 @property (nonatomic, assign) unsigned notFoundCounter;
37
38 // Peak number of items we have created so far.
39 @property (nonatomic, assign) unsigned peakItems;
40
41 // Current number of items written
42 @property (nonatomic, readonly) unsigned itemCount;
43
44 @property (nonatomic, readonly) Config *config;
45
46 - (instancetype)initWithConfig:(Config *)config;
47
48 - (void)advanceOneStep;
49
50 - (void)cleanup;
51
52 @end