tests: add function ts_check_prog

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: consolidate some checks for commands

Use ts_check_prog for mdadm, readelf, file, ntpdate, bc (mdadm was
not always checked so far).

There are some positive side-effects. We are using always $PATH now
instead of randomly hardcoded /usr/bin, /sbin, etc. If we ever want
to change this again, we should do this generically in ts_init.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: check for mkfs.ext{2,3,4}

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests, add function ts_mount

We want to generalize mounts similar to how we do it already in
minix/mkfs. Currently most of our other checks just fail if
"fs not supported".

Note that the new function checks a bit stronger than before in
minix/mkfs. It respects mount's return value and stderr goes
to $TS_OUTPUT too.

It's a bit ugly that we write to $TS_OUTPUT from inside of the
function. But if the caller would do it then we couldn't
ts_skip and the whole function would be pointless.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: ts_mount validates error message

Skip only if mount reports a non-empty fs which is not available
in /proc/filesystems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: ts_mount knows which fs is expected

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: use ts_mount for cramfs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Merge branch 'tests-check-prog' of https://github.com/rudimeier/util-linux

* 'tests-check-prog' of https://github.com/rudimeier/util-linux:
  tests: check for mkfs.ext{2,3,4}
  tests: consolidate some checks for commands
  tests: add function ts_check_prog
Merge branch 'tests-mount' of https://github.com/rudimeier/util-linux

* 'tests-mount' of https://github.com/rudimeier/util-linux:
  tests: use ts_mount for cramfs
  tests: ts_mount knows which fs is expected
  tests: ts_mount validates error message
  tests, add function ts_mount