update_engine: add chrome os device requisition to the omaha request
Requisition type is not currently sent to Omaha and is thus unavailable
for AU rules. This adds a requisition attribute to the <app> if the
device has a requisition type. Currently, the types may be one of
remora, shark, or rialto.
TEST=unittest
BUG=b:132014633,b:133324571
Change-Id: I0e53d3a5749da4cbb95ce73cff35191066339009
Reviewed-on: https://chromium-review.googlesource.com/1604218
Commit-Ready: Matthew Ziegelbaum <ziegs@chromium.org>
Tested-by: Matthew Ziegelbaum <ziegs@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/common/fake_hardware.h b/common/fake_hardware.h
index 53b2dd5..6604534 100644
--- a/common/fake_hardware.h
+++ b/common/fake_hardware.h
@@ -77,6 +77,10 @@
std::string GetECVersion() const override { return ec_version_; }
+ std::string GetDeviceRequisition() const override {
+ return device_requisition_;
+ }
+
int GetMinKernelKeyVersion() const override {
return min_kernel_key_version_;
}
@@ -173,6 +177,10 @@
void SetECVersion(const std::string& ec_version) { ec_version_ = ec_version; }
+ void SetDeviceRequisition(const std::string& requisition) {
+ device_requisition_ = requisition;
+ }
+
void SetMinKernelKeyVersion(int min_kernel_key_version) {
min_kernel_key_version_ = min_kernel_key_version;
}
@@ -207,6 +215,7 @@
std::string hardware_class_{"Fake HWID BLAH-1234"};
std::string firmware_version_{"Fake Firmware v1.0.1"};
std::string ec_version_{"Fake EC v1.0a"};
+ std::string device_requisition_{"fake_requisition"};
int min_kernel_key_version_{kMinKernelKeyVersion};
int min_firmware_key_version_{kMinFirmwareKeyVersion};
int kernel_max_rollforward_{kKernelMaxRollforward};
diff --git a/common/hardware_interface.h b/common/hardware_interface.h
index 6c53540..da9f10e 100644
--- a/common/hardware_interface.h
+++ b/common/hardware_interface.h
@@ -70,6 +70,10 @@
// running a custom chrome os ec.
virtual std::string GetECVersion() const = 0;
+ // Returns the OEM device requisition or an empty string if the system does
+ // not have a requisition, or if not running Chrome OS.
+ virtual std::string GetDeviceRequisition() const = 0;
+
// Returns the minimum kernel key version that verified boot on Chrome OS
// will allow to boot. This is the value of crossystem tpm_kernver. Returns
// -1 on error, or if not running on Chrome OS.