vmware_content_library_info: init the functional test

`vmware_content_library_info` functional test is currently broken because it
assumes the vCenter content library is not empty.
With this commit, the test inits the vCenter content library database using
`prepapre_vmware_tests`, this before the functional test execution.
This commit is contained in:
Gonéri Le Bouder 2019-07-24 10:50:23 +02:00
parent 47496098e7
commit fb96f0b8ae
3 changed files with 22 additions and 0 deletions

View file

@ -25,3 +25,5 @@
when: setup_category is defined when: setup_category is defined
- include_tasks: setup_tag.yml - include_tasks: setup_tag.yml
when: setup_tag is defined when: setup_tag is defined
- include_tasks: setup_content_library.yml
when: setup_content_library is defined

View file

@ -0,0 +1,11 @@
- name: Create Content Library
vmware_content_library_manager:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
library_name: test-content-lib
library_description: 'Library created by the prepare_vmware_tests role'
library_type: local
datastore_name: '{{ ds2 }}'
validate_certs: False
state: present

View file

@ -4,6 +4,14 @@
- when: vcsim is not defined - when: vcsim is not defined
block: block:
- import_role:
name: prepare_vmware_tests
vars:
setup_attach_host: true
setup_datastore: true
setup_content_library: true
# Get List of Content Libraries # Get List of Content Libraries
- name: Get List of Content Libraries - name: Get List of Content Libraries
vmware_content_library_info: vmware_content_library_info:
@ -13,6 +21,7 @@
validate_certs: false validate_certs: false
register: content_library_info register: content_library_info
- debug: var=content_library_info
- set_fact: content_library="{{ content_library_info['content_libs'][0] }}" - set_fact: content_library="{{ content_library_info['content_libs'][0] }}"
# Get Details of content library # Get Details of content library