-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests for Minion Manager RPC Server
- Loading branch information
Sergiu Miclea
committed
May 14, 2023
1 parent
1a06a34
commit 0cfd1bf
Showing
6 changed files
with
727 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
201 changes: 201 additions & 0 deletions
201
...olis/tests/minion_manager/rpc/data/make_minion_machine_allocation_subflow_for_action.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
## EXCEPTIONS | ||
|
||
# requires 2 machines, but only 1 is available | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 1 | ||
minion_machines: | ||
- allocation_status: AVAILABLE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
expect: | ||
exception: InvalidMinionPoolState | ||
|
||
# requires 2 machines, but only 1 is available | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 2 | ||
minion_machines: | ||
- allocation_status: IN_USE | ||
- allocation_status: AVAILABLE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
expect: | ||
exception: InvalidMinionPoolState | ||
|
||
# maximum_minions is too low for 4 new machines | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 6 | ||
minion_machines: | ||
- id: machine_1 | ||
allocation_status: IN_USE | ||
- id: machine_2 | ||
allocation_status: IN_USE | ||
- id: machine_3 | ||
allocation_status: IN_USE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
instance_3: | ||
name: Instance 3 | ||
instance_4: | ||
name: Instance 4 | ||
expect: | ||
exception: InvalidMinionPoolState | ||
|
||
## SUCCESS | ||
|
||
# no new machines need to be allocated | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 4 | ||
minion_machines: | ||
- id: machine_1 | ||
allocation_status: AVAILABLE | ||
- id: machine_2 | ||
allocation_status: AVAILABLE | ||
- id: machine_3 | ||
allocation_status: AVAILABLE | ||
- id: machine_4 | ||
allocation_status: AVAILABLE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
instance_3: | ||
name: Instance 3 | ||
instance_4: | ||
name: Instance 4 | ||
expect: | ||
result: | ||
mappings: | ||
instance_1: machine_1 | ||
instance_2: machine_2 | ||
instance_3: machine_3 | ||
instance_4: machine_4 | ||
|
||
# 2 new machines are allocated | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 5 | ||
minion_machines: | ||
- id: machine_1 | ||
allocation_status: AVAILABLE | ||
- id: machine_2 | ||
allocation_status: IN_USE | ||
- id: machine_3 | ||
allocation_status: AVAILABLE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
instance_3: | ||
name: Instance 3 | ||
instance_4: | ||
name: Instance 4 | ||
expect: | ||
result: | ||
mappings: | ||
instance_1: machine_1 | ||
instance_2: machine_3 | ||
instance_3: new_machine | ||
instance_4: new_machine | ||
|
||
# 3 new machines are allocated | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 6 | ||
minion_machines: | ||
- id: machine_1 | ||
allocation_status: AVAILABLE | ||
- id: machine_2 | ||
allocation_status: IN_USE | ||
- id: machine_3 | ||
allocation_status: IN_USE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
instance_3: | ||
name: Instance 3 | ||
instance_4: | ||
name: Instance 4 | ||
expect: | ||
result: | ||
mappings: | ||
instance_1: machine_1 | ||
instance_2: new_machine | ||
instance_3: new_machine | ||
instance_4: new_machine | ||
|
||
# 4 new machines are allocated | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 7 | ||
minion_machines: | ||
- id: machine_1 | ||
allocation_status: IN_USE | ||
- id: machine_2 | ||
allocation_status: IN_USE | ||
- id: machine_3 | ||
allocation_status: IN_USE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
instance_3: | ||
name: Instance 3 | ||
instance_4: | ||
name: Instance 4 | ||
expect: | ||
result: | ||
mappings: | ||
instance_1: new_machine | ||
instance_2: new_machine | ||
instance_3: new_machine | ||
instance_4: new_machine | ||
|
||
# 1 allocated | ||
- config: | ||
minion_pool: | ||
id: minion_pool_1 | ||
maximum_minions: 4 | ||
minion_machines: | ||
- id: machine_1 | ||
allocation_status: AVAILABLE | ||
action_instances: | ||
instance_1: | ||
name: Instance 1 | ||
instance_2: | ||
name: Instance 2 | ||
instance_3: | ||
name: Instance 3 | ||
instance_4: | ||
name: Instance 4 | ||
expect: | ||
result: | ||
mappings: | ||
instance_1: machine_1 | ||
instance_2: new_machine | ||
instance_3: new_machine | ||
instance_4: new_machine |
Oops, something went wrong.