Add unit tests for OpenStack command group#2481
Open
berendt wants to merge 5 commits into
Open
Conversation
berendt
force-pushed
the
unit-tests-openstack-commands
branch
from
July 17, 2026 13:21
683c99a to
88c7254
Compare
Cover the Rabbitmq3to4 command: kolla configuration validation, vhost preparation, queue and exchange classification, connection draining, deletion helpers, and the check/list/delete subcommand wiring including dry-run and error paths. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christian Berendt <berendt@osism.tech>
Cover the amphora wait helpers (boot and delete polling loops), amphora restore and rotate flows including cleanup on failover errors, and the loadbalancer configuration loaders, database status resets, and the list/reset/delete commands with prompt and failover handling. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christian Berendt <berendt@osism.tech>
Add coverage for compute service enable/disable, instance listing with project and domain filters, live and cold migration classification and polling, migration list query assembly, start/stop eligibility, evacuation, stuck volume listing, and the volume repair sequences. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christian Berendt <berendt@osism.tech>
Add coverage for display_time, the Galera health checks, database and messaging status commands in log and script formats, RabbitMQ overview parsing with alarms and partitions, and the per-host memory, LLDP, BGP and bootstrap status report processing. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christian Berendt <berendt@osism.tech>
Assert the Celery task signatures built by the image, flavor, dnsmasq and project manage commands, and cover vault password set/unset and the vault check failure chain including the Fernet key round-trip. Assisted-by: Claude:claude-fable-5 Signed-off-by: Christian Berendt <berendt@osism.tech>
berendt
force-pushed
the
unit-tests-openstack-commands
branch
from
July 17, 2026 15:04
88c7254 to
f405b5f
Compare
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.
Closes #2365
Adds unit tests for the OpenStack-facing CLI command group under
osism/commands/, following the test targets listed in the issue.New test files:
tests/unit/commands/test_migrate.py—Rabbitmq3to4: kolla configuration validation, vhost preparation, queue/exchange classification, connection draining, deletion helpers, and thecheck/list/deletesubcommand wiring including dry-run and error paths.tests/unit/commands/test_octavia.py— both amphora wait helpers (poll loops, timeout bounds, query arguments).tests/unit/commands/test_amphora.py—AmphoraRestoreandAmphoraRotateincluding cleanup on failover errors, age-based rotation, andConflictExceptionhandling.tests/unit/commands/test_loadbalancer.py— configuration/password loaders, database status resets (exact SQL), and thelist/reset/deletecommands with prompt, failover, andfinallycleanup handling.tests/unit/commands/test_manage_commands.py— Celery.si(...)signature assembly for the image, flavor, dnsmasq, and project manage commands.Extended test files:
test_compute.py— enable/disable, listing with project/domain filters and uptime details, live/cold migration classification and polling, migration list query assembly, start/stop eligibility, evacuation.test_volume.py— stuck-volume listing across all five queried statuses and theVolumeRepairsequences.test_status.py—display_time, Galera health checks,Database/Messagingin both log and script formats, RabbitMQ overview/alarm/partition parsing.test_report.py— per-host processing forMemory,Lldp,Bgp, andStatusincluding failure bookkeeping.test_vault.py—SetPassword/UnsetPasswordand theCheckfailure chain with a real Fernet key round-trip.Deviations from the issue text (the code moved on since it was written):
loadbalancer.pyandstatus.pynow delegate database connections toosism.utils.mariadb.connectinstead of callingpymysql.connectdirectly (the proxysql shard-user selection lives there), andreport bgp --afirejects invalid casing via argparsechoicesbeforetake_actionruns. Tests assert against the current code.🤖 Generated with Claude Code