Debian Codegraph @

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

raw
1 ---
2 - name: Create two volumes with the same name
3 uri:
4 url: 'https://api.cloudscale.ch/v1/volumes'
5 method: POST
6 headers:
7 Authorization: 'Bearer {{ cloudscale_api_token }}'
8 body:
9 name: '{{ cloudscale_resource_prefix }}-duplicate'
10 size_gb: 50
11 body_format: json
12 status_code: 201
13 register: duplicate
14 with_sequence: count=2
15
16 - name: Try access to duplicate name
17 cloudscale_ch.cloud.volume:
18 name: '{{ cloudscale_resource_prefix }}-duplicate'
19 size_gb: 10
20 register: vol
21 ignore_errors: True
22 - name: 'VERIFY: Try access to duplicate name'
23 assert:
24 that:
25 - vol is failed
26
27 - name: Fail volume creation with UUID
28 cloudscale_ch.cloud.volume:
29 uuid: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
30 name: '{{ cloudscale_resource_prefix }}-inexistent'
31 size_gb: 10
32 register: vol
33 ignore_errors: True
34 - name: 'VERIFY: Fail volume creation with UUID'
35 assert:
36 that:
37 - vol is failed
38 - vol.msg.startswith("The resource with UUID 'ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48' was not found")
39
40 - name: Fail revert a root volume on a running server
41 cloudscale_ch.cloud.volume:
42 uuid: '{{ server.volumes.0.uuid }}'
43 revert: '{{ root_volume_snapshot.uuid }}'
44 register: revert_root_volume
45 ignore_errors: True
46 - name: 'VERIFY: Fail revert a root volume on a running server'
47 assert:
48 that:
49 - revert_root_volume is failed