According to Sergey Poznyakoff on 3/3/2010 8:12 AM: > Hi Denis, > >> The testsuite is OK except for the item #28 (extracting selected >> members from pax), where >> a sparse file is used. Since Darwin HFS is not capable of sparse >> files, this test, unless >> it is modified, should deserve skipping, in the same way as the other >> sparse*.at's. > > I see. Definitely, it should be skipped in such case. I'll try to > figure out a reliable way of detecting whether the FS supports sparse > files or not.
Coreutils also has tests that skip on FS that lack sparse support. You
also have to make sure a file is large enough to show up as sparse (NTFS
requires 128k). coreutils/tests/cp/sparse uses this:
# Does the current (working-dir) file system support sparse files?
require_sparse_support_()
{
test $# = 0 || framework_failure
# Test whether we can create a sparse file.
# For example, on Darwin6.5 with a file system of type hfs, it's not
possible.
# NTFS requires 128K before a hole appears in a sparse file.
t=sparse.$$
dd bs=1 seek=128K of=$t < /dev/null 2> /dev/null
set x `du -sk $t`
kb_size=$2
rm -f $t
if test $kb_size -ge 128; then
skip_test_ 'this file system does not support sparse files'
fi
}
require_sparse_support_
# Create a sparse file.
# It has to be at least 128K in order to be sparse on some systems.
# Make its size one larger than 128K, in order to tickle the
# bug in coreutils-6.0.
size=`expr 128 \* 1024 + 1`
dd bs=1 seek=$size of=sparse < /dev/null 2> /dev/null || framework_failure
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
