-
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 tests for
coriolis.api.v1.minion_pools
module
- Loading branch information
1 parent
1cb5ca2
commit c4626b9
Showing
5 changed files
with
477 additions
and
0 deletions.
There are no files selected for viewing
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,34 @@ | ||
- config: | ||
{} | ||
exception_raised: False | ||
|
||
- config: | ||
minimum_minions: 1 | ||
maximum_minions: 1 | ||
minion_max_idle_time: 1 | ||
exception_raised: False | ||
|
||
- config: | ||
minimum_minions: 0 | ||
exception_raised: "'minimum_minions' must be a strictly positive integer. " | ||
|
||
- config: | ||
minimum_minions: 1 | ||
maximum_minions: 0 | ||
exception_raised: "'maximum_minions' must be a strictly positive integer. " | ||
|
||
- config: | ||
minimum_minions: 1 | ||
maximum_minions: 1 | ||
exception_raised: False | ||
|
||
- config: | ||
minimum_minions: 2 | ||
maximum_minions: 1 | ||
exception_raised: "'maximum_minions' value .* must be at least as large as" | ||
|
||
- config: | ||
minimum_minions: 1 | ||
maximum_minions: 1 | ||
minion_max_idle_time: 0 | ||
exception_raised: "'minion_max_idle_time' must be a strictly positive " |
15 changes: 15 additions & 0 deletions
15
coriolis/tests/api/v1/data/minion_pool_retention_strategy.yml
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,15 @@ | ||
- config: | ||
exception_raised: True | ||
pool_retention_strategy: null | ||
|
||
- config: | ||
exception_raised: False | ||
pool_retention_strategy: 'MINION_POOL_MACHINE_RETENTION_STRATEGY_DELETE' | ||
|
||
- config: | ||
exception_raised: False | ||
pool_retention_strategy: 'MINION_POOL_MACHINE_RETENTION_STRATEGY_POWEROFF' | ||
|
||
- config: | ||
exception_raised: True | ||
pool_retention_strategy: 'invalid' |
65 changes: 65 additions & 0 deletions
65
coriolis/tests/api/v1/data/minion_validate_create_body.yml
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,65 @@ | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
endpoint_id: "mock_endpoint_id" | ||
os_type: "OS_TYPE_LINUX" | ||
platform: "PROVIDER_PLATFORM_SOURCE" | ||
environment_options: "mock_environment_options" | ||
notes: "mock_notes" | ||
minion_retention_strategy: "" | ||
expected_validation_api_method: "validate_endpoint_source_minion_pool_options" | ||
exception_raised: False | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
endpoint_id: "mock_endpoint_id" | ||
os_type: "OS_TYPE_LINUX" | ||
platform: "PROVIDER_PLATFORM_DESTINATION" | ||
environment_options: "mock_environment_options" | ||
notes: "mock_notes" | ||
minion_retention_strategy: "" | ||
expected_validation_api_method: "validate_endpoint_destination_minion_pool_options" | ||
exception_raised: False | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
endpoint_id: "mock_endpoint_id" | ||
os_type: "invalid" | ||
platform: "PROVIDER_PLATFORM_SOURCE" | ||
environment_options: "mock_environment_options" | ||
notes: "mock_notes" | ||
minion_retention_strategy: "" | ||
expected_validation_api_method: "validate_endpoint_source_minion_pool_options" | ||
exception_raised: "The provided pool OS type .* is invalid." | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
endpoint_id: "mock_endpoint_id" | ||
os_type: "OS_TYPE_LINUX" | ||
platform: "invalid" | ||
environment_options: "mock_environment_options" | ||
notes: "mock_notes" | ||
minion_retention_strategy: "" | ||
expected_validation_api_method: "validate_endpoint_source_minion_pool_options" | ||
exception_raised: "The provided pool platform .* is invalid." | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
endpoint_id: "mock_endpoint_id" | ||
os_type: "OS_TYPE_WINDOWS" | ||
platform: "PROVIDER_PLATFORM_SOURCE" | ||
environment_options: "mock_environment_options" | ||
notes: "mock_notes" | ||
minion_retention_strategy: "" | ||
expected_validation_api_method: "validate_endpoint_source_minion_pool_options" | ||
exception_raised: "Source Minion Pools are required to be of OS type " |
61 changes: 61 additions & 0 deletions
61
coriolis/tests/api/v1/data/minion_validate_update_body.yml
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,61 @@ | ||
- config: | ||
body: | ||
minion_pool: {} | ||
exception_raised: False | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
notes: "mock_notes" | ||
os_type: "mock_os_type" | ||
exception_raised: False | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
notes: "mock_notes" | ||
os_type: "mock_os_type" | ||
minion_retention_strategy: "mock_minion_retention_strategy" | ||
validate_minion_retention_strategy: True | ||
exception_raised: False | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
notes: "mock_notes" | ||
os_type: "mock_os_type" | ||
endpoint_id: "mock_endpoint_id" | ||
exception_raised: "The 'endpoint_id' of a minion pool cannot be updated." | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
notes: "mock_notes" | ||
os_type: "mock_os_type" | ||
platform: "mock_platform" | ||
exception_raised: "The 'platform' of a minion pool cannot be updated." | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
notes: "mock_notes" | ||
os_type: "mock_os_type" | ||
minimum_minions: 2 | ||
maximum_minions: 2 | ||
minion_max_idle_time: 2 | ||
validate_get_minion_pool: True | ||
exception_raised: False | ||
|
||
- config: | ||
body: | ||
minion_pool: | ||
name: "mock_name" | ||
notes: "mock_notes" | ||
os_type: "mock_os_type" | ||
environment_options: "mock_environment_options" | ||
exception_raised: False |
Oops, something went wrong.