test.sh: removed code duplicity.