From 1bcb602b8541ed2f7f432343e20d8699b3b914e4 Mon Sep 17 00:00:00 2001 From: Andrew Scull Date: Tue, 27 Dec 2022 10:43:27 +0000 Subject: [PATCH] Check for failures in base SetUp() If the base set up fails, the RKP version number might not be valid so we shouldn't try to work out whether the test should be skipped based on the version. Assert that there weren't any fatal errors from the base set up rather than reporting that the test should be skipped as that can be a bit confusing. Test: atest VtsHalRemotelyProvisionedComponentTargetTest Change-Id: Icaf946ef4cf6b31dcfe7187131538b9eb3892798 --- .../vts/functional/VtsRemotelyProvisionedComponentTests.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp index aebcf672ca..ea24ea45df 100644 --- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp +++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp @@ -390,6 +390,7 @@ class CertificateRequestTest : public CertificateRequestTestBase { protected: void SetUp() override { CertificateRequestTestBase::SetUp(); + ASSERT_FALSE(HasFatalFailure()); if (rpcHardwareInfo.versionNumber >= VERSION_WITHOUT_TEST_MODE) { bytevec keysToSignMac; @@ -675,6 +676,7 @@ INSTANTIATE_REM_PROV_AIDL_TEST(CertificateRequestTest); class CertificateRequestV2Test : public CertificateRequestTestBase { void SetUp() override { CertificateRequestTestBase::SetUp(); + ASSERT_FALSE(HasFatalFailure()); if (rpcHardwareInfo.versionNumber < VERSION_WITHOUT_TEST_MODE) { GTEST_SKIP() << "This test case only applies to RKP v3 and above. "