New issue
Advanced search Search tips

Issue 761265 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Add validation for master configuration

Project Member Reported by sjg@chromium.org, Sep 1 2017

Issue description

At present errors (such as typos) in the master configuration can result in an incorrect configuration and this is not detected automatically.

For example:
- using a property not defined by the binding
- putting a node in the wrong place in the hierarchy
- adding an invalid value for a property (e.g. an integer instead of a string)

We should add validation in the chromeos-config ebuild to check that everything is correct

 

Comment 1 by sjg@chromium.org, Sep 19 2017

Status: Started (was: Untriaged)

Comment 2 by sjg@chromium.org, Sep 20 2017

Also need a test that whitelabel configs are exactly the same, while we wait for shared config.

Project Member

Comment 3 by bugdroid1@chromium.org, Sep 22 2017

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

commit 7f8614e1614787fd637a897fd0d63e5b235b4bc2
Author: Simon Glass <sjg@chromium.org>
Date: Fri Sep 22 13:10:17 2017

chromeos-config: Add a script to test the config example

Some minor errors have crept into the configuration binding example. Fix
them and add a script to check this.

BUG= chromium:761265 
TEST=With other changes:
FEATURES=test emerge-coral chromeos-config-tools
see that it detects problems that are introduced
Change-Id: I5d571a638fb04ce066954c66b442e78e346f6560
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/673604
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/7f8614e1614787fd637a897fd0d63e5b235b4bc2/chromeos-config/README.md
[add] https://crrev.com/7f8614e1614787fd637a897fd0d63e5b235b4bc2/chromeos-config/test-readme.sh

Project Member

Comment 4 by bugdroid1@chromium.org, Sep 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b1de6011b754cdcea3bce802ac1e46bea314aad8

commit b1de6011b754cdcea3bce802ac1e46bea314aad8
Author: Simon Glass <sjg@chromium.org>
Date: Tue Sep 26 20:36:18 2017

chromeos-config-tools: Add a test for the binding file

The binding file has a test that we can run to check that the example is
formatted correctly. Mistakes can be confusing, so update the tests to
run this.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
Change-Id: I79193082b160b7863c594939865cccb3634612ba
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/673208
Reviewed-by: C Shapiro <shapiroc@google.com>

[modify] https://crrev.com/b1de6011b754cdcea3bce802ac1e46bea314aad8/chromeos-base/chromeos-config-tools/chromeos-config-tools-9999.ebuild

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 9 2017

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

commit 088ec334a9b2f991668952fc4b92696863d7f90e
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 09 19:05:28 2017

Fix minor problems with the example configuration

Validation has shown up a few problems to be fixed in the example:

- Drop the 'stable' properties which are deprecated
- Use .tbz2 for all tarballs
- Capitalise the key IDs

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools

Change-Id: I7c03b91d1719c84aeec527fbe59ad383c2a092c6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/704266
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/088ec334a9b2f991668952fc4b92696863d7f90e/chromeos-config/README.md

Project Member

Comment 6 by bugdroid1@chromium.org, Oct 10 2017

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

commit c0b7e4937a46e566b07f3d63ed273b84d022d223
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 10 03:07:53 2017

chromeos-config: Add a function to look up a phandle

We need to be able to look up phandles. Add this to the fdt implementation
so we can use it as needed.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools

Change-Id: I30a4c79c1ba32cbd1ba0b2c8d6c37d4301f65602
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/704267
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Alec Thilenius <athilenius@chromium.org>

[modify] https://crrev.com/c0b7e4937a46e566b07f3d63ed273b84d022d223/chromeos-config/libcros_config/test.dts
[modify] https://crrev.com/c0b7e4937a46e566b07f3d63ed273b84d022d223/chromeos-config/cros_config_host_py/fdt.py
[modify] https://crrev.com/c0b7e4937a46e566b07f3d63ed273b84d022d223/chromeos-config/cros_config_host_py/fdt_unittest.py

Project Member

Comment 7 by bugdroid1@chromium.org, Oct 10 2017

Project Member

Comment 8 by bugdroid1@chromium.org, Oct 15 2017

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

commit c9901d73b4b24c1451b1c215fa09d108d083312d
Author: Simon Glass <sjg@chromium.org>
Date: Sat Oct 14 21:21:30 2017

Add a basic validator for the master configuration

At present there is no explicit validation that the configuration for any
one board matches the binding. This means that errors may not be noticed
until the package which uses the config is tested.

Add a basic validator to get things started. It focussed on the more
complex validation rather that simple checking that things are present.

This version has everything in one CL, including a few small changes to
the Fdt library.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
 ~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
 ~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
 README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: Ib302c8ff2460c2ece498377de1d77c541afc97fd
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/697947
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[add] https://crrev.com/c9901d73b4b24c1451b1c215fa09d108d083312d/chromeos-config/validate/validate_config
[modify] https://crrev.com/c9901d73b4b24c1451b1c215fa09d108d083312d/chromeos-config/cros_config_host_py/fdt.py
[add] https://crrev.com/c9901d73b4b24c1451b1c215fa09d108d083312d/chromeos-config/validate/validate_config_unittest.py
[add] https://crrev.com/c9901d73b4b24c1451b1c215fa09d108d083312d/chromeos-config/validate/validate_config.py
[add] https://crrev.com/c9901d73b4b24c1451b1c215fa09d108d083312d/chromeos-config/validate/validate_schema.py

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 16 2017

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

commit f4a521b92d07d184b9ae1c0883dc83bbd5c7a43e
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 19:53:34 2017

chromeos-config: Add validation for the thermal node

Now that we have a validator, add the missing validation information for
the thermal node. We expect a subdirectory containing a "dptf.dv" file.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: Id2f615f736d3048b7fa3bcb23e3e4627df55443c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721006
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/f4a521b92d07d184b9ae1c0883dc83bbd5c7a43e/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/f4a521b92d07d184b9ae1c0883dc83bbd5c7a43e/chromeos-config/validate/validate_config_unittest.py

Project Member

Comment 10 by bugdroid1@chromium.org, Oct 16 2017

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

commit e1c5e5da8efc197133a35ae8909d31f9f92a7c06
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 19:53:47 2017

chromeos-config: Split out phandle validation into a function

We want to be able to validate phandles from a custom validator. Split
the validation code into a separate function to allow this.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: Ia48e8ee04aa67bab7f1c3f9ad5a75ab8284650cb
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721007
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/e1c5e5da8efc197133a35ae8909d31f9f92a7c06/chromeos-config/validate/validate_schema.py

Project Member

Comment 11 by bugdroid1@chromium.org, Oct 16 2017

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

commit 58fdc27fc045435a484f9e41ab20e985dbd83b20
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 19:54:15 2017

chromeos-config: Add more wildcards to phandle validation

We want to be able to validate submodels as phandle targets. Also some
phandles are allowed to point to any subnode of a node - for example with
touch we have a subnode for each device.

Add these new features.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: Ied19fed33fe29ee90e9430a8c6262e3107431e3c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721008
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/58fdc27fc045435a484f9e41ab20e985dbd83b20/chromeos-config/validate/validate_schema.py

Project Member

Comment 12 by bugdroid1@chromium.org, Oct 16 2017

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

commit cf056da25d3db17a7438b2cbcad33096db7ac43d
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 19:54:27 2017

chromeos-config: Add validation for the touch nodes

Add the missing validation information for touch nodes. Two things are not
yet validated:

- We don't check that probe-regex is present only when preset = "probe"
- We don't check file filename templates are correct

These can be dealt with using a validator function in future work.

Fix a few problems in the README.md at the same time.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: Id2f373aa2ef4f354b43aef3fc6f2bc3c73521e40
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721009
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/cf056da25d3db17a7438b2cbcad33096db7ac43d/chromeos-config/README.md
[modify] https://crrev.com/cf056da25d3db17a7438b2cbcad33096db7ac43d/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/cf056da25d3db17a7438b2cbcad33096db7ac43d/chromeos-config/validate/validate_config_unittest.py
[modify] https://crrev.com/cf056da25d3db17a7438b2cbcad33096db7ac43d/chromeos-config/validate/validate_schema.py

Project Member

Comment 13 by bugdroid1@chromium.org, Oct 16 2017

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

commit a6bd36758818f84a51dd501e24f7674affae99e9
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 19:54:39 2017

chromeos-config: Move the schema to the bottom of the file

We want to have customer validator functions to provide better validation
coverage. The schema needs to reference these, so move it below the
CrosConfigValidator class.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: I78c176258162154de7ef3148ec44c937dcb135c3
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721010
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/a6bd36758818f84a51dd501e24f7674affae99e9/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/a6bd36758818f84a51dd501e24f7674affae99e9/chromeos-config/validate/validate_config_unittest.py

Project Member

Comment 14 by bugdroid1@chromium.org, Oct 16 2017

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

commit 63e85ba28d6eac532fb46a26210a35f293be6048
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 20:53:35 2017

chromeos-config: Add a custom validator

Sometimes we want to do more complex validation of a property, requiring
deep inspection and analysis of the property. Add a PropCustom property
which uses its own validation function.

Fix up the base class arg comments at the same time.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: I9515f916ea84a8ddaa4224ca6e783313d11940c0
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721011
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/63e85ba28d6eac532fb46a26210a35f293be6048/chromeos-config/validate/validate_schema.py

Project Member

Comment 15 by bugdroid1@chromium.org, Oct 16 2017

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

commit 2d04d3bbc405fd6445a4d6ca970afa6dc485f3aa
Author: Simon Glass <sjg@chromium.org>
Date: Mon Oct 16 21:55:07 2017

chromeos-config: Add basic audio validation

Add basic validation of the audio nodes. We allow specifying all
information in the model node (useful if no models share config), or using
the family node to provide the filename patterns.

With this we have enough validation to cover all current bindings.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: I0a75f2e7f1a4181a6f4b40ed368114489bf2172e
Reviewed-on: https://chromium-review.googlesource.com/721013
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

[modify] https://crrev.com/2d04d3bbc405fd6445a4d6ca970afa6dc485f3aa/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/2d04d3bbc405fd6445a4d6ca970afa6dc485f3aa/chromeos-config/validate/validate_config_unittest.py

Project Member

Comment 16 by bugdroid1@chromium.org, Oct 17 2017

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

commit 03167c2e96e39adead943278517b35d182d7e9fe
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 17 09:37:29 2017

chromeos-config: Add validation of the mapping node

This node include a SKU ID map. Add a custom validator for that.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
PYTHONPATH=~/cosarm ./validate/validate_config \
~/cosarm/chroot/build/coral/usr/share/chromeos-config/config.dtb  \
~/cosarm/chroot/build/reef-uni/usr/share/chromeos-config/config.dtb \
README.md
PYTHONPATH=~/cosarm python validate/validate_config_unittest.py

Change-Id: Ib749237602e0fdc2777821c639ee84bad6ae9d03
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721012
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/03167c2e96e39adead943278517b35d182d7e9fe/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/03167c2e96e39adead943278517b35d182d7e9fe/chromeos-config/validate/validate_config_unittest.py

Project Member

Comment 17 by bugdroid1@chromium.org, Oct 17 2017

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

commit 8035a87ccde2d05b45ccb35cbd36d49e430b582b
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 17 09:37:29 2017

chromeos-config: Move GetElement out of the schema impl

This function doesn't really belong here. We have tried to get around it
by avoiding accessing any nodes directly, but it does check the node path
in one case.

It seems better to put it with the config validator, which is the piece
which should understand the node/property structure. This will allow us to
do more checks on this without the validator reaching into places it should
not.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools

Change-Id: Ifefc3e665943a3435e6c8a31b4c89f824eb364ec
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721014
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/8035a87ccde2d05b45ccb35cbd36d49e430b582b/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/8035a87ccde2d05b45ccb35cbd36d49e430b582b/chromeos-config/validate/validate_schema.py

Project Member

Comment 18 by bugdroid1@chromium.org, Oct 17 2017

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

commit 3de507dbfbaaa07ba0631ac13ecb693d75862f8e
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 17 09:37:29 2017

chromeos-config: Tidy up GetElement arguments

Now that this is a member of the validator class, it can directly access
things that are currently passed as arguments. Drop those we don't need
to simply this function.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools

Change-Id: Ief6a0c29b35f6909bef4db29a282fc14c5b3aa45
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721015
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/3de507dbfbaaa07ba0631ac13ecb693d75862f8e/chromeos-config/validate/validate_config.py

Project Member

Comment 19 by bugdroid1@chromium.org, Oct 17 2017

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

commit df406a89066cc1d3606a07ebf53dadbe022781fa
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 17 09:37:30 2017

chromeos-config: Move Present() into ConfigValidator

This function works OK in the schema file since it has a fairly simple job
and we can pass in the required list of siblings. However we plan to add
support for making presense of one element dependent on present of another
element which is not necessarily in the same node. This involves looking
around the Node/Property structure, so it seems best to move this function
into the validator.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools

Change-Id: I9c82f9524bd94ae83eb1ee0befc4e44cfd8e5443
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721016
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/df406a89066cc1d3606a07ebf53dadbe022781fa/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/df406a89066cc1d3606a07ebf53dadbe022781fa/chromeos-config/validate/validate_schema.py

Project Member

Comment 20 by bugdroid1@chromium.org, Oct 17 2017

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

commit cd13b0398f0d105319f9fae91d42a4193c518f8d
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 17 09:37:30 2017

chromeos-config: Allow ElementPresent() to use node directly

Now that this function is in the validator it can access nodes and
properties directly. Adjust the arguments to pass the parent node and have
it calculate the sibling list itself. For now we do not access any other
nodes, but future work will add this.

BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools

Change-Id: I80a55d2c04c5e133d63d90f5ec3d2dc1fb69357c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/721017
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/cd13b0398f0d105319f9fae91d42a4193c518f8d/chromeos-config/validate/validate_config.py

Comment 21 by sjg@chromium.org, Oct 17 2017

Labels: -Pri-3 Pri-1
Project Member

Comment 22 by bugdroid1@chromium.org, Oct 17 2017

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

commit d7b6646c5b922ae097332186a30037977fc0eca1
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 17 20:02:45 2017

Revert "chromeos-config: Added get_firmware_uris flag to cros_config_host"

We have moved cros_config_host to Python, so we don't need this tool now.
A follow-up CL will remove it once we have dropped it from eclasses.

This is a partial revert, leaving the test.dts changes which are used in
the cros_config_host_py tests.

This reverts commit 01cc9eb4e0332d72d83a98b9b2d2d582e9895951.

Change-Id: Ib37316beb9ebc2b1b8ff585f36e0af95ac845990
BUG= chromium:761265 
TEST=FEATURES=test emerge-coral chromeos-config-tools
Need to run trybots also
Reviewed-on: https://chromium-review.googlesource.com/721018
Commit-Ready: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/libcros_config/cros_config.cc
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/libcros_config/fake_cros_config.cc
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/libcros_config/fake_cros_config.h
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/libcros_config/cros_config_interface.h
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/libcros_config/cros_config_unittest.cc
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/cros_config_host_main_unittest.cc
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/chromeos-config.gyp
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/libcros_config/cros_config.h
[modify] https://crrev.com/d7b6646c5b922ae097332186a30037977fc0eca1/chromeos-config/cros_config_host_main.cc

Project Member

Comment 23 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/318de73b5a4665fe73cd374a9f0f98570169cd88

commit 318de73b5a4665fe73cd374a9f0f98570169cd88
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 20 00:03:47 2017

chromeos-config-tools: Install the validator

Install the master configuration validator so we can use it to check
configuration files.

BUG= chromium:761265 
TEST=sudo emerge chromeos-config tools
See that validate_config is now available in chroot

Change-Id: Icfb0c7e867af804469b0a3c1b3716f231145d779
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/727028
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/318de73b5a4665fe73cd374a9f0f98570169cd88/chromeos-base/chromeos-config-tools/chromeos-config-tools-9999.ebuild

Project Member

Comment 24 by bugdroid1@chromium.org, Oct 20 2017

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

commit 0e79403c64f63d139410b0a931d998d4e2d9bbdd
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 20 15:22:09 2017

validate_config: Hide the stack trace unless debugging

The Python stack trace is not useful for normal users. Hide it unless -d
is provided.

BUG= chromium:761265 
TEST=Run with and without -d

Change-Id: I7df51c7753b57fbc6b6e31061283d2ceb1f5c815
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/728202

[modify] https://crrev.com/0e79403c64f63d139410b0a931d998d4e2d9bbdd/chromeos-config/validate/validate_config.py

Project Member

Comment 25 by bugdroid1@chromium.org, Oct 20 2017

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

commit ce3b0d0760400ef1e165a59ff91ad4ba7d4d163e
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 20 15:22:09 2017

validate_config: Split out showing of errors into a function

We need to use this code from two places, so put it in a function.

BUG= chromium:761265 
TEST=PYTHONPATH=~/cosarm python validate_config_unittest.py

Change-Id: I71c1eef275ff6b5f36b247615c516924eddfdf99
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/728203

[modify] https://crrev.com/ce3b0d0760400ef1e165a59ff91ad4ba7d4d163e/chromeos-config/validate/validate_config.py

Project Member

Comment 26 by bugdroid1@chromium.org, Oct 20 2017

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

commit ffd1b7cf0d40f01b28136671bb59324fbab75295
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 20 15:22:10 2017

validate_config: Support validation of multiple fragments

It is useful to split the config into multiple .dtsi files to allow
different teams to work on them without interfering with others. We still
want to validate all the config as a whole, but need to show the filename
where the error occurred, even it is in a fragment.

Add -p option which accepts a list of .dtsi files to validate. It uses the
/include/ directive to compile them, thus ensuring error line numbers are
useful. Then it runs the resulting .dtb through the validator.

BUG= chromium:761265 
TEST=PYTHONPATH=~/cosarm python validate_config_unittest.py

Change-Id: Ie0edd040da1bcec556923ab4c1c89d0f0ef00588
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/728204

[modify] https://crrev.com/ffd1b7cf0d40f01b28136671bb59324fbab75295/chromeos-config/validate/validate_config.py
[modify] https://crrev.com/ffd1b7cf0d40f01b28136671bb59324fbab75295/chromeos-config/validate/validate_config_unittest.py
[modify] https://crrev.com/ffd1b7cf0d40f01b28136671bb59324fbab75295/chromeos-config/cros_config_host_py/fdt_util.py

Project Member

Comment 27 by bugdroid1@chromium.org, Oct 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/aee7f941f06a2f0c39aa2e24b154155aadf008af

commit aee7f941f06a2f0c39aa2e24b154155aadf008af
Author: Simon Glass <sjg@chromium.org>
Date: Sat Oct 21 20:25:49 2017

chromeos-config: Run the validator

Now that we have a validator, run it on the master configuration after
it is created.

BUG= chromium:761265 
TEST=emerge-coral --nodeps chromeos-config-bsp chromeos-config
(after inserting an error in the brand code)
See that it fails to build now

Change-Id: Ice5e3a6b40cab37ce921262643a37ba9a2dfd0f5
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/727032
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/aee7f941f06a2f0c39aa2e24b154155aadf008af/chromeos-base/chromeos-config/chromeos-config-0.0.1.ebuild
[rename] https://crrev.com/aee7f941f06a2f0c39aa2e24b154155aadf008af/chromeos-base/chromeos-config/chromeos-config-0.0.1-r4.ebuild

Project Member

Comment 28 by bugdroid1@chromium.org, Oct 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/e47cf16dd1fa911140e03d31ae2c8066dc65017a

commit e47cf16dd1fa911140e03d31ae2c8066dc65017a
Author: Simon Glass <sjg@chromium.org>
Date: Sun Oct 22 23:21:40 2017

cros-unibuild: Add validation when installing config files

We should validate these files as early as possible to avoid installing
bad files. Add validation of the source files in the BSP ebuilds.

BUG= chromium:761265 
TEST=emerge-coral --nodeps chromeos-config-bsp
(after inserting an error in the brand code)
See that it fails to build now:

 * Validating 2 files:
/mnt/host/source/src/private-overlays/overlay-coral-private/chromeos-base/chromeos-config-bsp/files/model.dtsi:
/chromeos/models/astronaut: 'brand-code' value 'CTI' does not match pattern '^[A-Z]{4}$'

Change-Id: Ie691125fe291e22342d7aa41ccc070d4122dd699
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/727030
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: YH Lin <yueherngl@chromium.org>

[modify] https://crrev.com/e47cf16dd1fa911140e03d31ae2c8066dc65017a/eclass/cros-unibuild.eclass

Project Member

Comment 29 by bugdroid1@chromium.org, Oct 27 2017

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

commit 9f40abbf9e5be9073e7e482622ea23d971f5220e
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 27 01:09:23 2017

chromeos-config: Check sibling nodes as well as properties

The conditional_props feature currently only looks at properties in
deciding whether a schema element is present. It should also look at
subnodes. In some cases we need to have a subnode which is present only
if another node is not.

BUG= chromium:761265 
TEST=FEATURES=test emerge-reef-uni --nodeps chromeos-config-tools

Change-Id: Ibb2b0f603845b3ab3a8734b21b50b18d7836b0c4
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/739396
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/9f40abbf9e5be9073e7e482622ea23d971f5220e/chromeos-config/validate_config.py

Project Member

Comment 30 by bugdroid1@chromium.org, Oct 27 2017

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

commit a52942e8bbfc9ace88f3806be97fd0564e9b9031
Author: Simon Glass <sjg@chromium.org>
Date: Fri Oct 27 01:09:23 2017

chromeos-config: Allow selecting schema element types

When searching for a schema element the caller is often looking only for a
node, or only looking for a property. Allow the caller to specify this. It
allows us to catch a few more validation problems. Fix these in the README.

BUG= chromium:761265 
TEST=FEATURES=test emerge-reef-uni --nodeps chromeos-config-tools
PYTHONPATH=~/c python validate_config.py README.md

Change-Id: Ic43a15fb4ca0dbc22529af98acbabbec0c8c969c
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/739397
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/a52942e8bbfc9ace88f3806be97fd0564e9b9031/chromeos-config/README.md
[modify] https://crrev.com/a52942e8bbfc9ace88f3806be97fd0564e9b9031/chromeos-config/libcros_config/test.dts
[modify] https://crrev.com/a52942e8bbfc9ace88f3806be97fd0564e9b9031/chromeos-config/validate_config.py

Project Member

Comment 31 by bugdroid1@chromium.org, Oct 31 2017

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

commit f5a24f3577362b264dd7a1d14bce16952ff873c6
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 17:42:35 2017

chromeos-config: Update Fdt to use OrderedDict for subnodes

This is a better data structure for the list of subnodes since it allows
us to access them by name.

BUG= chromium:761265 
TEST=./run_tests.sh

Change-Id: I11987d1e74b9855d651be007324a18d8c41389e8
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/743033
Reviewed-by: Lann Martin <lannm@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/f5a24f3577362b264dd7a1d14bce16952ff873c6/chromeos-config/libcros_config_host/fdt.py
[modify] https://crrev.com/f5a24f3577362b264dd7a1d14bce16952ff873c6/chromeos-config/libcros_config_host/fdt_unittest.py
[modify] https://crrev.com/f5a24f3577362b264dd7a1d14bce16952ff873c6/chromeos-config/libcros_config_host/libcros_config_host.py
[modify] https://crrev.com/f5a24f3577362b264dd7a1d14bce16952ff873c6/chromeos-config/validate_config.py

Project Member

Comment 32 by bugdroid1@chromium.org, Oct 31 2017

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

commit 209a00ca5f8a18020ca7ee49a5fe00c057ad71ce
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 17:42:57 2017

chromeos-config: Add a function to prepare the validator

Before the validator starts it needs to build a list of models and
submodels. Move this code into a separate exported function, so users of
the validator (that don't call Start()) can call it.

BUG= chromium:761265 
TEST=FEATURES=test sudo -E emerge --nodeps  chromeos-config-tools

Change-Id: I0698ba604a0954057edc97bb0689839add6e0571
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/743035
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/209a00ca5f8a18020ca7ee49a5fe00c057ad71ce/chromeos-config/validate_config.py

Project Member

Comment 33 by bugdroid1@chromium.org, Oct 31 2017

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

commit 1f1d647890b04f82252b6274d9ead4db6f174c32
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 17:43:21 2017

chromeos-config: Drop the README test from the test script

This test only compiles the source - it does not validate it. We handle
this in the ebuild now by running the validator properly on the README.
So drop this duplicate and inferior test.

Also clarify that this script only runs the Python tests.

BUG= chromium:761265 
TEST=FEATURES=test sudo -E emerge --nodeps  chromeos-config-tools

Change-Id: I179bc890dccfcb408dca2ecdcb62e87a09197aee
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/743037
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/1f1d647890b04f82252b6274d9ead4db6f174c32/chromeos-config/run_tests.sh

Project Member

Comment 34 by bugdroid1@chromium.org, Oct 31 2017

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

commit 51aced6789f6ca7dcc02d5b71f324dbe0f20153d
Author: Simon Glass <sjg@chromium.org>
Date: Tue Oct 31 22:15:18 2017

chromeos-config: Update GetElement() to handle ignored properties

Some properties can be ignored because they are a feature of device tree
and are not in the schema. Update GetElement() to return False for these,
so the caller knows to ignore them.

BUG= chromium:761265 
TEST=FEATURES=test sudo -E emerge --nodeps  chromeos-config-tools

Change-Id: I25c32f4959e206a2183e17e1a656bd72e197c968
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/743034
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Lann Martin <lannm@chromium.org>

[modify] https://crrev.com/51aced6789f6ca7dcc02d5b71f324dbe0f20153d/chromeos-config/validate_config.py

Comment 35 by sjg@chromium.org, Nov 4 2017

Labels: Unibuild

Comment 36 by sjg@chromium.org, Nov 6 2017

Status: Fixed (was: Started)
I'm calling this done.

We have nice easy error messages in chromeos-config-bsp, a further check in chromeos-config just in case.

There are holes in the validation but I think it is good enough to use for now.

Sign in to add a comment