Dump BCC on failed provisioning request
[ Merge of http://go/wvgerrit/168357 and http://go/wvgerrit/168177 ] When we get an error from the provisioning server while running a test, we should log extra provisioning information. Bug: 273990016 Test: GtsMediaTestCases Change-Id: I44095261e07ae079c632873f254d8e6879bab8c3
This commit is contained in:
@@ -186,11 +186,15 @@ bool ExtractSignedMessage(const std::string& response,
|
|||||||
// TODO(b/242744857): This extra debugging may not be needed in all cases. When
|
// TODO(b/242744857): This extra debugging may not be needed in all cases. When
|
||||||
// provisioning fails, this dumps the cert and other information.
|
// provisioning fails, this dumps the cert and other information.
|
||||||
std::string DumpProvAttempt(const std::string& url, const std::string& request,
|
std::string DumpProvAttempt(const std::string& url, const std::string& request,
|
||||||
const std::string& http_message) {
|
const std::string& http_message,
|
||||||
|
CdmEngine* cdm_engine) {
|
||||||
std::stringstream info;
|
std::stringstream info;
|
||||||
info << "Provisioning url: " << url << "\n";
|
info << "Provisioning url: " << url << "\n";
|
||||||
info << "Request: " << wvutil::unlimited_b2a_hex(request) << "\n";
|
info << "Request: " << wvutil::unlimited_b2a_hex(request) << "\n";
|
||||||
info << "http_message: " << wvutil::unlimited_b2a_hex(http_message) << "\n";
|
info << "http_message: " << wvutil::unlimited_b2a_hex(http_message) << "\n";
|
||||||
|
std::string system_id;
|
||||||
|
cdm_engine->QueryStatus(kLevelDefault, QUERY_KEY_SYSTEM_ID, &system_id);
|
||||||
|
info << "system id: " << system_id << "\n";
|
||||||
if (wvoec::global_features.derive_key_method ==
|
if (wvoec::global_features.derive_key_method ==
|
||||||
wvoec::DeviceFeatures::TEST_PROVISION_30) {
|
wvoec::DeviceFeatures::TEST_PROVISION_30) {
|
||||||
std::vector<uint8_t> cert;
|
std::vector<uint8_t> cert;
|
||||||
@@ -468,7 +472,10 @@ void WvCdmTestBase::Provision() {
|
|||||||
|
|
||||||
// Receive and parse response.
|
// Receive and parse response.
|
||||||
std::string http_message;
|
std::string http_message;
|
||||||
ASSERT_NO_FATAL_FAILURE(url_request.AssertOkResponse(&http_message));
|
ASSERT_NO_FATAL_FAILURE(url_request.AssertOkResponse(&http_message))
|
||||||
|
<< "Failed to fetch provisioning response. "
|
||||||
|
<< DumpProvAttempt(provisioning_server_url, prov_request, http_message,
|
||||||
|
&cdm_engine);
|
||||||
|
|
||||||
if (binary_provisioning_) {
|
if (binary_provisioning_) {
|
||||||
// extract provisioning response from received message
|
// extract provisioning response from received message
|
||||||
@@ -501,13 +508,13 @@ void WvCdmTestBase::Provision() {
|
|||||||
&wrapped_key))
|
&wrapped_key))
|
||||||
<< "Binary provisioning failed. "
|
<< "Binary provisioning failed. "
|
||||||
<< DumpProvAttempt(provisioning_server_url, prov_request,
|
<< DumpProvAttempt(provisioning_server_url, prov_request,
|
||||||
http_message);
|
http_message, &cdm_engine);
|
||||||
} else {
|
} else {
|
||||||
ASSERT_EQ(NO_ERROR, cdm_engine.HandleProvisioningResponse(
|
ASSERT_EQ(NO_ERROR, cdm_engine.HandleProvisioningResponse(
|
||||||
http_message, kLevelDefault, &cert, &wrapped_key))
|
http_message, kLevelDefault, &cert, &wrapped_key))
|
||||||
<< "Non-binary provisioning failed. "
|
<< "Non-binary provisioning failed. "
|
||||||
<< DumpProvAttempt(provisioning_server_url, prov_request,
|
<< DumpProvAttempt(provisioning_server_url, prov_request,
|
||||||
http_message);
|
http_message, &cdm_engine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user