Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to SDK's cloud layer function search_domains which allows us to reduce our code. Added integration test for this module. Change-Id: Ic7915fd3334266783ea5e9d442ef304fa734ca00
- Loading branch information
Showing
5 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
domain_name: domain_info_test_domain | ||
unexistent_domain_name: domain_info_unexistent_domain | ||
disabled_domain_name: test_domain_disabled | ||
domain_info_fields: | ||
- description | ||
- id | ||
- is_enabled | ||
- name | ||
- links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
- block: | ||
- name: Ensure domain does not exist | ||
openstack.cloud.identity_domain: | ||
cloud: "{{ cloud }}" | ||
state: absent | ||
name: "{{ unexistent_domain_name }}" | ||
- name: Get unexistent domain | ||
openstack.cloud.identity_domain_info: | ||
cloud: "{{ cloud }}" | ||
name: "{{ unexistent_domain_name }}" | ||
register: domain_info | ||
- name: Assert no results returned | ||
assert: | ||
that: not domain_info.openstack_domains | ||
|
||
|
||
- block: | ||
- name: Ensure domain exists | ||
openstack.cloud.identity_domain: | ||
cloud: "{{ cloud }}" | ||
state: present | ||
name: "{{ domain_name }}" | ||
description: "test description" | ||
register: domain | ||
- name: Get domain | ||
openstack.cloud.identity_domain_info: | ||
cloud: "{{ cloud }}" | ||
name: "{{ domain_name }}" | ||
register: domain_info | ||
- name: Assert one result exists | ||
assert: | ||
that: domain_info.openstack_domains | length == 1 | ||
- name: Assert fields are present | ||
assert: | ||
that: item in domain_info.openstack_domains[0] | ||
loop: "{{ domain_info_fields }}" | ||
- name: Assert returned value | ||
assert: | ||
that: | ||
- domain_info.openstack_domains[0].description == domain.domain.description | ||
|
||
- block: | ||
- name: Get all domains | ||
openstack.cloud.identity_domain_info: | ||
cloud: "{{ cloud }}" | ||
register: domain_info | ||
|
||
- block: | ||
- name: Ensure disabled domain exists | ||
openstack.cloud.identity_domain: | ||
cloud: "{{ cloud }}" | ||
state: present | ||
name: "{{ disabled_domain_name }}" | ||
enabled: false | ||
description: "test description" | ||
register: domain | ||
- name: Get filtered domains | ||
openstack.cloud.identity_domain_info: | ||
cloud: "{{ cloud }}" | ||
filters: | ||
enabled: true | ||
register: domain_info | ||
- name: Assert at least one result | ||
assert: | ||
that: domain_info.openstack_domains | length >= 1 | ||
- name: Assert returned value | ||
assert: | ||
that: item.is_enabled == true | ||
loop: "{{ domain_info.openstack_domains }}" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters