summaryrefslogtreecommitdiff
path: root/test/integration/targets/cs_zone_info
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2019-08-29 16:14:51 +0200
committerGitHub <noreply@github.com>2019-08-29 16:14:51 +0200
commit0c592c8225541eeac22dad055ce1b721682760e9 (patch)
tree3448a367c3a73ad0c7f973baf752081cfee736aa /test/integration/targets/cs_zone_info
parent9b5528ab8e3f01577ddb6390174cfa1021037597 (diff)
downloadansible-0c592c8225541eeac22dad055ce1b721682760e9.tar.gz
CloudStack modules: rename _facts -> _info (#61090)
* Rename cloudstack _facts -> _info * Add changelog. * Fix errors due to overloaded get_result having different parameter names. * Fix examples. * Change debug tasks. * Remove unneeded code. * Change from rename -> deprecate+new module. * Make cs_zone_info return a list. * Make cs_instance_info return a list. * Fix return value docs. * Fix typo. * Improve tests. * Fix cs_zone_info. * Linting. * Fix alias/option switch. * Fix version numbers. * Extend docs.
Diffstat (limited to 'test/integration/targets/cs_zone_info')
-rw-r--r--test/integration/targets/cs_zone_info/aliases2
-rw-r--r--test/integration/targets/cs_zone_info/meta/main.yml3
-rw-r--r--test/integration/targets/cs_zone_info/tasks/main.yml73
3 files changed, 78 insertions, 0 deletions
diff --git a/test/integration/targets/cs_zone_info/aliases b/test/integration/targets/cs_zone_info/aliases
new file mode 100644
index 0000000000..c89c86d7d2
--- /dev/null
+++ b/test/integration/targets/cs_zone_info/aliases
@@ -0,0 +1,2 @@
+cloud/cs
+shippable/cs/group1
diff --git a/test/integration/targets/cs_zone_info/meta/main.yml b/test/integration/targets/cs_zone_info/meta/main.yml
new file mode 100644
index 0000000000..e9a5b9eeae
--- /dev/null
+++ b/test/integration/targets/cs_zone_info/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - cs_common
diff --git a/test/integration/targets/cs_zone_info/tasks/main.yml b/test/integration/targets/cs_zone_info/tasks/main.yml
new file mode 100644
index 0000000000..74dccf8062
--- /dev/null
+++ b/test/integration/targets/cs_zone_info/tasks/main.yml
@@ -0,0 +1,73 @@
+---
+- name: setup zone is present
+ cs_zone:
+ name: "{{ cs_resource_prefix }}-zone"
+ dns1: 8.8.8.8
+ dns2: 8.8.4.4
+ network_type: Basic
+ register: zone
+- name: verify setup zone is present
+ assert:
+ that:
+ - zone is successful
+
+- name: get info from zone in check mode
+ cs_zone_info:
+ name: "{{ cs_resource_prefix }}-zone"
+ register: zone
+ check_mode: yes
+- name: verify get info from zone in check mode
+ assert:
+ that:
+ - zone is successful
+ - zone is not changed
+ - zone.zones[0].dns1 == "8.8.8.8"
+ - zone.zones[0].dns2 == "8.8.4.4"
+ - zone.zones[0].internal_dns1 == "8.8.8.8"
+ - zone.zones[0].internal_dns2 == "8.8.4.4"
+ - zone.zones[0].local_storage_enabled == false
+ - zone.zones[0].network_type == "Basic"
+ - zone.zones[0].zone_token != ""
+ - zone.zones[0].securitygroups_enabled == true
+ - zone.zones[0].dhcp_provider == "VirtualRouter"
+ - zone.zones[0].local_storage_enabled == false
+
+- name: get info from zone
+ cs_zone_info:
+ name: "{{ cs_resource_prefix }}-zone"
+ register: zone
+- name: verify get info from zone
+ assert:
+ that:
+ - zone is successful
+ - zone is not changed
+ - zone.zones[0].dns1 == "8.8.8.8"
+ - zone.zones[0].dns2 == "8.8.4.4"
+ - zone.zones[0].internal_dns1 == "8.8.8.8"
+ - zone.zones[0].internal_dns2 == "8.8.4.4"
+ - zone.zones[0].local_storage_enabled == false
+ - zone.zones[0].network_type == "Basic"
+ - zone.zones[0].zone_token != ""
+ - zone.zones[0].securitygroups_enabled == true
+ - zone.zones[0].dhcp_provider == "VirtualRouter"
+ - zone.zones[0].local_storage_enabled == false
+
+- name: get info from all zones
+ cs_zone_info:
+ register: zones
+- name: verify get info from all zones
+ assert:
+ that:
+ - zones is successful
+ - zones is not changed
+ - zones.zones | length > 0
+ - '"dns1" in zone.zones[0]'
+ - '"dns2" in zone.zones[0]'
+ - '"internal_dns1" in zone.zones[0]'
+ - '"internal_dns2" in zone.zones[0]'
+ - '"local_storage_enabled" in zone.zones[0]'
+ - '"network_type" in zone.zones[0]'
+ - '"zone_token" in zone.zones[0]'
+ - '"securitygroups_enabled" in zone.zones[0]'
+ - '"dhcp_provider" in zone.zones[0]'
+ - '"local_storage_enabled" in zone.zones[0]'