Skip to content

test(opennebula): validate gen_conf() output against network-config-v2 schema#6855

Open
mcanevet wants to merge 1 commit intocanonical:mainfrom
mcanevet:test/opennebula-schema-validation
Open

test(opennebula): validate gen_conf() output against network-config-v2 schema#6855
mcanevet wants to merge 1 commit intocanonical:mainfrom
mcanevet:test/opennebula-schema-validation

Conversation

@mcanevet
Copy link
Copy Markdown
Contributor

Proposed Commit Message

```
test(opennebula): validate gen_conf() output against network-config-v2 schema

Add an autouse fixture to TestOpenNebulaNetwork that wraps gen_conf() and
runs jsonschema validation against schema-network-config-v2.json on every
call, so all existing tests implicitly assert schema conformance without
requiring dedicated per-field type checks.
```

Additional Context

OpenNebula's gen_conf() directly produces a Netplan v2 dict. Previously,
no test validated the output against the network-config-v2 JSON schema, so
type errors (e.g. a field being a string when the schema requires an integer)
could go undetected. The autouse fixture catches any such regression across
all existing and future tests in the class for free.

Test Steps

tox -e py3 -- tests/unittests/sources/test_opennebula.py

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@mcanevet mcanevet force-pushed the test/opennebula-schema-validation branch 2 times, most recently from 977fe0c to eb4adea Compare April 30, 2026 07:37
@mcanevet
Copy link
Copy Markdown
Contributor Author

Unit tests fails precisely because this new test shows a bug that #6856 fixes

…2 schema

Add an autouse fixture to TestOpenNebulaNetwork that wraps gen_conf() and
runs jsonschema validation against schema-network-config-v2.json on every
call, so all existing tests implicitly assert schema conformance.
@blackboxsw blackboxsw force-pushed the test/opennebula-schema-validation branch from eb4adea to 9c03944 Compare May 1, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant