New issue
Advanced search Search tips

Issue 659101 link

Starred by 4 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug
V1



Sign in to add a comment

authpolicy: Add unit test for DevicePolicyEncoder

Project Member Reported by ljusten@chromium.org, Oct 25 2016

Issue description

DevicePolicyEncoder contains hand-written code to map RegistryDicts to device policy protobufs. If a new policy gets added to the proto in Chromium, the proto will eventually be propagated to Chromium OS and unless the committer is aware of DevicePolicyEncoder, the new policy will not be handled. Thus, a unit test needs to be added that makes sure that every policy is handled.
 
Labels: M-57
Labels: Enterprise-Triaged
Summary: authpolicy: Add unit test for DevicePolicyEncoder (was: authpolicy: Add unit test for DevicePolicyEncoder that prevents unhandled policies)

Comment 4 by tnagel@chromium.org, Nov 21 2016

Labels: V1
Nice
Status: Started (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ccd75912ceea7ff6171e35e7b98bdfb618b9265f

commit ccd75912ceea7ff6171e35e7b98bdfb618b9265f
Author: ljusten <ljusten@chromium.org>
Date: Fri Mar 31 09:33:22 2017

Generate list of Chrome OS device polices

Modifies the script that generates code from policy_templates.json to
output a list of all supported device policies.

The code is not used in Chromium. It will be used in Chrome OS's
authpolicy project in order to make sure that its code to encode
a device policy protobuf handles all device policies.

BUG= 659101 
TEST=Compiled Chromium, tested autogenerated code in Chrome OS

Review-Url: https://codereview.chromium.org/2777063009
Cr-Commit-Position: refs/heads/master@{#461088}

[modify] https://crrev.com/ccd75912ceea7ff6171e35e7b98bdfb618b9265f/components/policy/tools/generate_policy_source.py

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/6ddff3e3ee76d79c3cf5538fdecb649f64348d08

commit 6ddff3e3ee76d79c3cf5538fdecb649f64348d08
Author: Lutz Justen <ljusten@chromium.org>
Date: Tue Apr 04 02:09:15 2017

authpolicy: Add unit test for DevicePolicyEncoder

Makes sure that all device policies get encoded into protobuf
properly.

Gets rid of a weird hack for integer and boolean policies to make
sure that EncodeInteger and EncodeBoolean wasn't mixed up. If the
two are mixed up now, the unit test fails since the policy is not
actually encoded.

Uses recent changes to generate_policy_source.py to make sure that
all device policies are actually handled and unit tested. Thus, if
protofiles gets uprev'ed and the uprev'er forgets to add new device
policies, this unit test fails.

BUG= chromium:659101 
TEST=Compiled, ran tests, made sure it works as described here.

Change-Id: If655f967c231715ded31959d5f8abbaa1577f21a
Reviewed-on: https://chromium-review.googlesource.com/462966
Commit-Ready: Lutz Justen <ljusten@chromium.org>
Tested-by: Lutz Justen <ljusten@chromium.org>
Reviewed-by: Roman Sorokin <rsorokin@chromium.org>

[modify] https://crrev.com/6ddff3e3ee76d79c3cf5538fdecb649f64348d08/authpolicy/policy/device_policy_encoder.cc
[modify] https://crrev.com/6ddff3e3ee76d79c3cf5538fdecb649f64348d08/authpolicy/policy/device_policy_encoder.h
[add] https://crrev.com/6ddff3e3ee76d79c3cf5538fdecb649f64348d08/authpolicy/policy/device_policy_encoder_unittest.cc
[modify] https://crrev.com/6ddff3e3ee76d79c3cf5538fdecb649f64348d08/authpolicy/authpolicy.gyp

Status: Fixed (was: Started)
Status: Verified (was: Fixed)
bulk Verify of Chromad V1 bugs

Sign in to add a comment