Debian Codegraph @

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

raw
1 ---
2 - name: Fail missing params
3 cloudscale_ch.cloud.network:
4 register: net
5 ignore_errors: True
6 - name: 'VERIFY: Fail name and UUID'
7 assert:
8 that:
9 - net is failed
10
11 - name: Create two networks with the same name
12 uri:
13 url: 'https://api.cloudscale.ch/v1/networks'
14 method: POST
15 headers:
16 Authorization: 'Bearer {{ cloudscale_api_token }}'
17 body:
18 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 name
25 cloudscale_ch.cloud.network:
26 name: '{{ cloudscale_resource_prefix }}-duplicate'
27 register: net
28 ignore_errors: True
29 - name: 'VERIFY: Try access to duplicate name'
30 assert:
31 that:
32 - net is failed
33 - net.msg.startswith("More than one networks resource with 'name' exists")
34
35 - name: Fail network creation with UUID
36 cloudscale_ch.cloud.network:
37 uuid: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
38 register: net
39 ignore_errors: True
40 - name: 'VERIFY: Fail network creation with UUID'
41 assert:
42 that:
43 - net is failed
44 - net.msg.startswith("state is present but all of the following are missing")