diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-08-31 18:34:26 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-08-31 18:34:26 +0000 |
commit | d4af01f11403fbebe340f73570b19ec8d16ce576 (patch) | |
tree | 70b1ce7d76d4f758d394f943f5b93299adac87c2 | |
parent | 0a432b1d53f4280838c59425f051edb2bd3bb9a2 (diff) | |
parent | 872216fd37058c09750fa8850e166f16fc8143ad (diff) | |
download | interfaces-d4af01f11403fbebe340f73570b19ec8d16ce576.tar.gz |
Merge "Keymaster: update the verifyAuthorization call time and delta time in VerificationToken VTS" into stage-aosp-rvc-ts-dev am: 9ade092595 am: 872216fd37
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12430970
Change-Id: Iac9f5eecb887e12c768fdea48b940c779ec4fa5b
-rw-r--r-- | keymaster/4.0/vts/functional/VerificationTokenTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/keymaster/4.0/vts/functional/VerificationTokenTest.cpp b/keymaster/4.0/vts/functional/VerificationTokenTest.cpp index bab1439584..4f0a7a3a14 100644 --- a/keymaster/4.0/vts/functional/VerificationTokenTest.cpp +++ b/keymaster/4.0/vts/functional/VerificationTokenTest.cpp @@ -111,19 +111,19 @@ TEST_P(VerificationTokenTest, TestCreation) { EXPECT_GE(host_time_delta, time_to_sleep) << "We slept for " << time_to_sleep << " ms, the clock must have advanced by that much"; - EXPECT_LE(host_time_delta, time_to_sleep + 20) + EXPECT_LE(host_time_delta, time_to_sleep + 100) << "The verifyAuthorization call took " << (host_time_delta - time_to_sleep) << " ms? That's awful!"; auto km_time_delta = result2.token.timestamp - result1.token.timestamp; // If not too much else is going on on the system, the time delta should be quite close. Allow - // 2 ms of slop just to avoid test flakiness. + // 20 ms of slop just to avoid test flakiness. // // TODO(swillden): see if we can output values so they can be gathered across many runs and // report if times aren't nearly always <1ms apart. - EXPECT_LE(host_time_delta, km_time_delta + 2); - EXPECT_LE(km_time_delta, host_time_delta + 2); + EXPECT_LE(host_time_delta, km_time_delta + 20); + EXPECT_LE(km_time_delta, host_time_delta + 20); ASSERT_EQ(result1.token.mac.size(), result2.token.mac.size()); ASSERT_NE(0, memcmp(result1.token.mac.data(), result2.token.mac.data(), result1.token.mac.size())); @@ -172,14 +172,14 @@ TEST_P(VerificationTokenTest, MacChangesOnChangingTimestamp) { EXPECT_GE(host_time_delta, time_to_sleep) << "We slept for " << time_to_sleep << " ms, the clock must have advanced by that much"; - EXPECT_LE(host_time_delta, time_to_sleep + 20) + EXPECT_LE(host_time_delta, time_to_sleep + 100) << "The verifyAuthorization call took " << (host_time_delta - time_to_sleep) << " ms? That's awful!"; auto km_time_delta = result2.token.timestamp - result1.token.timestamp; - EXPECT_LE(host_time_delta, km_time_delta + 2); - EXPECT_LE(km_time_delta, host_time_delta + 2); + EXPECT_LE(host_time_delta, km_time_delta + 20); + EXPECT_LE(km_time_delta, host_time_delta + 20); ASSERT_EQ(result1.token.mac.size(), result2.token.mac.size()); ASSERT_NE(0, memcmp(result1.token.mac.data(), result2.token.mac.data(), result1.token.mac.size())); |