
Functional tests for a change Ifc6c28003c4c2c5f3dd6198e650f9713a02dc82d In order to use the 'validation_dir' and 'ansible_dir' parameters in the YAML file when executing the 'file' command, the original parameters 'validation_dir' and 'ansible_dir' are changed to 'validation_dir_arg' and 'ansible_dir_arg' when using as a argument in the 'run' command. Related-to: rhbz#2122209 Signed-off-by: Veronika Fisarova <vfisarov@redhat.com> Change-Id: I56d974814987ef7a1cc105d4efe3123dd97f6b3e
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
---
|
|
- name: Create extra vars file
|
|
shell:
|
|
cmd: "echo -e 'minimal_cpu_count: 2\nminimal_ram_gb: 2\n' > {{ extra_vars_uuid }}extra_vars.yaml"
|
|
executable: /bin/bash
|
|
|
|
- name: Run validations with extra vars file
|
|
shell:
|
|
cmd: >-
|
|
{{ validation_command }} run --validation {{ name.key }}
|
|
{{ validation_dir_arg }} {{ ansible_dir_arg }}
|
|
--inventory {{ inventory }}
|
|
--output-log validation_{{ name.key }}_extra_vars_file.log
|
|
--extra-vars-file {{ extra_vars_uuid }}extra_vars.yaml
|
|
{{ name.value.extra_env_args }}
|
|
executable: /bin/bash
|
|
|
|
- name: Get Run results
|
|
block:
|
|
- name: Get run results
|
|
register: result
|
|
shell:
|
|
cmd: "cat validation_{{ name.key }}_extra_vars_file.log"
|
|
executable: /bin/bash
|
|
|
|
- name: Get json data
|
|
set_fact:
|
|
jsondata: "{{ result.stdout | from_json }}"
|
|
|
|
- name: Get Validations Status
|
|
set_fact:
|
|
status: "{{ jsondata | json_query(jsonres) }}"
|
|
vars:
|
|
jsonres: 'results[*].Status'
|
|
|
|
- fail:
|
|
msg: "Validation failed with {{ validation_status }}: some of the validations has failed. {{ status }}"
|
|
when: validation_status != "PASSED"
|
|
loop: "{{ status }}"
|
|
loop_control:
|
|
loop_var: validation_status
|