@@ -27,7 +27,6 @@ failed_version() {
27
27
analyze_logs_by_logdetective () {
28
28
# logdetective should not break the test functionality
29
29
# Therefore `set +e` is setup
30
- set +e
31
30
local log_file_name=" $1 "
32
31
echo " Sending failed log by fpaste command to paste bin."
33
32
paste_bin_link=$( fpaste " $log_file_name " )
@@ -47,25 +46,19 @@ analyze_logs_by_logdetective() {
47
46
echo " ERROR: Failed to analyze log file by logdetective server."
48
47
cat " ${logdetective_test_file} "
49
48
echo " -------- LOGDETECTIVE TEST LOG ANALYSIS FAILED --------"
50
- # Let's switch it back
51
- set -e
52
49
return
53
50
fi
54
51
jq -rC ' .explanation.text' < " ${logdetective_test_file} "
55
52
# This part of code is from https://github.com/teemtee/tmt/blob/main/tmt/steps/scripts/tmt-file-submit
56
53
if [ -z " $TMT_TEST_PIDFILE " ]; then
57
54
echo " File submit to data dir can be used only in the context of a running test."
58
- # Let's switch it back
59
- set -e
60
55
return
61
56
fi
62
57
# This variable is set by tmt
63
58
[ -d " $TMT_TEST_DATA " ] || mkdir -p " $TMT_TEST_DATA "
64
59
cp -f " ${logdetective_test_file} " " $TMT_TEST_DATA "
65
60
echo " File '${logdetective_test_file} ' stored to '$TMT_TEST_DATA '."
66
61
echo " -------- LOGDETECTIVE TEST LOG ANALYSIS FINISHED --------"
67
- # Let's switch it back
68
- set -e
69
62
}
70
63
71
64
# This adds backwards compatibility if only single version needs to be testing
@@ -99,7 +92,10 @@ for dir in ${VERSIONS}; do
99
92
cat " ${tmp_file} "
100
93
if [[ " $ret_code " != " 0" ]]; then
101
94
if [[ " ${OS} " == " rhel8" ]] || [[ " ${OS} " == " rhel9" ]] || [[ " ${OS} " == " rhel10" ]]; then
95
+ set +e
102
96
analyze_logs_by_logdetective " $tmp_file "
97
+ # Let's switch it back
98
+ set -e
103
99
fi
104
100
fi
105
101
failed_version " $ret_code " " $dir "
@@ -132,7 +128,10 @@ for dir in ${VERSIONS}; do
132
128
cat " ${tmp_file} "
133
129
if [[ " $ret_code " != " 0" ]]; then
134
130
if [[ " ${OS} " == " rhel8" ]] || [[ " ${OS} " == " rhel9" ]] || [[ " ${OS} " == " rhel10" ]]; then
131
+ set +e
135
132
analyze_logs_by_logdetective " $tmp_file "
133
+ # Let's switch it back
134
+ set -e
136
135
fi
137
136
fi
138
137
failed_version " $ret_code " " $dir "
0 commit comments