Home
last modified time | relevance | path

Searched refs:mKeyDao (Results 1 – 9 of 9) sorted by relevance

/packages/modules/RemoteKeyProvisioning/app/tests/unit/src/com/android/rkpdapp/unittest/
DRkpdDatabaseTest.java63 private ProvisionedKeyDao mKeyDao; field in RkpdDatabaseTest
70 mKeyDao = mDatabase.provisionedKeyDao(); in setUp()
71 mKeyDao.deleteAllKeys(); in setUp()
85 mKeyDao.insertKeys(List.of(mProvisionedKey1)); in testWriteToTable()
86 List<ProvisionedKey> keysInDatabase = mKeyDao.getAllKeys(); in testWriteToTable()
95 mKeyDao.insertKeys(List.of(mProvisionedKey1, mProvisionedKey2)); in testOverwriteConflict()
101 List<ProvisionedKey> unassignedKeys = mKeyDao.getAllKeys(); in testOverwriteConflict()
110 mKeyDao.insertKeys(List.of(mProvisionedKey1, mProvisionedKey2)); in testRemovingExpiredKeyFromTable()
112 List<ProvisionedKey> keysInDatabase = mKeyDao.getAllKeys(); in testRemovingExpiredKeyFromTable()
115 mKeyDao.deleteExpiringKeys(Instant.now()); in testRemovingExpiredKeyFromTable()
[all …]
DProvisionerTest.java77 private ProvisionedKeyDao mKeyDao; field in ProvisionerTest
88 mKeyDao = RkpdDatabase.getDatabase(sContext).provisionedKeyDao(); in setUp()
89 mKeyDao.deleteAllKeys(); in setUp()
91 mProvisioner = new Provisioner(sContext, mKeyDao, false); in setUp()
182 mKeyDao.insertKeys(List.of(keyBeforeFailure, keyBadCert, keyAfterFailure)); in setUpClearAttestationKeyTests()
192 assertThat(mKeyDao.getAllKeys()).hasSize(3); in testProvisionerClearsAttestationKeysOnResponse()
200 assertThat(mKeyDao.getAllKeys()).hasSize(2); in testProvisionerClearsAttestationKeysOnResponse()
210 assertThat(mKeyDao.getAllKeys()).hasSize(3); in testProvisionerClearsAttestationKeysOnlyOnce()
219 assertThat(mKeyDao.getAllKeys()).hasSize(3); in testProvisionerClearsAttestationKeysOnlyOnce()
DStatsProcessorTest.java42 private ProvisionedKeyDao mKeyDao; field in StatsProcessorTest
46 mKeyDao = mock(ProvisionedKeyDao.class); in setUp()
66 when(mKeyDao.getTotalUnassignedKeysForIrpc(anyString())).thenReturn(unassigned); in testMinUnassignedBoundary()
250 when(mKeyDao.getTotalKeysForIrpc(anyString())).thenReturn(totalKeys); in prepareStats()
251 when(mKeyDao.getTotalUnassignedKeysForIrpc(anyString())).thenReturn(unassignedKeys); in prepareStats()
252 when(mKeyDao.getTotalExpiringKeysForIrpc(anyString(), notNull())).thenReturn(expiringKeys); in prepareStats()
253 return StatsProcessor.processPool(mKeyDao, SERVICE_NAME, numExtraKeys, Instant.now()); in prepareStats()
/packages/modules/RemoteKeyProvisioning/app/tests/avf/src/com/android/avf/rkpdapp/e2etest/
DAvfIntegrationTest.java69 private ProvisionedKeyDao mKeyDao; field in AvfIntegrationTest
89 mKeyDao = RkpdDatabase.getDatabase(getContext()).provisionedKeyDao(); in setUp()
90 mKeyDao.deleteAllKeys(); in setUp()
107 if (mKeyDao != null) { in tearDown()
108 mKeyDao.deleteAllKeys(); in tearDown()
120 .that(mKeyDao.getTotalKeysForIrpc(SERVICE_NAME)) in provisioningSucceeds()
125 int totalUnassignedKeys = mKeyDao.getTotalUnassignedKeysForIrpc(SERVICE_NAME); in provisioningSucceeds()
131 mKeyDao.getKeyForClientAndIrpc(SERVICE_NAME, Process.SYSTEM_UID, Process.myUid()); in provisioningSucceeds()
135 mKeyDao.getOrAssignKey( in provisioningSucceeds()
142 .that(mKeyDao.getTotalUnassignedKeysForIrpc(SERVICE_NAME)) in provisioningSucceeds()
/packages/modules/RemoteKeyProvisioning/app/tests/e2e/src/com/android/rkpdapp/e2etest/
DKeystoreIntegrationTest.java94 private ProvisionedKeyDao mKeyDao; field in KeystoreIntegrationTest
136 mKeyDao = RkpdDatabase.getDatabase(sContext).provisionedKeyDao(); in setUp()
139 mKeyDao.deleteAllKeys(); in setUp()
150 if (mKeyDao != null) { in tearDown()
152 mKeyDao.deleteAllKeys(); in tearDown()
168 assertThat(mKeyDao.getTotalKeysForIrpc(mServiceName)).isGreaterThan(0); in testKeyCreationUsesRemotelyProvisionedCertificate()
169 assertThat(mKeyDao.getKeyForClientAndIrpc(mServiceName, Process.KEYSTORE_UID, in testKeyCreationUsesRemotelyProvisionedCertificate()
177 assertThat(mKeyDao.getTotalKeysForIrpc(mServiceName)).isEqualTo(0); in testKeyCreationWithEmptyKeyPool()
188 mKeyDao.getOrAssignKey(mServiceName, Instant.now(), Process.KEYSTORE_UID, Process.myUid()); in testKeyCreationUsesAlreadyAssignedKey()
190 ProvisionedKey attestationKey = mKeyDao.getKeyForClientAndIrpc(mServiceName, in testKeyCreationUsesAlreadyAssignedKey()
[all …]
DRkpdHostTestHelperTests.java68 private ProvisionedKeyDao mKeyDao; field in RkpdHostTestHelperTests
104 mKeyDao = RkpdDatabase.getDatabase(sContext).provisionedKeyDao(); in setUp()
105 mKeyDao.deleteAllKeys(); in setUp()
121 if (mKeyDao != null) { in tearDown()
122 mKeyDao.deleteAllKeys(); in tearDown()
157 List<ProvisionedKey> keys = mKeyDao.getAllKeys(); in provisionThenExpireThenProvisionAgain()
161 mKeyDao.updateKey(keys.get(0)); in provisionThenExpireThenProvisionAgain()
166 mKeyDao.updateKey(keys.get(i)); in provisionThenExpireThenProvisionAgain()
178 StatsProcessor.PoolStats pool = StatsProcessor.processPool(mKeyDao, mServiceName, in testPeriodicProvisionerNoop()
185 StatsProcessor.PoolStats updatedPool = StatsProcessor.processPool(mKeyDao, mServiceName, in testPeriodicProvisionerNoop()
/packages/modules/RemoteKeyProvisioning/app/src/com/android/rkpdapp/provisioner/
DPeriodicProvisioner.java56 private final ProvisionedKeyDao mKeyDao; field in PeriodicProvisioner
62 mKeyDao = RkpdDatabase.getDatabase(context).provisionedKeyDao(); in PeriodicProvisioner()
111 mKeyDao.deleteExpiringKeys(Instant.now());
127 mKeyDao.deleteAllKeys();
133 Provisioner provisioner = new Provisioner(mContext, mKeyDao, IS_ASYNC);
157 final int numExpiring = mKeyDao.getTotalExpiringKeysForIrpc(halName,
159 final int numUnassigned = mKeyDao.getTotalUnassignedKeysForIrpc(halName);
160 final int total = mKeyDao.getTotalKeysForIrpc(halName);
DProvisioner.java56 private final ProvisionedKeyDao mKeyDao; field in Provisioner
62 mKeyDao = keyDao; in Provisioner()
98 mKeyDao.insertKeys(keys); in provisionKeys()
196 StatsProcessor.PoolStats poolStats = StatsProcessor.processPool(mKeyDao, serviceName, in calculateKeysRequired()
231 List<ProvisionedKey> allKeys = mKeyDao.getAllKeys(); in checkAndDeleteBadKeys()
240 mKeyDao.deleteKey(key.keyBlob); in checkAndDeleteBadKeys()
/packages/modules/RemoteKeyProvisioning/app/tests/stress/src/com/android/rkpdapp/stress/
DRegistrationBinderStressTest.java63 private ProvisionedKeyDao mKeyDao; field in RegistrationBinderStressTest
80 mKeyDao = RkpdDatabase.getDatabase(mContext).provisionedKeyDao(); in setUp()
81 mKeyDao.deleteAllKeys(); in setUp()
86 return new RegistrationBinder(mContext, Process.myUid(), mIrpcHal, mKeyDao, in createRegistrationBinder()
87 new ServerInterface(mContext, isAsync), new Provisioner(mContext, mKeyDao, isAsync), in createRegistrationBinder()
147 ProvisionedKey key = mKeyDao.getKeyForClientAndIrpc(mIrpcHal.getServiceName(), in testGetSameKeyInParallel()
152 mKeyDao.updateKey(key); in testGetSameKeyInParallel()