aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Hunyady <hunyadym@chromium.org>2018-05-30 12:58:29 +0200
committerchrome-bot <chrome-bot@chromium.org>2018-05-31 12:26:16 -0700
commitd7220e5c8555ebae190362b554973e7458eff13c (patch)
tree5dfb0f5017eb3b67b36d89fdea49af87de2dad88
parent6bc9c1d7fe169e5e8ceb294e0b8a6cd5cadbbec5 (diff)
downloadplatform_external_libbrillo-d7220e5c8555ebae190362b554973e7458eff13c.tar.gz
platform_external_libbrillo-d7220e5c8555ebae190362b554973e7458eff13c.tar.bz2
platform_external_libbrillo-d7220e5c8555ebae190362b554973e7458eff13c.zip
libbrillo: Set RollbackAllowedMilestones enterprise default to 0
Changing the default value of RollbackAllowedMilestones policy from 4 to 0 for enterprises (already 0 for consumer devices). Until the kernel and firmware key versions can be set properly from Omaha, we don't freeze key rolls by default, only if it's explicitly specified using enterprise policy. BUG=chromium:847226 TEST='cros_run_unit_tests --board=caroline --packages libbrillo' Change-Id: I4451a4e31f475a8b7557fea4f44dc35afe95ef0b Reviewed-on: https://chromium-review.googlesource.com/1078811 Commit-Ready: Marton Hunyady <hunyadym@chromium.org> Tested-by: Marton Hunyady <hunyadym@chromium.org> Reviewed-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org>
-rw-r--r--policy/device_policy_impl.cc5
-rw-r--r--policy/tests/device_policy_impl_unittest.cc2
-rw-r--r--policy/tests/libpolicy_unittest.cc4
3 files changed, 5 insertions, 6 deletions
diff --git a/policy/device_policy_impl.cc b/policy/device_policy_impl.cc
index 548a372..6189ca7 100644
--- a/policy/device_policy_impl.cc
+++ b/policy/device_policy_impl.cc
@@ -329,9 +329,8 @@ bool DevicePolicyImpl::GetRollbackAllowedMilestones(
}
}
// Policy is not present, use default for enterprise devices.
- VLOG(1) << "RollbackAllowedMilestones policy is not set, using default "
- << kMaxRollbackAllowedMilestones << ".";
- *rollback_allowed_milestones = kMaxRollbackAllowedMilestones;
+ VLOG(1) << "RollbackAllowedMilestones policy is not set, using default 0.";
+ *rollback_allowed_milestones = 0;
return true;
}
diff --git a/policy/tests/device_policy_impl_unittest.cc b/policy/tests/device_policy_impl_unittest.cc
index bc6aae0..4ef5a3c 100644
--- a/policy/tests/device_policy_impl_unittest.cc
+++ b/policy/tests/device_policy_impl_unittest.cc
@@ -100,7 +100,7 @@ TEST(DevicePolicyImplTest, GetRollbackAllowedMilestones_NotSet) {
int value = -1;
ASSERT_TRUE(device_policy.GetRollbackAllowedMilestones(&value));
- EXPECT_EQ(4, value);
+ EXPECT_EQ(0, value);
}
// RollbackAllowedMilestones is set to a valid value.
diff --git a/policy/tests/libpolicy_unittest.cc b/policy/tests/libpolicy_unittest.cc
index 310ef00..384bd69 100644
--- a/policy/tests/libpolicy_unittest.cc
+++ b/policy/tests/libpolicy_unittest.cc
@@ -224,10 +224,10 @@ TEST(PolicyTest, DevicePolicyNoneSetTest) {
EXPECT_FALSE(policy.GetUpdateDisabled(&bool_value));
EXPECT_FALSE(policy.GetTargetVersionPrefix(&string_value));
EXPECT_FALSE(policy.GetRollbackToTargetVersion(&int_value));
- // RollbackAllowedMilestones has the default value of 4 for enterprise
+ // RollbackAllowedMilestones has the default value of 0 for enterprise
// devices.
ASSERT_TRUE(policy.GetRollbackAllowedMilestones(&int_value));
- EXPECT_EQ(4, int_value);
+ EXPECT_EQ(0, int_value);
EXPECT_FALSE(policy.GetScatterFactorInSeconds(&int64_value));
EXPECT_FALSE(policy.GetOpenNetworkConfiguration(&string_value));
EXPECT_FALSE(policy.GetHttpDownloadsEnabled(&bool_value));