Thread (14 messages) 14 messages, 2 authors, 2018-03-16

Re: [PATCH net-next 3/9] selftests: pmtu: Introduce support for multiple tests

flat view

From: David Ahern <hidden>
Date: 2018-03-16 18:06:10

On 3/15/18 9:18 AM, Stefano Brivio wrote:
quoted hunk ↗ jump to hunk
 trap cleanup EXIT
 
-test_pmtu_vti6_exception
+exitcode=0
+for name in ${tests}; do
+	echo "${name}: START"
+	eval test_${name}
+	ret=$?
+	cleanup
+
+	if [ $ret -eq 0 ]; then echo "${name}: FAIL"; exitcode=1
ret = 0 == failure is counterintuitive for Linux.
+	elif [ $ret -eq 1 ]; then echo "${name}: PASS"
+	elif [ $ret -eq 2 ]; then echo "${name}: SKIP"
I use printf in other scripts so that the pass/fail verdict lineup. e.g.,
printf "        %-60s  [PASS]\n" "${name}"

quoted hunk ↗ jump to hunk
+	fi
+done
 
-exit 0
+exit ${exitcode}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help