From fcd75bbc5a9bc33c62c59f301b0fc499589b9508 Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Thu, 22 Mar 2018 11:58:28 +0800 Subject: [PATCH] fixing function app test (#37687) --- .../targets/azure_rm_functionapp/aliases | 1 + .../azure_rm_functionapp/tasks/main.yml | 28 +++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/test/integration/targets/azure_rm_functionapp/aliases b/test/integration/targets/azure_rm_functionapp/aliases index b1cd4a5978c..9e23ddb721f 100644 --- a/test/integration/targets/azure_rm_functionapp/aliases +++ b/test/integration/targets/azure_rm_functionapp/aliases @@ -1,2 +1,3 @@ cloud/azure +posix/ci/cloud/group2/azure destructive diff --git a/test/integration/targets/azure_rm_functionapp/tasks/main.yml b/test/integration/targets/azure_rm_functionapp/tasks/main.yml index c1b9388bbdd..35cd1027413 100644 --- a/test/integration/targets/azure_rm_functionapp/tasks/main.yml +++ b/test/integration/targets/azure_rm_functionapp/tasks/main.yml @@ -1,14 +1,18 @@ +- name: Fix resource prefix + set_fact: + fixed_resource_prefix: "{{ resource_prefix | replace('-','x') }}" + - name: create storage account for function apps azure_rm_storageaccount: resource_group: '{{ resource_group }}' - name: azfunccistor4 + name: sa{{ fixed_resource_prefix }} account_type: Standard_LRS - name: create basic function app azure_rm_functionapp: resource_group: '{{ resource_group }}' - name: azfuncci - storage_account: azfunccistor4 + name: af{{ fixed_resource_prefix }} + storage_account: sa{{ fixed_resource_prefix }} register: output - name: assert the function was created @@ -18,19 +22,19 @@ - name: list facts for function azure_rm_functionapp_facts: resource_group: '{{ resource_group }}' - name: azfuncci + name: af{{ fixed_resource_prefix }} register: results - name: assert the facts were retrieved assert: that: - results.ansible_facts.azure_functionapps|length == 1 - - results.ansible_facts.azure_functionapps[0].name == 'azfuncci' + - results.ansible_facts.azure_functionapps[0].name == 'af{{ fixed_resource_prefix }}' - name: delete basic function app azure_rm_functionapp: resource_group: '{{ resource_group }}' - name: azfuncci + name: af{{ fixed_resource_prefix }} state: absent register: output @@ -41,8 +45,8 @@ - name: create a function with app settings azure_rm_functionapp: resource_group: '{{ resource_group }}' - name: azfuncci - storage_account: azfunccistor4 + name: af{{ fixed_resource_prefix }} + storage_account: sa{{ fixed_resource_prefix }} app_settings: hello: world things: more stuff @@ -55,8 +59,8 @@ - name: change app settings azure_rm_functionapp: resource_group: '{{ resource_group }}' - name: azfuncci - storage_account: azfunccistor4 + name: af{{ fixed_resource_prefix }} + storage_account: sa{{ fixed_resource_prefix }} app_settings: hello: world things: more stuff @@ -70,7 +74,7 @@ - name: delete the function app azure_rm_functionapp: resource_group: '{{ resource_group }}' - name: azfuncci + name: af{{ fixed_resource_prefix }} state: absent register: output @@ -81,5 +85,5 @@ - name: delete storage account azure_rm_storageaccount: resource_group: '{{ resource_group }}' - name: azfunccistor4 + name: sa{{ fixed_resource_prefix }} state: absent