From 609bb4ee0545245b2fa1722a401efa9b598d783a Mon Sep 17 00:00:00 2001 From: Raoul Scarazzini Date: Thu, 28 Sep 2017 06:22:02 -0400 Subject: [PATCH] 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 --- roles/validate-ha/tasks/main.yml | 8 ++++++++ tools/ha-test-suite/include/functions | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/validate-ha/tasks/main.yml b/roles/validate-ha/tasks/main.yml index 1630e01..56cc63e 100644 --- a/roles/validate-ha/tasks/main.yml +++ b/roles/validate-ha/tasks/main.yml @@ -51,6 +51,7 @@ 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 @@ -66,6 +67,7 @@ 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 @@ -81,6 +83,7 @@ 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 @@ -96,6 +99,7 @@ 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 @@ -111,6 +115,7 @@ 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 @@ -126,6 +131,7 @@ 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 @@ -141,6 +147,7 @@ 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 @@ -155,4 +162,5 @@ 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 diff --git a/tools/ha-test-suite/include/functions b/tools/ha-test-suite/include/functions index b03c0fa..765a0e3 100755 --- a/tools/ha-test-suite/include/functions +++ b/tools/ha-test-suite/include/functions @@ -137,7 +137,7 @@ function play_on_resources { do echo -n "$(date) - Performing action $action on resource $resource " # Do the action on the resource - sudo pcs resource $action $resource --wait $RESOURCE_CHANGE_STATUS_TIMEOUT + sudo pcs resource $action $resource --wait=$RESOURCE_CHANGE_STATUS_TIMEOUT if [ $? -ne 0 ] then echo "FAILURE!"