From 08bdb6198e8a45ea9ab818892ea8aece5ac090af Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 5 Sep 2017 19:38:56 -0700 Subject: [PATCH] Migrate more Azure integration tests. (#29034) --- .../azure/azure_rm_virtualmachineimage_facts.py | 2 +- .../targets/azure_rm_deployment/aliases | 3 +++ .../targets/azure_rm_deployment/meta/main.yml | 2 ++ .../azure_rm_deployment/tasks/main.yml | 14 ++++++++++---- .../targets/azure_rm_securitygroup/aliases | 4 ++++ .../targets/azure_rm_securitygroup/meta/main.yml | 2 ++ .../azure_rm_securitygroup/tasks/main.yml | 0 .../azure_rm_virtualmachineimage_facts/aliases | 3 +++ .../meta/main.yml | 2 ++ .../tasks/main.yml | 10 +++++++--- 10 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 test/integration/targets/azure_rm_deployment/aliases create mode 100644 test/integration/targets/azure_rm_deployment/meta/main.yml rename test/integration/{roles => targets}/azure_rm_deployment/tasks/main.yml (63%) create mode 100644 test/integration/targets/azure_rm_securitygroup/aliases create mode 100644 test/integration/targets/azure_rm_securitygroup/meta/main.yml rename test/integration/{roles => targets}/azure_rm_securitygroup/tasks/main.yml (100%) create mode 100644 test/integration/targets/azure_rm_virtualmachineimage_facts/aliases create mode 100644 test/integration/targets/azure_rm_virtualmachineimage_facts/meta/main.yml rename test/integration/{roles => targets}/azure_rm_virtualmachineimage_facts/tasks/main.yml (87%) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py index 789c0c7bc36..8bfeccd3048 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineimage_facts.py @@ -110,7 +110,7 @@ except: from ansible.module_utils.azure_rm_common import AzureRMModuleBase -AZURE_ENUM_MODULES = ['azure.mgmt.compute.models.compute_management_client_enums'] +AZURE_ENUM_MODULES = ['azure.mgmt.compute.models'] class AzureRMVirtualMachineImageFacts(AzureRMModuleBase): diff --git a/test/integration/targets/azure_rm_deployment/aliases b/test/integration/targets/azure_rm_deployment/aliases new file mode 100644 index 00000000000..9e23ddb721f --- /dev/null +++ b/test/integration/targets/azure_rm_deployment/aliases @@ -0,0 +1,3 @@ +cloud/azure +posix/ci/cloud/group2/azure +destructive diff --git a/test/integration/targets/azure_rm_deployment/meta/main.yml b/test/integration/targets/azure_rm_deployment/meta/main.yml new file mode 100644 index 00000000000..95e1952f989 --- /dev/null +++ b/test/integration/targets/azure_rm_deployment/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - setup_azure diff --git a/test/integration/roles/azure_rm_deployment/tasks/main.yml b/test/integration/targets/azure_rm_deployment/tasks/main.yml similarity index 63% rename from test/integration/roles/azure_rm_deployment/tasks/main.yml rename to test/integration/targets/azure_rm_deployment/tasks/main.yml index 5d2f63edc48..ced306efec0 100644 --- a/test/integration/roles/azure_rm_deployment/tasks/main.yml +++ b/test/integration/targets/azure_rm_deployment/tasks/main.yml @@ -1,16 +1,22 @@ +- name: Create random dns label + set_fact: + dns_label: "test{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}" + - name: Create Azure Deploy azure_rm_deployment: - resource_group: Test_Deployment + resource_group: "{{ resource_group }}" + location: "eastus" template_link: 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-linux/azuredeploy.json' + deployment_name: "{{ dns_label }}" parameters: adminUsername: - value: chouseknecht + value: chouseknecht adminPassword: value: password123! dnsLabelPrefix: - value: testvm9910001 + value: "{{ dns_label }}" ubuntuOSVersion: - value: "14.04.2-LTS" + value: "16.04.0-LTS" register: output - name: Add new instance to host group diff --git a/test/integration/targets/azure_rm_securitygroup/aliases b/test/integration/targets/azure_rm_securitygroup/aliases new file mode 100644 index 00000000000..6622a9d9bc1 --- /dev/null +++ b/test/integration/targets/azure_rm_securitygroup/aliases @@ -0,0 +1,4 @@ +cloud/azure +posix/ci/cloud/group2/azure +destructive +azure_rm_securitygroup_facts diff --git a/test/integration/targets/azure_rm_securitygroup/meta/main.yml b/test/integration/targets/azure_rm_securitygroup/meta/main.yml new file mode 100644 index 00000000000..95e1952f989 --- /dev/null +++ b/test/integration/targets/azure_rm_securitygroup/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - setup_azure diff --git a/test/integration/roles/azure_rm_securitygroup/tasks/main.yml b/test/integration/targets/azure_rm_securitygroup/tasks/main.yml similarity index 100% rename from test/integration/roles/azure_rm_securitygroup/tasks/main.yml rename to test/integration/targets/azure_rm_securitygroup/tasks/main.yml diff --git a/test/integration/targets/azure_rm_virtualmachineimage_facts/aliases b/test/integration/targets/azure_rm_virtualmachineimage_facts/aliases new file mode 100644 index 00000000000..9e23ddb721f --- /dev/null +++ b/test/integration/targets/azure_rm_virtualmachineimage_facts/aliases @@ -0,0 +1,3 @@ +cloud/azure +posix/ci/cloud/group2/azure +destructive diff --git a/test/integration/targets/azure_rm_virtualmachineimage_facts/meta/main.yml b/test/integration/targets/azure_rm_virtualmachineimage_facts/meta/main.yml new file mode 100644 index 00000000000..95e1952f989 --- /dev/null +++ b/test/integration/targets/azure_rm_virtualmachineimage_facts/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - setup_azure diff --git a/test/integration/roles/azure_rm_virtualmachineimage_facts/tasks/main.yml b/test/integration/targets/azure_rm_virtualmachineimage_facts/tasks/main.yml similarity index 87% rename from test/integration/roles/azure_rm_virtualmachineimage_facts/tasks/main.yml rename to test/integration/targets/azure_rm_virtualmachineimage_facts/tasks/main.yml index c5bc82e3ccd..e7e82697d95 100644 --- a/test/integration/roles/azure_rm_virtualmachineimage_facts/tasks/main.yml +++ b/test/integration/targets/azure_rm_virtualmachineimage_facts/tasks/main.yml @@ -1,10 +1,14 @@ +- name: set location + set_fact: + location: eastus + - name: Get facts for a specific image azure_rm_virtualmachineimage_facts: location: "{{ location }}" publisher: OpenLogic offer: CentOS - sku: '7.1' - version: '7.1.20150731' + sku: '7.3' + version: '7.3.20170707' register: output - assert: @@ -15,7 +19,7 @@ location: "{{ location }}" publisher: OpenLogic offer: CentOS - sku: '7.1' + sku: '7.3' register: output - assert: