mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 22:03:09 +00:00
Refactored volume_info module
Change-Id: I5fd844fbb7b9831deb32594c4a587b7249f63d00
This commit is contained in:
@@ -1,24 +1,3 @@
|
||||
- name: Get info about volumes and all projects for all SDK
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: true
|
||||
all_projects: true
|
||||
|
||||
- name: Get info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
all_projects: true
|
||||
register: delete
|
||||
|
||||
- name: Clean up volumes before the test
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
state: absent
|
||||
name: "{{ vol.name }}"
|
||||
loop: "{{ delete.volumes }}"
|
||||
loop_control:
|
||||
loop_var: vol
|
||||
|
||||
- name: Create volume
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
@@ -42,6 +21,12 @@
|
||||
- info.volumes.0.name == 'ansible_test'
|
||||
- info.volumes.0.status == 'available'
|
||||
|
||||
- name: Assert return values of volume_info module
|
||||
assert:
|
||||
that:
|
||||
# allow new fields to be introduced but prevent fields from being removed
|
||||
- expected_fields|difference(info.volumes[0].keys())|length == 0
|
||||
|
||||
- name: Get not detailed info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
|
||||
Reference in New Issue
Block a user