Use parent devices in validation test specs - #3759
Merged
Merged
Conversation
The 'show', 'exec', and 'valid' parameters in validation tests can accept parent devices to cover a wide range of platforms with a single definition. Sample use case: DNS client integration test
Contributor
There was a problem hiding this comment.
Pull request overview
Enables validation test specifications to use parent device types (device inheritance) in show / exec / valid dictionaries, reducing duplication across closely related platforms.
Changes:
- Resolve validation actions by walking device inheritance (most-specific device → generic parents).
- Extend validation schema to allow template/parent device identifiers as dictionary keys.
- Update DNS client integration test and documentation to demonstrate/describe parent-device usage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/services/01-dns-client.yml | Simplifies per-platform exec map by using the ios parent key. |
| netsim/defaults/attributes.yml | Allows template/parent device identifiers as keys for _v_option dictionaries. |
| netsim/cli/validate/utils.py | Adds device-inheritance lookup for resolving per-device validation values/actions. |
| netsim/cli/validate/tests.py | Updates call site for the new find_test_action(..., topology) signature. |
| docs/topology/validate.md | Documents that show/exec/valid dictionaries may use parent device types. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+63
to
+65
| if value is None: | ||
| log.error(f'Cannot find the {action} value for {node.device} in {v_entry}',category=log.MissingDependency,module='validate') | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 'show', 'exec', and 'valid' parameters in validation tests can accept parent devices to cover a wide range of platforms with a single definition.
Sample use case: DNS client integration test