diff options
author | Andrew Scull <ascull@google.com> | 2018-05-17 15:35:37 +0100 |
---|---|---|
committer | Andrew Scull <ascull@google.com> | 2018-05-17 15:35:37 +0100 |
commit | 8681d82e3b25f5ad8c999a1344112c411bcb52bc (patch) | |
tree | e66d7787cb410638c3cf3ceccb39edd57fc09c74 /src/avb_tests.cc | |
parent | ba73bf179d69d295fd027ea00010755b03a09f89 (diff) | |
parent | 17c121be517f8339dff32b4385a54378ac113430 (diff) | |
download | system-test-harness-8681d82e3b25f5ad8c999a1344112c411bcb52bc.tar.gz |
Merge remote-tracking branch 'goog/upstream-master' into merge-citadel-pre-1.0.0
* goog/upstream-master:
keymaster: set-root-of-trust before tests will run
keymaster: remove support for p224, p384, p521
keymaster: update max hmac key size
Don't sleep to wait for reboot
AVB: resetting production triggers a reboot
Use only the release tests on Android
Push integration tests to /data
Add a strawman script that validates release images
Only apply the test filter if necessary
Introduce a --release_tests flag
AVB: test setting device and boot lock is idempotent
Fix cavptests build
Wait a little longer for Citadel to sleep
Use full stats to detect reboot, not 32-bit time
Soft Reboot is really Deep Sleep so call it that
Implement nugget_tools::WaitForSleep()
Keymaster: test provisioning when MEID not set
Test: manual -- boot, set and change credential
Test: selected CTS and VTS tests from release-tests.sh
Bug: 79416307
Change-Id: Ib1ea6ed1d95f637f2bc0b02ee6783655135aa891
Diffstat (limited to 'src/avb_tests.cc')
-rw-r--r-- | src/avb_tests.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/avb_tests.cc b/src/avb_tests.cc index 3cc22f5..14aa01c 100644 --- a/src/avb_tests.cc +++ b/src/avb_tests.cc @@ -433,6 +433,7 @@ TEST_F(AvbTest, DeviceLockTest) // Test can set lock ResetProduction(client.get()); + SetBootloader(); code = SetDeviceLock(0x34); ASSERT_NO_ERROR(code, ""); @@ -457,6 +458,11 @@ TEST_F(AvbTest, DeviceLockTest) ASSERT_EQ(locks[DEVICE], 0x00); } +TEST_F(AvbTest, SetDeviceLockIsIdempotent) { + ASSERT_NO_ERROR(SetDeviceLock(0x65), ""); + ASSERT_NO_ERROR(SetDeviceLock(0x65), ""); +} + TEST_F(AvbTest, BootLockTest) { uint8_t locks[4]; @@ -498,6 +504,7 @@ TEST_F(AvbTest, BootLockTest) ASSERT_NO_ERROR(code, ""); // Can lock when carrier lock is set. + SetBootloader(); code = SetBootLock(0x56); ASSERT_NO_ERROR(code, ""); @@ -519,6 +526,7 @@ TEST_F(AvbTest, BootLockTest) ASSERT_NO_ERROR(code, ""); code = SetProduction(client.get(), true, NULL, 0); ASSERT_NO_ERROR(code, ""); + SetBootloader(); // Need to be in the HLOS. code = SetDeviceLock(0x78); @@ -543,6 +551,11 @@ TEST_F(AvbTest, BootLockTest) ASSERT_EQ(locks[BOOT], 0x9A); } +TEST_F(AvbTest, SetBootLockIsIdempotent) { + ASSERT_NO_ERROR(SetBootLock(0x12), ""); + ASSERT_NO_ERROR(SetBootLock(0x12), ""); +} + TEST_F(AvbTest, OwnerLockTest) { uint8_t owner_key[AVB_METADATA_MAX_SIZE]; |