mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-29 08:01:31 -07:00
Test Fixes (#299)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
697908c7fe
commit
5b92781ab0
45 changed files with 19 additions and 96 deletions
|
@ -1,3 +1,2 @@
|
|||
---
|
||||
resource_name: "{{ resource_prefix }}"
|
||||
sa_name: sa-{{ 100000 | random }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# Pre-test setup
|
||||
- name: delete a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
name: sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
@ -24,7 +24,7 @@
|
|||
#----------------------------------------------------------
|
||||
- name: create a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
name: sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
@ -46,11 +46,11 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*{{ sa_name }}.*") | list | length == 1
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com.*") | list | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a service account that already exists
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
name: sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
@ -64,7 +64,7 @@
|
|||
#----------------------------------------------------------
|
||||
- name: delete a service account
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
name: sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
@ -86,11 +86,11 @@
|
|||
- name: verify that command succeeded
|
||||
assert:
|
||||
that:
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*{{ sa_name }}.*") | list | length == 0
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com.*") | list | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a service account that does not exist
|
||||
gcp_iam_service_account:
|
||||
name: "{{ sa_name }}"
|
||||
name: sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com
|
||||
display_name: My Ansible test key
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue