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
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index cb1c692..aebcf67 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -783,4 +783,20 @@
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