summaryrefslogtreecommitdiff
path: root/test/integration/targets/cloudscale_server_group/tasks/failures.yml
blob: 9269a6345809d4a0c72a5bdfbecdaba3e4962049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
- 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')