Files
tripleo-ha-utils/roles/validate-ha/tasks/main.yml
Raoul Scarazzini 609bb4ee05 Force failure after ops in rescue and fix wait opt
Today we manage tests between "blocks:" with "always:" and "rescue:" to
get the output of the commands, both stderr and stdout. Problem is that
instead of stopping we move on, and this is not useful when you want to
investigate on problems like the --wait 600 versus --wait=600 (that this
patch solves, too).

Change-Id: Icd5f6f8bdff8c563131856286e82f9a7169b5fc7
2017-09-28 06:22:10 -04:00

167 lines
8.1 KiB
YAML

---
- name: Creating the environment file on undercloud
template:
src: "{{ environment_file }}"
dest: "{{ working_dir }}/environment"
mode: 0600
- name: Load the workarounds script on the undercloud
template:
src: "{{ workarounds_script }}"
dest: "{{ working_dir }}/workarounds.sh"
mode: 0755
when: apply_workarounds
- name: Execute workarounds script on the undercloud
shell: >
"{{ working_dir }}/workarounds.sh"
when: apply_workarounds
- name: Copy ha-test-suite on undercloud
synchronize:
src: "{{ local_working_dir }}/tripleo-quickstart-utils/tools/ha-test-suite/"
dest: "{{ working_dir }}/ha-test-suite"
use_ssh_args: true
- name: Copy ha-test-suite on controllers
shell: >
/usr/bin/rsync --delay-updates -F --compress --archive -e 'ssh -F {{ local_working_dir }}/ssh.config.ansible' {{ local_working_dir }}/tripleo-quickstart-utils/tools/ha-test-suite {{ hostvars[item]['ansible_hostname'] }}:
delegate_to: "localhost"
with_items:
- "{{ groups['controller'] }}"
- name: Include test sequence depending on release
include_vars:
dir: "vars"
files_matching: "test_list_{{ release }}.yml"
- name: Create directory on the undercloud to store test results
file: path={{ validate_ha_logs_dir }} state=directory
# Test: failed actions
- block:
- name: HA test - Failed actions (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_check-failed-actions
register: test_ha_failed_actions_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_failed_actions_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_failed_actions_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_failed_actions_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_failed_actions_stderr.log"
- fail: msg="{{ test_ha_failed_actions_cmd.stderr }}"
when: test_ha_failed_actions|bool
# Test: Master/Slave
- block:
- name: HA test - Master/Slave core resource stop and start (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_master-slave -r {{ overcloud_working_dir }}/ha-test-suite/recovery/recovery_master-slave
register: test_ha_master_slave_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_master_slave_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_master_slave_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_master_slave_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_master_slave_stderr.log"
- fail: msg="{{ test_ha_master_slave_cmd.stderr }}"
when: test_ha_master_slave|bool
# Test: Keystone stop
- block:
- name: HA test Keystone stop (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_keystone-constraint-removal -r {{ overcloud_working_dir }}/ha-test-suite/recovery/recovery_keystone-constraint-removal
register: test_ha_keystone_stop_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_keystone_stop_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_keystone_stop_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_keystone_stop_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_keystone_stop_stderr.log"
- fail: msg="{{ test_ha_keystone_stop_cmd.stderr }}"
when: test_ha_keystone_stop|bool
# Test: Keystone removal
- block:
- name: HA test Keystone removal (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_keystone-constraint-removal -r {{ overcloud_working_dir }}/ha-test-suite/recovery/recovery_keystone-constraint-removal
register: test_ha_keystone_constraint_removal_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_keystone_constraint_removal_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_keystone_constraint_removal_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_keystone_constraint_removal_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_keystone_constraint_removal_stderr.log"
- fail: msg="{{ test_ha_keystone_constraint_removal_cmd.stderr }}"
when: test_ha_keystone_constraint_removal|bool
# Test: NG A
- block:
- name: HA test NG A (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_pacemaker-light-a -r {{ overcloud_working_dir }}/ha-test-suite/recovery/recovery_pacemaker-light
register: test_ha_ng_a_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_ng_a_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_ng_a_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_ng_a_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_ng_a_stderr.log"
- fail: msg="{{ test_ha_ng_a_cmd.stderr }}"
when: test_ha_ng_a|bool
# Test: NG B
- block:
- name: HA test NG B (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_pacemaker-light-b -r {{ overcloud_working_dir }}/ha-test-suite/recovery/recovery_pacemaker-light
register: test_ha_ng_b_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_ng_b_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_ng_b_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_ng_b_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_ng_b_stderr.log"
- fail: msg="{{ test_ha_ng_b_cmd.stderr }}"
when: test_ha_ng_b|bool
# Test: NG C
- block:
- name: HA test NG C (overcloud)
delegate_to: "{{ groups.controller[0] }}"
shell: >
{{ overcloud_working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ overcloud_working_dir }}/ha-test-suite/test/test_pacemaker-light-c -r {{ overcloud_working_dir }}/ha-test-suite/recovery/recovery_pacemaker-light
register: test_ha_ng_c_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_ng_c_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_ng_c_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_ng_c_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_ng_c_stderr.log"
- fail: msg="{{ test_ha_ng_c_cmd.stderr }}"
when: test_ha_ng_c|bool
# Test: Instance deployment
- block:
- name: HA Test instance deploy on the overcloud (undercloud)
shell: >
{{ working_dir }}/ha-test-suite/ha-test-suite.sh -t {{ working_dir }}/ha-test-suite/test/test_instance-creation -r {{ working_dir }}/ha-test-suite/recovery/recovery_instance-creation -u
register: test_ha_instance_cmd
always:
- name: copy stdout test result to undercloud and check command
copy: content="{{ test_ha_instance_cmd.stdout }}" dest="{{ validate_ha_logs_dir }}/test_ha_instance_stdout.log"
rescue:
- name: copy stderr test result to undercloud and check command
copy: content="{{ test_ha_instance_cmd.stderr }}" dest="{{ validate_ha_logs_dir }}/test_ha_instance_stderr.log"
- fail: msg="{{ test_ha_instance_cmd.stderr }}"
when: test_ha_instance|bool