mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 22:03:09 +00:00
Fix branchful jobs for collections
Stable branch jobs were using master for deployment Story: #2008445 Task: #41412 Story: #2008444 Task: #41411 Mark train non-voting, see https://review.opendev.org/766622 Change-Id: I8132ec7cfe3468daaa363efb76c5d0b81bdeab30
This commit is contained in:
@@ -200,7 +200,10 @@
|
||||
that:
|
||||
- info10.openstack_servers.0.status == 'ACTIVE'
|
||||
# not in all versions 'locked' is supported
|
||||
- info10.openstack_servers.0.locked in (None, True)
|
||||
- >-
|
||||
(info10.openstack_server[0]['locked'] is defined and
|
||||
info10.openstack_server[0]['locked']|bool) or
|
||||
(info10.openstack_server[0]['locked'] is not defined)
|
||||
- server is changed
|
||||
|
||||
- name: Lock server again
|
||||
@@ -222,7 +225,10 @@
|
||||
that:
|
||||
- info11.openstack_servers.0.status == 'ACTIVE'
|
||||
# not in all versions 'locked' is supported
|
||||
- info11.openstack_servers.0.locked in (None, True)
|
||||
- >-
|
||||
(info11.openstack_server[0]['locked'] is defined and
|
||||
info11.openstack_server[0]['locked']|bool) or
|
||||
(info11.openstack_server[0]['locked'] is not defined)
|
||||
- server is changed # no support for lock idempotency
|
||||
|
||||
- name: Unock server
|
||||
@@ -244,7 +250,10 @@
|
||||
that:
|
||||
- info12.openstack_servers.0.status == 'ACTIVE'
|
||||
# not in all versions 'locked' is supported
|
||||
- info12.openstack_servers.0.locked in (None, False)
|
||||
- >-
|
||||
(info12.openstack_server[0]['locked'] is defined and
|
||||
not info12.openstack_server[0]['locked']|bool) or
|
||||
(info12.openstack_server[0]['locked'] is not defined)
|
||||
- server is changed
|
||||
|
||||
- name: Unlock server again
|
||||
@@ -267,7 +276,10 @@
|
||||
- info13.openstack_servers.0.status == 'ACTIVE'
|
||||
- server is changed # no support for unlock idempotency
|
||||
# not in all versions 'locked' is supported
|
||||
- info13.openstack_servers.0.locked in (None, False)
|
||||
- >-
|
||||
(info13.openstack_server[0]['locked'] is defined and
|
||||
not info13.openstack_server[0]['locked']|bool) or
|
||||
(info13.openstack_server[0]['locked'] is not defined)
|
||||
|
||||
- name: Suspend server
|
||||
openstack.cloud.server_action:
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
cloud: "{{ cloud }}"
|
||||
name: ansible_volume_snapshot
|
||||
register: snap_info
|
||||
ignore_errors: sdk_version is version(0.49, '<')
|
||||
|
||||
- name: Create volume backup
|
||||
openstack.cloud.volume_backup:
|
||||
@@ -29,12 +30,14 @@
|
||||
display_name: ansible_volume_backup
|
||||
volume: ansible_volume
|
||||
register: vol_backup
|
||||
ignore_errors: sdk_version is version(0.49, '<')
|
||||
|
||||
- name: Get backup info
|
||||
openstack.cloud.volume_backup_info:
|
||||
cloud: "{{ cloud }}"
|
||||
name: ansible_volume_backup
|
||||
register: backup_info
|
||||
ignore_errors: sdk_version is version(0.49, '<')
|
||||
|
||||
- debug: var=vol
|
||||
|
||||
@@ -49,6 +52,7 @@
|
||||
cloud: "{{ cloud }}"
|
||||
display_name: ansible_volume_backup
|
||||
state: absent
|
||||
ignore_errors: sdk_version is version(0.49, '<')
|
||||
|
||||
- name: Delete volume snapshot
|
||||
openstack.cloud.volume_snapshot:
|
||||
|
||||
@@ -1,122 +1,155 @@
|
||||
- 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
|
||||
display_name: "{{ vol.name }}"
|
||||
loop: "{{ delete.volumes }}"
|
||||
loop_control:
|
||||
loop_var: vol
|
||||
|
||||
- name: Create volume
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
state: present
|
||||
size: 1
|
||||
display_name: ansible_test
|
||||
display_description: testci
|
||||
register: vol
|
||||
|
||||
- name: Get info about volumes
|
||||
- name: Get info about volumes and all projects for all SDK
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: true
|
||||
all_projects: true
|
||||
register: info
|
||||
register: all_sdk
|
||||
ignore_errors: true
|
||||
|
||||
- name: Check info
|
||||
- name: Check info for all projects
|
||||
assert:
|
||||
that:
|
||||
- info.volumes | selectattr("description", "equalto", "testci") | list | length == 1
|
||||
- info.volumes.0.name == 'ansible_test'
|
||||
- info.volumes.0.status == 'available'
|
||||
# Rocky SDK doesn't have all_projects attribute
|
||||
- >-
|
||||
(all_sdk is failed and sdk_version is version(0.19, '<')) or
|
||||
all_sdk is success
|
||||
|
||||
- name: Get not detailed info about volumes
|
||||
- name: Get info about volumes for all SDK
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
all_projects: true
|
||||
register: info1
|
||||
details: true
|
||||
register: all_sdk1
|
||||
ignore_errors: true
|
||||
|
||||
- name: Check info
|
||||
- name: Check info for all SDK
|
||||
assert:
|
||||
that:
|
||||
- info1.volumes | selectattr("id", "equalto", "{{ info.volumes.0.id }}") | list | length == 1
|
||||
- info1.volumes.0.name == 'ansible_test'
|
||||
- info1.volumes.0.status == None
|
||||
- all_sdk1 is success
|
||||
- all_sdk1.volumes is defined
|
||||
|
||||
- name: Get info about volumes with name
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: ansible_test
|
||||
all_projects: true
|
||||
register: info2
|
||||
- name: Run tests for SDK > 0.28 (from train)
|
||||
when: sdk_version is version(0.28, '>')
|
||||
block:
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info2.volumes | length == 1
|
||||
- info2.volumes.0.name == 'ansible_test'
|
||||
- name: Get info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
all_projects: true
|
||||
register: delete
|
||||
|
||||
- name: Get info about volumes with non-existent name
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: nothing_here
|
||||
all_projects: true
|
||||
register: info3
|
||||
- name: Clean up volumes before the test
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
state: absent
|
||||
display_name: "{{ vol.name }}"
|
||||
loop: "{{ delete.volumes }}"
|
||||
loop_control:
|
||||
loop_var: vol
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info3.volumes | length == 0
|
||||
- name: Create volume
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
state: present
|
||||
size: 1
|
||||
display_name: ansible_test
|
||||
display_description: testci
|
||||
register: vol
|
||||
|
||||
- name: Get info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: ansible_test
|
||||
all_projects: true
|
||||
register: info4
|
||||
- name: Get info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: true
|
||||
all_projects: true
|
||||
register: info
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info4.volumes | length == 1
|
||||
- info4.volumes.0.name == 'ansible_test'
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info.volumes | selectattr("description", "equalto", "testci") | list | length == 1
|
||||
- info.volumes.0.name == 'ansible_test'
|
||||
- info.volumes.0.status == 'available'
|
||||
|
||||
- name: Get info about volumes not from all projects
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: ansible_test
|
||||
register: info4a
|
||||
- name: Get not detailed info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
all_projects: true
|
||||
register: info1
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info4a.volumes | length == 1
|
||||
- info4a.volumes.0.name == 'ansible_test'
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info1.volumes | selectattr("id", "equalto", "{{ info.volumes.0.id }}") | list | length == 1
|
||||
- info1.volumes.0.name == 'ansible_test'
|
||||
- info1.volumes.0.status == None
|
||||
|
||||
- name: Delete volume
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
state: absent
|
||||
display_name: ansible_test
|
||||
- name: Get info about volumes with name
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: ansible_test
|
||||
all_projects: true
|
||||
register: info2
|
||||
|
||||
- name: Get info when no volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
all_projects: true
|
||||
register: info5
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info2.volumes | length == 1
|
||||
- info2.volumes.0.name == 'ansible_test'
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info5.volumes | selectattr("name", "equalto", "ansible_test") | list | length == 0
|
||||
- name: Get info about volumes with non-existent name
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: nothing_here
|
||||
all_projects: true
|
||||
register: info3
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info3.volumes | length == 0
|
||||
|
||||
- name: Get info about volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: ansible_test
|
||||
all_projects: true
|
||||
register: info4
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info4.volumes | length == 1
|
||||
- info4.volumes.0.name == 'ansible_test'
|
||||
|
||||
- name: Get info about volumes not from all projects
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
details: false
|
||||
name: ansible_test
|
||||
register: info4a
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info4a.volumes | length == 1
|
||||
- info4a.volumes.0.name == 'ansible_test'
|
||||
|
||||
- name: Delete volume
|
||||
openstack.cloud.volume:
|
||||
cloud: "{{ cloud }}"
|
||||
state: absent
|
||||
display_name: ansible_test
|
||||
|
||||
- name: Get info when no volumes
|
||||
openstack.cloud.volume_info:
|
||||
cloud: "{{ cloud }}"
|
||||
all_projects: true
|
||||
register: info5
|
||||
|
||||
- name: Check info
|
||||
assert:
|
||||
that:
|
||||
- info5.volumes | selectattr("name", "equalto", "ansible_test") | list | length == 0
|
||||
|
||||
Reference in New Issue
Block a user