ansible/test/legacy/roles/cloudscale_server/tasks/main.yml
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
2017-11-27 17:58:08 -05:00

138 lines
3.5 KiB
YAML

---
- name: Test create server
cloudscale_server:
name: '{{ resource_prefix }}-test'
flavor: '{{ cloudscale_test_flavor }}'
image: '{{ cloudscale_test_image }}'
ssh_keys: '{{ cloudscale_test_ssh_key }}'
register: server
- name: Verify create server
assert:
that:
- server is successful
- server is changed
- server.state == 'running'
- name: Test create server indempotence
cloudscale_server:
name: '{{ resource_prefix }}-test'
flavor: '{{ cloudscale_test_flavor }}'
image: '{{ cloudscale_test_image }}'
ssh_keys: '{{ cloudscale_test_ssh_key }}'
register: server
- name: Verify create server
assert:
that:
- server is successful
- server is not changed
- server.state == 'running'
- name: Test create server stopped
cloudscale_server:
name: '{{ resource_prefix }}-test-stopped'
flavor: '{{ cloudscale_test_flavor }}'
image: '{{ cloudscale_test_image }}'
ssh_keys: '{{ cloudscale_test_ssh_key }}'
state: 'stopped'
register: server_stopped
- name: Verify create server stopped
assert:
that:
- server_stopped is successful
- server_stopped is changed
- server_stopped.state == 'stopped'
- name: Test create server failure without required parameters
cloudscale_server:
name: '{{ resource_prefix }}-test-failed'
register: server_failed
ignore_errors: True
- name: Verify create server failure without required parameters
assert:
that:
- server_failed is failed
- "'Missing required parameter' in server_failed.msg"
- name: Test server stopped
cloudscale_server:
name: '{{ resource_prefix }}-test'
state: 'stopped'
register: server
- name: Verify server stopped
assert:
that:
- server is successful
- server is changed
- server.state == 'stopped'
- name: Test server stopped indempotence
cloudscale_server:
name: '{{ resource_prefix }}-test'
state: 'stopped'
register: server
- name: Verify server stopped indempotence
assert:
that:
- server is successful
- server is not changed
- server.state == 'stopped'
- name: Test server running
cloudscale_server:
name: '{{ resource_prefix }}-test'
state: 'running'
register: server
- name: Verify server running
assert:
that:
- server is successful
- server is changed
- server.state == 'running'
- name: Test server running indempotence
cloudscale_server:
name: '{{ resource_prefix }}-test'
state: 'running'
register: server
- name: Verify server running indempotence
assert:
that:
- server is successful
- server is not changed
- server.state == 'running'
- name: Test server deletion by name
cloudscale_server:
name: '{{ resource_prefix }}-test'
state: 'absent'
register: server
- name: Verify server deletion
assert:
that:
- server is successful
- server is changed
- server.state == 'absent'
- name: Test server deletion by uuid
cloudscale_server:
uuid: '{{ server_stopped.uuid }}'
state: 'absent'
register: server_stopped
- name: Verify server deletion by uuid
assert:
that:
- server_stopped is successful
- server_stopped is changed
- server_stopped.state == 'absent'
- name: Test server deletion indempotence
cloudscale_server:
name: '{{ resource_prefix }}-test'
state: 'absent'
register: server
- name: Verify server deletion
assert:
that:
- server is successful
- server is not changed
- server.state == 'absent'