Debian Codegraph @

ansible_collections/cloudscale_ch/cloud/tests/integration/targets/objects_user/tasks/failures.yml

raw
1 ---
2 - name: Fail missing params
3 cloudscale_ch.cloud.objects_user:
4 register: obj
5 ignore_errors: True
6 - name: 'VERIFY: Fail name and UUID'
7 assert:
8 that:
9 - obj is failed
10
11 - name: Create two objects user with the same display_name
12 uri:
13 url: 'https://api.cloudscale.ch/v1/objects-users'
14 method: POST
15 headers:
16 Authorization: 'Bearer {{ cloudscale_api_token }}'
17 body:
18 display_name: '{{ cloudscale_resource_prefix }}-duplicate'
19 body_format: json
20 status_code: 201
21 register: duplicate
22 with_sequence: count=2
23
24 - name: Try access to duplicate display_name
25 cloudscale_ch.cloud.objects_user:
26 display_name: '{{ cloudscale_resource_prefix }}-duplicate'
27 register: obj
28 ignore_errors: True
29 - name: 'VERIFY: Try access to duplicate name'
30 assert:
31 that:
32 - obj is failed
33 - obj.msg.startswith("More than one objects-users resource with 'display_name' exists")
34
35 - name: Fail creation with ID
36 cloudscale_ch.cloud.objects_user:
37 id: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
38 register: obj
39 ignore_errors: True
40 - name: 'VERIFY: Fail server group creation with ID'
41 assert:
42 that:
43 - obj is failed
44 - obj.msg.startswith("state is present but all of the following are missing")