Skip to content

Commit

Permalink
Add tests for coriolis.conductor.rpc.server module
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristi1324 committed Feb 26, 2024
1 parent c423524 commit 574faa5
Show file tree
Hide file tree
Showing 3 changed files with 1,941 additions and 198 deletions.
2 changes: 1 addition & 1 deletion coriolis/conductor/rpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ def report_migration_minions_allocation_error(
awaiting_minions_status = (
constants.EXECUTION_STATUS_AWAITING_MINION_ALLOCATIONS)
if migration.last_execution_status != awaiting_minions_status:
raise exception.InvalidReplicaState(
raise exception.InvalidMigrationState(
"Migration is in '%s' status instead of the expected '%s' to "
"have minion machines allocations fail for it." % (
migration.last_execution_status, awaiting_minions_status))
Expand Down
34 changes: 34 additions & 0 deletions coriolis/tests/conductor/rpc/data/cancel_migration_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- config:
force: False
execution_statuses: [EXECUTION_STATUS_RUNNING]
raises_exception: False

- config:
force: False
execution_statuses: []
raises_exception: True

- config:
force: False
execution_statuses: [EXECUTION_STATUS_COMPLETED]
raises_exception: True

- config:
force: True
execution_statuses: [EXECUTION_STATUS_CANCELLING]
raises_exception: False

- config:
force: False
execution_statuses: [EXECUTION_STATUS_CANCELLING]
raises_exception: True

- config:
force: False
execution_statuses: [EXECUTION_STATUS_AWAITING_MINION_ALLOCATIONS]
raises_exception: False

- config:
force: True
execution_statuses: [EXECUTION_STATUS_RUNNING, EXECUTION_STATUS_CANCELLING, EXECUTION_STATUS_AWAITING_MINION_ALLOCATIONS]
raises_exception: True
Loading

0 comments on commit 574faa5

Please sign in to comment.