1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/cloudscale_server_group/tasks/failures.yml

45 lines
1.2 KiB
YAML
Raw Normal View History

2020-03-09 10:11:07 +01:00
---
- name: Fail missing params
cloudscale_server_group:
register: grp
ignore_errors: True
- name: 'VERIFY: Fail name and UUID'
assert:
that:
- grp is failed
- name: Create two server groups with the same name
uri:
url: 'https://api.cloudscale.ch/v1/server-groups'
method: POST
headers:
Authorization: 'Bearer {{ cloudscale_api_token }}'
body:
name: '{{ cloudscale_resource_prefix }}-duplicate'
type: 'anti-affinity'
body_format: json
status_code: 201
register: duplicate
with_sequence: count=2
- name: Try access to duplicate name
cloudscale_server_group:
name: '{{ cloudscale_resource_prefix }}-duplicate'
register: grp
ignore_errors: True
- name: 'VERIFY: Try access to duplicate name'
assert:
that:
- grp is failed
- grp.msg.startswith('More than one server group with name exists')
- name: Fail server group creation with UUID
cloudscale_server_group:
uuid: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
register: grp
ignore_errors: True
- name: 'VERIFY: Fail server group creation with UUID'
assert:
that:
- grp is failed
- grp.msg.startswith('missing required arguments')