mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-22 05:27:01 +01:00
FIX(test): catch return values when retval differs to avoid runtime error
This commit is contained in:
parent
6afed4eedb
commit
0c17da012f
@ -103,10 +103,10 @@ play_consistency_tests() {
|
|||||||
printf "\033[34m*** [%03d] %s::%s Root/Sudo Consistency Tests\033[0m\n" "$testno" "$test_file" "$usecase"
|
printf "\033[34m*** [%03d] %s::%s Root/Sudo Consistency Tests\033[0m\n" "$testno" "$test_file" "$usecase"
|
||||||
retfile_root=$outdir/${usecase_name_root}.retval
|
retfile_root=$outdir/${usecase_name_root}.retval
|
||||||
retfile_sudo=$outdir/${usecase_name_sudo}.retval
|
retfile_sudo=$outdir/${usecase_name_sudo}.retval
|
||||||
ret=$(eval cmp "$retfile_root" "$retfile_sudo")
|
cmp "$retfile_root" "$retfile_sudo" && ret=0 || ret=1
|
||||||
if [[ ! 0 -eq $ret ]] ; then
|
if [[ ! 0 -eq $ret ]] ; then
|
||||||
fail "$name" return values differ
|
fail "$name" return values differ
|
||||||
diff "$retfile_root" "$retfile_sudo"
|
diff "$retfile_root" "$retfile_sudo" || true
|
||||||
consist_test=1
|
consist_test=1
|
||||||
else
|
else
|
||||||
ok "$name return values are equal"
|
ok "$name return values are equal"
|
||||||
|
Loading…
Reference in New Issue
Block a user