Skip to contentSkip to conversation

Fix the failure case which will exit with 0

PATCH In review Yi Zhang 3 participants 3 messages Mar 5, 2019 – Mar 11, 2019 Block layer

lore
Share & tools
lore

Yi Zhang

author
#0 lore raw

PATCH 1/1 Fix the failure case which will exit with 0

The return value of a failing test was masked by the zoned test check. Make sure to return either the original or zoned run failed value.

Fixes e840e15 ("config: Introduce RUN_ZONED_TESTS variable and

CAN_BE_ZONED flag")

---
 check | 3 +++
 1 file changed, 3 insertions(+)
check +3 -0
index 819d8f3..c65270e 100755
@@ -431,11 +431,14 @@ _run_test() {
 
 		RESULTS_DIR="$OUTPUT/nodev"
 		_call_test test
+		local ret=$?
 		if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then
 			RESULTS_DIR="$OUTPUT/nodev_zoned"
 			RUN_FOR_ZONED=1
 			_call_test test
+			ret=$(( ret || $? ))
 		fi
+		return $ret
 	else
 		if [[ ${#TEST_DEVS[@]} -eq 0 ]] && \
 			declare -fF fallback_device >/dev/null; then
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Yi Zhang

The return value of a failing test was masked by the zoned test check. Make sure to return either the original or zoned run failed value.

Fixes e840e15 ("config: Introduce RUN_ZONED_TESTS variable and

CAN_BE_ZONED flag")

---
  check | 3 +++
  1 file changed, 3 insertions(+)
check +1 -0
index 819d8f3..c65270e 100755
@@ -431,11 +431,14 @@ _run_test() {
 
  		RESULTS_DIR="$OUTPUT/nodev"
  		_call_test test
+		local ret=$?

check _run_test() { · line 444

Quoted 10 lines
check +2 -0
  		if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then
  			RESULTS_DIR="$OUTPUT/nodev_zoned"
  			RUN_FOR_ZONED=1
  			_call_test test
+			ret=$(( ret || $? ))
  		fi
+		return $ret
  	else
  		if [[ ${#TEST_DEVS[@]} -eq 0 ]] && \
  			declare -fF fallback_device >/dev/null; then

Hi Yi Zhang, thank you for the fix for commit e840e15. The change is required, and looks good to me.

Signature · 2 lines
Best Regards,
Shin'ichiro Kawasaki
#2 lore raw
In reply to Yi Zhang
Quoted 6 lines · Yi Zhang

The return value of a failing test was masked by the zoned test check. Make sure to return either the original or zoned run failed value.

Fixes e840e15 ("config: Introduce RUN_ZONED_TESTS variable and

CAN_BE_ZONED flag")

Thanks for the fix, applied.