Generate golden data tests for ODK
Generate core message request and responses for golden data tests. This CL does not have any golden data. The golden data will be added to a google3 CL. To turn on dumping of golden data, set the environment variable DUMP_GOLDEN_DATA to "yes". Merged from https://widevine-internal-review.googlesource.com/171750 Change-Id: I7ae2d76ec7330d9131aae98dfd07b7909d10f726
This commit is contained in:
committed by
Robert Shih
parent
cebd90e300
commit
e9b0196a23
@@ -10,6 +10,7 @@
|
||||
#include "config_test_env.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "message_dumper.h"
|
||||
#include "oec_device_features.h"
|
||||
#include "test_printers.h"
|
||||
#include "test_sleep.h"
|
||||
@@ -47,6 +48,12 @@ void ProvisioningHolder::Provision(CdmCertificateType cert_type,
|
||||
if (binary_provisioning) {
|
||||
request = wvutil::Base64SafeEncodeNoPad(request);
|
||||
}
|
||||
if (config_.dump_golden_data()) {
|
||||
std::vector<uint8_t> binary_request = wvutil::Base64SafeDecode(request);
|
||||
CdmProvisioningRequest binary_request_string(binary_request.begin(),
|
||||
binary_request.end());
|
||||
MessageDumper::DumpProvisioningRequest(binary_request_string);
|
||||
}
|
||||
LOGV("Provisioning request: req = %s", request.c_str());
|
||||
|
||||
// Ignore URL provided by CdmEngine. Use ours, as configured
|
||||
@@ -95,6 +102,9 @@ void ProvisioningHolder::Provision(CdmCertificateType cert_type,
|
||||
<< (binary_provisioning ? "Binary provisioning failed. "
|
||||
: "Non-binary provisioning failed. ")
|
||||
<< DumpProvAttempt(request, response_, cert_type);
|
||||
if (config_.dump_golden_data()) {
|
||||
MessageDumper::DumpProvisioning(response_);
|
||||
}
|
||||
}
|
||||
|
||||
bool ProvisioningHolder::ExtractSignedMessage(const std::string& response,
|
||||
|
||||
Reference in New Issue
Block a user