89 lines
2.4 KiB
YAML
89 lines
2.4 KiB
YAML
---
|
|
- name: Dump the config file and start the QDR
|
|
hosts: all
|
|
tasks:
|
|
- name: Check for qdrouterd.conf
|
|
find:
|
|
paths: "{{ tripleo_metrics_qdr_conf_output_dir }}"
|
|
patterns: qdrouterd.conf
|
|
register: conf
|
|
failed_when: conf.files|length != 1
|
|
|
|
- name: Read the config file
|
|
slurp:
|
|
src: "{{ tripleo_metrics_qdr_conf_output_dir }}/qdrouterd.conf"
|
|
register: qdrconfig
|
|
|
|
- name: Decode the content
|
|
set_fact:
|
|
qdrconfig_content: "{{ qdrconfig['content'] | b64decode }}"
|
|
|
|
- name: Split into lines
|
|
debug:
|
|
msg: "{{ qdrconfig_content.split('\n') }}"
|
|
|
|
- name: Start qdrouterd # noqa 301
|
|
command: qdrouterd -U qdrouterd -d
|
|
|
|
- name: Functional tests
|
|
hosts: localhost
|
|
tasks:
|
|
- block:
|
|
- name: Clear the failure flag
|
|
set_fact: functest_failed_flag="unknown"
|
|
|
|
- name: Run the qdr test from STF functional-tests
|
|
include_role:
|
|
name: functional_tests
|
|
tasks_from: test_qdr
|
|
vars:
|
|
qdr_container_name: 'ubi8'
|
|
container_bin: podman
|
|
|
|
rescue:
|
|
- name: Set flag if functional tests failed
|
|
set_fact: functest_failed_flag="failed"
|
|
|
|
- name: Check functional test failure flag
|
|
hosts: localhost
|
|
tasks:
|
|
- assert:
|
|
that:
|
|
- functest_failed_flag != "failed"
|
|
name: Functional tests passed
|
|
|
|
- name: Process qdr log
|
|
hosts: all
|
|
tasks:
|
|
- name: Slurp the file
|
|
slurp:
|
|
src: /var/log/qdrouterd/metrics_qdr.log
|
|
register: qdrlog
|
|
|
|
- name: Decode the content
|
|
set_fact:
|
|
qdrlog_content: "{{ qdrlog['content'] | b64decode }}"
|
|
|
|
- name: Split into lines
|
|
debug:
|
|
msg: "{{ qdrlog_content.split('\n') }}"
|
|
|
|
- name: Check for errors
|
|
debug:
|
|
msg: "[WARNING] Found errors in the log. Please review above"
|
|
when: qdrlog_content.find('ERROR (error)') != -1
|
|
|
|
- name: Check log for correct config of common QDR functionality
|
|
hosts: all
|
|
tasks:
|
|
- assert:
|
|
that:
|
|
- "{{ qdrlog_content is search ('Configured Listener: '
|
|
+ ansible_default_ipv4.address + ':5666 proto=any, role=normal') }}"
|
|
name: Local listener configured
|
|
|
|
- assert:
|
|
that:
|
|
- qdrlog_content is search('Created SSL Profile with name sslProfile')
|
|
name: default sslProfile for external connector configured
|