test $sector_size_ = 512 || skip_ 'FS test with sector size != 512'
}
+# Having an unsearchable directory in PATH causes execve to fail with EACCES
+# when applied to an unresolvable program name, contrary to the desired ENOENT.
+# Avoid the problem by rewriting PATH to exclude unsearchable directories.
+# Also, if PATH lacks /sbin and/or /usr/sbin, append it/them.
+sanitize_path_()
+{
+ # FIXME: remove double quotes around $IFS when all tests use init.sh.
+ # They constitute a work-around for a bug in FreeBSD 8.1's /bin/sh.
+ local saved_IFS="$IFS"
+ IFS=:
+ set -- $PATH
+ IFS=$saved_IFS
+
+ local d d1
+ local colon=
+ local new_path=
+ for d in "$@"; do
+ test -z "$d" && d1=. || d1=$d
+ if ls -d "$d1/." > /dev/null 2>&1; then
+ new_path="$new_path$colon$d"
+ colon=':'
+ fi
+ done
+
+ for d in /sbin /usr/sbin ; do
+ case ":$new_path:" in
+ *:$d:*) ;;
+ *) new_path="$new_path:$d" ;;
+ esac
+ done
+
+ PATH=$new_path
+ export PATH
+}
+
require_udevadm_settle_()
{
udevadm --help > /dev/null \
esac
}
+sanitize_path_
+
. "$abs_top_srcdir/tests/t-lib-helpers.sh"
. "$abs_top_srcdir/tests/t-local.sh"
for i in $types; do
for j in $types; do
echo $i:$j
- case $i in mkswap) mkswap f >/dev/null 2>&1 || fail=1;;
+ case $i in mkswap) mkswap f || fail=1;;
*) parted -s f mklabel $i || fail=1;; esac
case $j in mkswap) continue;; esac
parted -s f mklabel $j || fail=1