Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a90e5f07 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "RebootEscrow HAL: testing with secure implementations" into rvc-dev am: 2519e6d0

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/11953060

Change-Id: Id72b8ebfa8b4d985e2020d256bc405d98378a5d7
parents 39963aef 2519e6d0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
Many of the tests in this directory may require that TEE Keymaster
"EARLY_BOOT_ONLY" keys be usable when this test runs. In order to accomplish
this, a build of "vold" that omits the call to "earlyBootEnded()" function
should be made. Then these DISABLED tests may be run successfully.

The CTS test ResumeOnRebootHostTests will test the functionality without a
special build.
+22 −4
Original line number Diff line number Diff line
@@ -60,7 +60,10 @@ class RebootEscrowAidlTest : public testing::TestWithParam<std::string> {
    };
};

TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_Success) {
// This test assumes that it can retrieve keys immediately, but some
// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the
// earlyBootEnded() calls will need to be disabled to test this correctly.
TEST_P(RebootEscrowAidlTest, DISABLED_StoreAndRetrieve_Success) {
    SKIP_UNSUPPORTED;

    ASSERT_TRUE(rebootescrow->storeKey(KEY_1).isOk());
@@ -70,7 +73,10 @@ TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_Success) {
    EXPECT_EQ(actualKey, KEY_1);
}

TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_SecondRetrieveSucceeds) {
// This test assumes that it can retrieve keys immediately, but some
// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the
// earlyBootEnded() calls will need to be disabled to test this correctly.
TEST_P(RebootEscrowAidlTest, DISABLED_StoreAndRetrieve_SecondRetrieveSucceeds) {
    SKIP_UNSUPPORTED;

    ASSERT_TRUE(rebootescrow->storeKey(KEY_1).isOk());
@@ -83,7 +89,10 @@ TEST_P(RebootEscrowAidlTest, StoreAndRetrieve_SecondRetrieveSucceeds) {
    EXPECT_EQ(actualKey, KEY_1);
}

TEST_P(RebootEscrowAidlTest, StoreTwiceOverwrites_Success) {
// This test assumes that it can retrieve keys immediately, but some
// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the
// earlyBootEnded() calls will need to be disabled to test this correctly.
TEST_P(RebootEscrowAidlTest, DISABLED_StoreTwiceOverwrites_Success) {
    SKIP_UNSUPPORTED;

    ASSERT_TRUE(rebootescrow->storeKey(KEY_1).isOk());
@@ -94,7 +103,10 @@ TEST_P(RebootEscrowAidlTest, StoreTwiceOverwrites_Success) {
    EXPECT_EQ(actualKey, KEY_2);
}

TEST_P(RebootEscrowAidlTest, StoreEmpty_AfterGetEmptyKey_Success) {
// This test assumes that it can retrieve keys immediately, but some
// implementations use the TEE's EARLY_BOOT_ONLY keys. This means that the
// earlyBootEnded() calls will need to be disabled to test this correctly.
TEST_P(RebootEscrowAidlTest, DISABLED_StoreEmpty_AfterGetEmptyKey_Success) {
    SKIP_UNSUPPORTED;

    rebootescrow->storeKey(KEY_1);
@@ -105,6 +117,12 @@ TEST_P(RebootEscrowAidlTest, StoreEmpty_AfterGetEmptyKey_Success) {
    EXPECT_EQ(actualKey, EMPTY_KEY);
}

TEST_P(RebootEscrowAidlTest, Store_Success) {
    SKIP_UNSUPPORTED;

    rebootescrow->storeKey(KEY_1);
}

INSTANTIATE_TEST_SUITE_P(
        RebootEscrow, RebootEscrowAidlTest,
        testing::ValuesIn(android::getAidlHalInstanceNames(IRebootEscrow::descriptor)),