]> git.ipfire.org Git - thirdparty/systemd.git/commit
varlink-idl: add infra to test our enum parsers against varlink IDL enums
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Nov 2025 09:35:00 +0000 (10:35 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Nov 2025 11:46:17 +0000 (11:46 +0000)
commit030f239a198de34c06aeb6b8680176102ed684d2
tree348bf832f3aa30d412efa2c1a51f67a23c3f1617
parent79dd24cf14adc809620479d45a7b469cf3e82892
varlink-idl: add infra to test our enum parsers against varlink IDL enums

In many cases we want to expose enums for which we have the usual
xyz_to_string()/xyz_from_string() via Varlink as enums. Let's add some
infra to test the tables against each other, to automatically detect
when they deviate.

In order to implement this properly, let's export/introduce clean
json_underscorefy()/json_dashify(), for dealing with the fact that our
enums usually use dash separates ames, but Varlink doesn't allow that.

(This does not add the test cases for all enum types we expose right
now, but only adds the general infra).
src/libsystemd/sd-json/json-util.h
src/libsystemd/sd-json/sd-json.c
src/shared/varlink-io.systemd.BootControl.c
src/shared/varlink-io.systemd.BootControl.h
src/shared/varlink-io.systemd.MountFileSystem.c
src/shared/varlink-io.systemd.MountFileSystem.h
src/test/test-varlink-idl.c