* tests/init.cfg (require_partitionable_loop_device_): New function.
* tests/t8001-loop-blkpg.sh: Use it.
* tests/t8000-loop.sh: Use it.
$df | grep "^$dev_[0-9]" && fail_ "a partition of $dev_ is already mounted"
}
+# At least Fedora 16 (kernel 3.1.6-1.fc16.x86_64) fails this test.
+require_partitionable_loop_device_()
+{
+ case $(cat /sys/devices/virtual/block/$(basename $1)/ext_range) in
+ 0|1) skip_ your system does not support loop partitioning;;
+ esac
+}
+
. "$abs_top_srcdir/tests/t-lib-helpers.sh"
. "$abs_top_srcdir/tests/t-local.sh"
f1=$(pwd)/1; d1=$(loop_setup_ "$f1") \
|| skip_ "is this partition mounted with 'nodev'?"
+require_partitionable_loop_device_ $d1
+
# Expect this to succeed.
parted -s $d1 mklabel msdos > err 2>&1 || fail=1
compare /dev/null err || fail=1 # expect no output
loopdev=`losetup -f --show backing_file`
test -z "$loopdev" && fail=1
+require_partitionable_loop_device_ $loopdev
+
# Expect this to succeed
parted -s "$loopdev" mklabel msdos > err 2>&1 || fail=1
compare /dev/null err || fail=1 # expect no output