tests: Fix shellcheck issue SC2181 by if cmd; ...

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
70 files changed