![Raoul Scarazzini](/assets/img/avatar_default.png)
This commit creates a dedicated task file related to the ha-test-suite command invocation, because of this it will be easier to declare in the main task a test like this: - name: HA test - Master/Slave core resource stop and start vars: ha_test_name: "test_master-slave" ha_recovery_name: "recovery_master-slave" include: ha-test-suite.yml when: test_ha_master_slave|bool In case the test does not require a recovery, then the variable shuld be declared as "". Change-Id: Idd83393e212eed0658898ffd07e7d7316ab061b4
132 lines
3.7 KiB
YAML
132 lines
3.7 KiB
YAML
---
|
|
|
|
- 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
|
|
|
|
- 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: Create the environment template on undercloud
|
|
template:
|
|
src: "{{ validate_ha_heat_environment }}"
|
|
dest: "{{ working_dir }}/validate-ha-heat-environment.yaml"
|
|
mode: 0600
|
|
|
|
- name: Create the test template on undercloud
|
|
template:
|
|
src: "{{ validate_ha_heat_template }}"
|
|
dest: "{{ working_dir }}/validate-ha-heat-template.yaml"
|
|
mode: 0600
|
|
|
|
- name: Download and uncompress (if necessary) image file for Heat
|
|
shell: |
|
|
image_url="{{ validate_ha_heat_instance_image_location }}"
|
|
image_file=$(basename $image_url)
|
|
|
|
curl -s -o $image_file $image_url
|
|
|
|
case "$image_file" in
|
|
*.tar)
|
|
image_name=$(tar xvf $image_file)
|
|
;;
|
|
*.tar.gz|*.tgz)
|
|
image_name=$(tar xzvf $image_file)
|
|
;;
|
|
*.tar.bz2|*.tbz2)
|
|
image_name=$(tar xjvf $image_file)
|
|
;;
|
|
*.tar.xz|*.txz)
|
|
image_name=$(tar xJf $image_file)
|
|
;;
|
|
*.bz2)
|
|
bunzip2 --force --quiet $image_file
|
|
image_name=${image_file%.*};
|
|
;;
|
|
*.gz)
|
|
gunzip --force --quiet $image_file
|
|
image_name=${image_file%.*};
|
|
;;
|
|
*.xz)
|
|
xz --force --quiet --decompress $image_file
|
|
image_name=${image_file%.*};
|
|
;;
|
|
*) image_name=$image_file
|
|
;;
|
|
esac
|
|
|
|
echo $image_name
|
|
register: image_name
|
|
|
|
- set_fact:
|
|
heat_image_name: "{{ image_name.stdout }}"
|
|
|
|
# Test: failed actions
|
|
- name: HA test - Failed actions
|
|
vars:
|
|
ha_test_name: "test_ha_failed_actions"
|
|
ha_recovery_name: ""
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_failed_actions|bool
|
|
|
|
# Test: Master/Slave
|
|
- name: HA test - Master/Slave core resource stop and start
|
|
vars:
|
|
ha_test_name: "test_master-slave"
|
|
ha_recovery_name: "recovery_master-slave"
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_master_slave|bool
|
|
|
|
# Test: Keystone stop
|
|
- name: HA test - Keystone stop
|
|
vars:
|
|
ha_test_name: "test_keystone-stop"
|
|
ha_recovery_name: "recovery_keystone-stop"
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_keystone_stop|bool
|
|
|
|
# Test: Keystone removal
|
|
- name: HA test - Keystone constraint removal
|
|
vars:
|
|
ha_test_name: "test_keystone-constraint-removal"
|
|
ha_recovery_name: "recovery_keystone-constraint-removal"
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_keystone_constraint_removal|bool
|
|
|
|
# Test: NG A
|
|
- name: HA test - Pacemaker light test A
|
|
vars:
|
|
ha_test_name: "test_pacemaker-light-a"
|
|
ha_recovery_name: "recovery_pacemaker-light"
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_ng_a|bool
|
|
|
|
# Test: NG B
|
|
- name: HA test - Pacemaker light test B
|
|
vars:
|
|
ha_test_name: "test_pacemaker-light-b"
|
|
ha_recovery_name: "recovery_pacemaker-light"
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_ng_b|bool
|
|
|
|
# Test: NG C
|
|
- name: HA test - Pacemaker light test B
|
|
vars:
|
|
ha_test_name: "test_pacemaker-light-b"
|
|
ha_recovery_name: "recovery_pacemaker-light"
|
|
include_tasks: ha-test-suite.yml
|
|
when: test_ha_ng_b|bool
|
|
|
|
- name: Remove image file
|
|
file:
|
|
path: "{{ working_dir }}/{{ heat_image_name }}"
|
|
state: absent
|