summaryrefslogtreecommitdiff
path: root/test/integration/targets
diff options
context:
space:
mode:
authorYuwei Zhou <yuwzho@microsoft.com>2019-04-24 14:15:13 +0800
committerZim Kalinowski <zikalino@microsoft.com>2019-04-24 14:15:13 +0800
commit0d3d0025055e03f778ef8f13abc4e8adb2f774b8 (patch)
tree80ecc6af8a41d9c5e5fdfc1aadccf9df3f3b09d1 /test/integration/targets
parent204db4d0444b2d1d3929774b5ac11b71893d3fb6 (diff)
downloadansible-0d3d0025055e03f778ef8f13abc4e8adb2f774b8.tar.gz
add resource group test (#55688)
Diffstat (limited to 'test/integration/targets')
-rw-r--r--test/integration/targets/azure_rm_resourcegroup/aliases4
-rw-r--r--test/integration/targets/azure_rm_resourcegroup/meta/main.yml2
-rw-r--r--test/integration/targets/azure_rm_resourcegroup/tasks/main.yml39
3 files changed, 45 insertions, 0 deletions
diff --git a/test/integration/targets/azure_rm_resourcegroup/aliases b/test/integration/targets/azure_rm_resourcegroup/aliases
new file mode 100644
index 0000000000..3b0b9bf381
--- /dev/null
+++ b/test/integration/targets/azure_rm_resourcegroup/aliases
@@ -0,0 +1,4 @@
+cloud/azure
+shippable/azure/group3
+destructive
+azure_rm_resourcegroup_facts
diff --git a/test/integration/targets/azure_rm_resourcegroup/meta/main.yml b/test/integration/targets/azure_rm_resourcegroup/meta/main.yml
new file mode 100644
index 0000000000..95e1952f98
--- /dev/null
+++ b/test/integration/targets/azure_rm_resourcegroup/meta/main.yml
@@ -0,0 +1,2 @@
+dependencies:
+ - setup_azure
diff --git a/test/integration/targets/azure_rm_resourcegroup/tasks/main.yml b/test/integration/targets/azure_rm_resourcegroup/tasks/main.yml
new file mode 100644
index 0000000000..db4512701d
--- /dev/null
+++ b/test/integration/targets/azure_rm_resourcegroup/tasks/main.yml
@@ -0,0 +1,39 @@
+- name: Get resource group facts
+ azure_rm_resourcegroup_facts:
+ register: rg
+
+- assert:
+ that:
+ - rg.resourcegroups | length >= 1
+
+- name: Get resource group facts
+ azure_rm_resourcegroup_facts:
+ name: "{{ resource_group }}"
+ list_resources: yes
+ register: rg
+
+- assert:
+ that:
+ - rg.resourcegroups | length == 1
+ - rg.resourcegroups[0].resources | length >= 0
+
+- name: Create resource group (idempontent)
+ azure_rm_resourcegroup:
+ name: "{{ resource_group }}"
+ location: "{{ rg.resourcegroups[0].location }}"
+ register: output
+
+- assert:
+ that:
+ - not output.changed
+
+- name: delete resource group
+ azure_rm_resourcegroup:
+ name: "{{ resource_group }}"
+ state: absent
+ check_mode: yes
+ register: output
+
+- assert:
+ that:
+ - output.changed \ No newline at end of file