Add VSR enforcement testing for IRPC versioning.

Check the VSR API level for the device under test and ensure that the
appropriate HAL version for the IRemotelyProvisionedComponent interface
is present. E.g. a VSR 13 chipset should have IRPC v2 or newer.

Bug: 251185719
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I136cac27953d1d5acaa45510ad9efec2a75d8038
This commit is contained in:
Max Bires
2022-11-21 23:02:09 -08:00
parent 2f8a148a26
commit a9b3bb96b2

View File

@@ -783,4 +783,20 @@ TEST_P(CertificateRequestV2Test, NonEmptyRequest_testKeyInProdCert) {
INSTANTIATE_REM_PROV_AIDL_TEST(CertificateRequestV2Test);
using VsrRequirementTest = VtsRemotelyProvisionedComponentTests;
INSTANTIATE_REM_PROV_AIDL_TEST(VsrRequirementTest);
TEST_P(VsrRequirementTest, VsrEnforcementTest) {
RpcHardwareInfo hwInfo;
ASSERT_TRUE(provisionable_->getHardwareInfo(&hwInfo).isOk());
int vsr_api_level = get_vsr_api_level();
if (vsr_api_level < 34) {
GTEST_SKIP() << "Applies only to VSR API level 34 or newer, this device is: "
<< vsr_api_level;
}
EXPECT_GE(hwInfo.versionNumber, 3)
<< "VSR 14+ requires IRemotelyProvisionedComponent v3 or newer.";
}
} // namespace aidl::android::hardware::security::keymint::test