On 3/15/18 9:18 AM, Stefano Brivio wrote:
> 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}"
> + fi
> +done
>
> -exit 0
> +exit ${exitcode}
>