2019-01-07 22:29:01 +01:00
|
|
|
---
|
|
|
|
- name: Create two volumes with the same name
|
|
|
|
uri:
|
|
|
|
url: 'https://api.cloudscale.ch/v1/volumes'
|
|
|
|
method: POST
|
|
|
|
headers:
|
2019-03-01 03:25:49 +01:00
|
|
|
Authorization: 'Bearer {{ cloudscale_api_token }}'
|
2019-01-07 22:29:01 +01:00
|
|
|
body:
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-duplicate'
|
|
|
|
size_gb: 50
|
|
|
|
body_format: json
|
|
|
|
status_code: 201
|
|
|
|
register: duplicate
|
|
|
|
with_sequence: count=2
|
|
|
|
|
|
|
|
- name: Try access to duplicate name
|
|
|
|
cloudscale_volume:
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-duplicate'
|
|
|
|
size_gb: 10
|
|
|
|
register: vol
|
|
|
|
ignore_errors: True
|
|
|
|
- name: 'VERIFY: Try access to duplicate name'
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vol is failed
|
|
|
|
|
|
|
|
- name: Fail volume creation with UUID
|
|
|
|
cloudscale_volume:
|
|
|
|
uuid: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
|
2019-08-29 16:08:54 +02:00
|
|
|
name: '{{ cloudscale_resource_prefix }}-inexistent'
|
2019-01-07 22:29:01 +01:00
|
|
|
size_gb: 10
|
|
|
|
register: vol
|
|
|
|
ignore_errors: True
|
|
|
|
- name: 'VERIFY: Fail volume creation with UUID'
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- vol is failed
|
2019-08-29 16:08:54 +02:00
|
|
|
- vol.msg.startswith('The volume with UUID \'ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48\' was not found')
|