Setup test ROT + log empty root key in ref

Bug: b/117897682
Test: unit tests

Merge of http://go/wvgerrit/65223

Gtest setup does not call the base class' setup if it's defined in the
derived class. As a result, the WvCdmEngineTests were not installing the
test root of trusts in the OEMCrypto, which leads to segfaults when
using a key derived from the root of trust when a real root of trust
doesn't exist. The test class' setup is changed to use its base class'
methods, and logging is added to handle empty derived keys.

Change-Id: Ia574c4ade48206d771d6079fb3b67ccd7653428c
This commit is contained in:
Srujan Gaddam
2018-11-01 14:25:08 -07:00
parent c0144ac97f
commit 5c2f991973
3 changed files with 24 additions and 9 deletions

View File

@@ -152,15 +152,9 @@ class WvCdmEngineTest : public WvCdmEnginePreProvTest {
WvCdmEngineTest() {}
virtual void SetUp() {
CdmResponseType status =
cdm_engine_.OpenSession(config_.key_system(), NULL, NULL, &session_id_);
if (status == NEED_PROVISIONING) {
Provision();
status = cdm_engine_.OpenSession(config_.key_system(), NULL, NULL, &session_id_);
}
ASSERT_EQ(NO_ERROR, status);
ASSERT_NE("", session_id_) << "Could not open CDM session.";
ASSERT_TRUE(cdm_engine_.IsOpenSession(session_id_));
WvCdmTestBase::SetUp();
session_opened_ = false;
WvCdmEnginePreProvTest::OpenSession();
}
protected: