Don't allow rollback when we are enterprise enrolled. As stated (and verified) by the device_policy protobuf, we can determine whether a device is enterprise enrolled by checking if GetOwner is empty. We use this knowledge to not allow rollback when powerwash is also requested ( the default). As part of this CL I've figured out how to unittest Rollback and added tests for both enterprise and non-enterprise rollback. BUG=chromium:254829 TEST=Tested on both an enrolled and non-enrolled device. Verified only the latter actually did a powerwash while the other aborted correctly. Also ran new unittests Change-Id: Idfe6bfef88819fe1bab7da6b31854faf7642c9ce Reviewed-on: https://gerrit.chromium.org/gerrit/61645 Reviewed-by: David Zeuthen <[email protected]> Commit-Queue: Chris Sosa <[email protected]> Tested-by: Chris Sosa <[email protected]>
diff --git a/install_plan.h b/install_plan.h index b070cbe..c2f523e 100644 --- a/install_plan.h +++ b/install_plan.h
@@ -99,7 +99,10 @@ processor_->ActionComplete(this, kErrorCodeSuccess); } - virtual std::string Type() const { return "InstallPlanAction"; } + InstallPlan* install_plan() { return &install_plan_; } + + static std::string StaticType() { return "InstallPlanAction"; } + virtual std::string Type() const { return StaticType(); } typedef ActionTraits<InstallPlanAction>::InputObjectType InputObjectType; typedef ActionTraits<InstallPlanAction>::OutputObjectType OutputObjectType;