]> git.ipfire.org Git - thirdparty/linux.git/commit
tools: ynl: add schema checking
authorDonald Hunter <donald.hunter@gmail.com>
Thu, 27 Nov 2025 12:34:59 +0000 (12:34 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 29 Nov 2025 03:53:19 +0000 (19:53 -0800)
commit362d051c90b6e27b01dceed8c47ddfc86e60db2c
tree8de3ac8361d3f04f7ba14ae36a171067b30532e2
parent2c80116b503296dd050c8b92bef34e300bc2b1d4
tools: ynl: add schema checking

Add a --validate flag to pyynl for explicit schema check with error
reporting and add a schema_check make target to check all YNL specs.

make -C tools/net/ynl schema_check
make: Entering directory '/home/donaldh/net-next/tools/net/ynl'
ok 1 binder.yaml schema validation
not ok 2 conntrack.yaml schema validation
'labels mask' does not match '^[0-9a-z-]+$'

Failed validating 'pattern' in schema['properties']['attribute-sets']['items']['properties']['attributes']['items']['properties']['name']:
    {'type': 'string', 'pattern': '^[0-9a-z-]+$'}

On instance['attribute-sets'][14]['attributes'][22]['name']:
    'labels mask'

ok 3 devlink.yaml schema validation
[...]

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://patch.msgid.link/20251127123502.89142-2-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/Makefile
tools/net/ynl/pyynl/cli.py