test: correctly adjust rc for skip/fail
Vishal Verma
maintainerPATCH 1/1 test: correctly adjust rc for skip/fail
The exit code for daxdev-errors and multi-dax wasn't being set correctly to distinguish a skipped test from a failure. Fix it by setting rc to 77 prior to probing for nfit_test, and to 1 after it.
Signed-off-by Vishal Verma <[email protected]>
--- test/daxdev-errors.sh | 3 ++- test/multi-dax.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
test/daxdev-errors.sh +2 -1
@@ -37,7 +37,6 @@ check_min_kver "4.12" || { echo "kernel $KVER lacks dax dev error handling"; exi set -e trap 'err $LINENO' ERR -rc=1 # setup (reset nfit_test dimms) modprobe nfit_test
@@ -45,6 +44,8 @@ $NDCTL disable-region $BUS all $NDCTL zero-labels $BUS all $NDCTL enable-region $BUS all +rc=1 + query=". | sort_by(.available_size) | reverse | .[0].dev" region=$($NDCTL list $BUS -t pmem -Ri | jq -r "$query")
test/multi-dax.sh +2 -1
@@ -20,7 +20,6 @@ json2var="s/[{}\",]//g; s/:/=/g" rc=77 err() { - rc=1 echo "test/multi-dax: failed at line $1" exit $rc }
@@ -45,6 +44,8 @@ $NDCTL disable-region $BUS all $NDCTL zero-labels $BUS all $NDCTL enable-region $BUS all +rc=1 + query=". | sort_by(.available_size) | reverse | .[0].dev" region=$($NDCTL list $BUS -t pmem -Ri | jq -r "$query")
Signature · 6 lines
2.9.5 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm