Skip to content

Commit

Permalink
adapt tests to run with AAP (ansible-collections#559)
Browse files Browse the repository at this point in the history
Modified authorization variables in order to run tests with AAP

Reviewed-by: Polina Rabinovich
Reviewed-by: Shelly Miron
  • Loading branch information
anna-savina authored Dec 2, 2024
1 parent c6666a4 commit c93fe26
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 25 deletions.
8 changes: 4 additions & 4 deletions tests/integration/integration_config.yml.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
VMWARE_HOST: ${VCENTER_HOSTNAME}
VMWARE_USER: ${VCENTER_USERNAME}
VMWARE_PASSWORD: ${VCENTER_PASSWORD}
VMWARE_VALIDATE_CERTS: false
vcenter_hostname: ${VCENTER_HOSTNAME}
vcenter_username: ${VCENTER_USERNAME}
vcenter_password: ${VCENTER_PASSWORD}
vcenter_validate_certs: false
ansible_tags: eco-vcenter-ci
8 changes: 4 additions & 4 deletions tests/integration/targets/init-eco.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BASE_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
export ANSIBLE_ROLES_PATH=${BASE_DIR}

# Authentication vars
export VMWARE_HOST=$(awk '/VMWARE_HOST/ {print $2}' ../../integration_config.yml)
export VMWARE_USER=$(awk '/VMWARE_USER/ {print $2}' ../../integration_config.yml)
export VMWARE_PASSWORD=$(awk '/VMWARE_PASSWORD/ {print $2}' ../../integration_config.yml)
export VMWARE_VALIDATE_CERTS=$(awk '/VMWARE_VALIDATE_CERTS/ {print $2}' ../../integration_config.yml)
export VMWARE_HOST=$(awk '/vcenter_hostname/ {print $2}' ../../integration_config.yml)
export VMWARE_USER=$(awk '/vcenter_username/ {print $2}' ../../integration_config.yml)
export VMWARE_PASSWORD=$(awk '/vcenter_password/ {print $2}' ../../integration_config.yml)
export VMWARE_VALIDATE_CERTS=$(awk '/vcenter_validate_certs/ {print $2}' ../../integration_config.yml)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- name: Test the hostname configuration
vmware.vmware_rest.appliance_networking_dns_hostname:
state: test
name: "{{ VMWARE_HOST }}"
name: "{{ vcenter_hostname }}"
register: test_hostname_result

- name: Assert hostname test result is successful
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
gather_facts: no

tasks:
- name: Import eco-vcenter credentials
ansible.builtin.include_vars:
file: ../group_vars.yml
tags: eco-vcenter-ci

- name: Import vmware_rest_lookup_plugin test
ansible.builtin.import_role:
name: vmware_rest_lookup_plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: Test lookup plugin
block:
- name: Import eco-vcenter common vars
ansible.builtin.include_vars:
file: ../group_vars.yml
tags: eco-vcenter-ci

- name: Create test cluster
vmware.vmware.cluster:
datacenter: "{{ vcenter_datacenter }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
gather_facts: no

tasks:
- name: Import eco-vcenter credentials
ansible.builtin.include_vars:
file: ../group_vars.yml
tags: eco-vcenter-ci

- name: Import vmware_rest_lookup_plugin test
ansible.builtin.import_role:
name: vmware_rest_vcenter_vm_clone_on_library
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: Test VM clone on library
block:
- name: Import eco-vcenter common vars
ansible.builtin.include_vars:
file: ../group_vars.yml
tags: eco-vcenter-ci

- name: Create a content library based on a DataStore
vmware.vmware_rest.content_locallibrary:
name: "{{ library_name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
gather_facts: no

tasks:
- name: Import common vars
ansible.builtin.include_vars:
file: ../group_vars.yml
tags:
- eco-vcenter-ci

- name: Import appliance role
ansible.builtin.import_role:
name: vmware_rest_vcenter_vm_cloning
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: Test VM cloning on a real vCenter
block:
- name: Import eco-vcenter common vars
ansible.builtin.include_vars:
file: ../group_vars.yml
tags: eco-vcenter-ci

- name: Create a generic resource pool
vmware.vmware_rest.vcenter_resourcepool:
name: "{{ resource_pool_name }}"
Expand Down

0 comments on commit c93fe26

Please sign in to comment.