The VyOS-specific vyos_config_commands handler in
cloudinit/config/cc_vyos_userdata.py has no direct unit-test coverage.
The handler translates cloud-config set and delete commands to ConfigTree
operations during first boot. Its history includes fixes for the initial command
handler, multi-node detection, tag-node processing, and the default config path,
but none of those behaviors are covered by a focused regression test.
Scope
- Add unit tests only; do not change runtime behavior.
- Cover command parsing, ordinary versus multi/tag-node set behavior, value
delete versus path delete, and skipping malformed command lines.
- Mock ConfigTree and template discovery so the tests do not need a VyOS image.
Acceptance criteria
- Valid supported command forms produce the ConfigTree calls made by the current
implementation.
- Ordinary nodes use replacement while multi/tag nodes append values.
- delete with a value calls delete_value; a path-only delete calls delete.
- Malformed command lines are ignored without aborting the remaining commands.
- The focused test file and pytest tests/unittests both pass.