Page MenuHomeVyOS Platform

cloud-init: add regression coverage for vyos_config_commands
In progress, LowPublic

Description

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.

Details

Version
rolling
Is it a breaking change?
Perfectly compatible
Issue type
Internal change (not visible to end users)

Event Timeline

@hybridops Would you like to claim this task?

Yes. I am working on it at the moment, and will submit a PR soon.

Viacheslav changed the task status from Open to In progress.Aug 7 2026, 11:21 AM
Viacheslav assigned this task to hybridops.

PR submitted and ready for review:
https://github.com/vyos/vyos-cloud-init/pull/116

The automated checks pass and the PR is currently mergeable.