From d309530bb63a0c84f1d7023bd6ee2513f2729261 Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Fri, 7 Sep 2018 12:52:00 +0800 Subject: [PATCH] consolidate availabilityset tests (#45327) --- .../targets/azure_rm_availabilityset/aliases | 1 + .../azure_rm_availabilityset/tasks/main.yml | 18 ++++++++++++ .../azure_rm_availabilityset_facts/aliases | 4 --- .../meta/main.yml | 2 -- .../tasks/main.yml | 29 ------------------- 5 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 test/integration/targets/azure_rm_availabilityset_facts/aliases delete mode 100644 test/integration/targets/azure_rm_availabilityset_facts/meta/main.yml delete mode 100644 test/integration/targets/azure_rm_availabilityset_facts/tasks/main.yml diff --git a/test/integration/targets/azure_rm_availabilityset/aliases b/test/integration/targets/azure_rm_availabilityset/aliases index 8f7a9a2e56..d0b4250af5 100644 --- a/test/integration/targets/azure_rm_availabilityset/aliases +++ b/test/integration/targets/azure_rm_availabilityset/aliases @@ -1,3 +1,4 @@ cloud/azure shippable/azure/group1 destructive +azure_rm_availalibityset_facts diff --git a/test/integration/targets/azure_rm_availabilityset/tasks/main.yml b/test/integration/targets/azure_rm_availabilityset/tasks/main.yml index 506aa20637..62af52c6bd 100644 --- a/test/integration/targets/azure_rm_availabilityset/tasks/main.yml +++ b/test/integration/targets/azure_rm_availabilityset/tasks/main.yml @@ -99,6 +99,24 @@ - not results.changed - results.state.tags.checktest1 == 'modified1' +# +# azure_rm_availabilityset_facts tests +# +- name: Get facts for created availability set + azure_rm_availabilityset_facts: + name: myavailabilityset2 + resource_group: "{{ resource_group }}" + register: results + +- assert: + that: + - not results.changed + - not results.failed + - results.ansible_facts.azure_availabilitysets[0].properties.platformFaultDomainCount == 2 + - results.ansible_facts.azure_availabilitysets[0].properties.platformUpdateDomainCount == 5 + - results.ansible_facts.azure_availabilitysets[0].sku == 'Aligned' + + - name: Delete an availability set azure_rm_availabilityset: name: myavailabilityset1 diff --git a/test/integration/targets/azure_rm_availabilityset_facts/aliases b/test/integration/targets/azure_rm_availabilityset_facts/aliases deleted file mode 100644 index 385e51ef1d..0000000000 --- a/test/integration/targets/azure_rm_availabilityset_facts/aliases +++ /dev/null @@ -1,4 +0,0 @@ -cloud/azure -shippable/azure/group4 -shippable/azure/smoketest -destructive diff --git a/test/integration/targets/azure_rm_availabilityset_facts/meta/main.yml b/test/integration/targets/azure_rm_availabilityset_facts/meta/main.yml deleted file mode 100644 index 95e1952f98..0000000000 --- a/test/integration/targets/azure_rm_availabilityset_facts/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - setup_azure diff --git a/test/integration/targets/azure_rm_availabilityset_facts/tasks/main.yml b/test/integration/targets/azure_rm_availabilityset_facts/tasks/main.yml deleted file mode 100644 index 508c55206e..0000000000 --- a/test/integration/targets/azure_rm_availabilityset_facts/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: Create an availability set - azure_rm_availabilityset: - name: myavailabilityset1 - resource_group: "{{ resource_group }}" - platform_update_domain_count: 5 - platform_fault_domain_count: 2 - sku: Classic - tags: - tag1: testtag - -- name: Get facts for created availability set - azure_rm_availabilityset_facts: - name: myavailabilityset1 - resource_group: "{{ resource_group }}" - register: results - -- assert: - that: - - not results.changed - - not results.failed - - results.ansible_facts.azure_availabilitysets[0].properties.platformFaultDomainCount == 2 - - results.ansible_facts.azure_availabilitysets[0].properties.platformUpdateDomainCount == 5 - - results.ansible_facts.azure_availabilitysets[0].sku == 'Classic' - -- name: Delete the availability set - azure_rm_availabilityset: - name: myavailabilityset1 - resource_group: "{{ resource_group }}" - state: absent