mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs/191: skip tests on older xfsprogs
If we don't have temp file used to test on xfsprogs 3.2.2,
_require_xfs_mkfs_validation will fail because mkfs.xfs can't create
this file. We need to skip tests before xfsprogs 4.7.0, so fix it.
This feature was introduced in xfsprogs 4.2.0 by commit 20cec860e16b
("mkfs.xfs: always use underlying fs sector size when mkfs'ing a
file")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
@@ -3894,21 +3894,25 @@ _get_fs_sysfs_attr()
|
|||||||
#
|
#
|
||||||
# At first, make a common function that runs the tests and returns
|
# At first, make a common function that runs the tests and returns
|
||||||
# number of failed cases.
|
# number of failed cases.
|
||||||
_mkfs_validation_check()
|
_xfs_mkfs_validation_check()
|
||||||
{
|
{
|
||||||
local cmd="$MKFS_XFS_PROG -f -N -d file,name=/tmp/foo,size=$((1024 * 1024 * 1024))"
|
local tmpfile=`mktemp`
|
||||||
|
local cmd="$MKFS_XFS_PROG -f -N -d file,name=$tmpfile,size=1g"
|
||||||
|
|
||||||
$cmd -s size=2s >/dev/null 2>&1
|
$cmd -s size=2s >/dev/null 2>&1
|
||||||
local sum=$?
|
local sum=$?
|
||||||
$cmd -l version=2,su=$((256 * 1024 + 4096)) >/dev/null 2>&1
|
|
||||||
|
$cmd -l version=2,su=260k >/dev/null 2>&1
|
||||||
sum=`expr $sum + $?`
|
sum=`expr $sum + $?`
|
||||||
rm -f /tmp/foo
|
|
||||||
|
rm -f $tmpfile
|
||||||
return $sum
|
return $sum
|
||||||
}
|
}
|
||||||
|
|
||||||
# Skip the test if all calls passed - mkfs accepts invalid input
|
# Skip the test if all calls passed - mkfs accepts invalid input
|
||||||
_require_xfs_mkfs_validation()
|
_require_xfs_mkfs_validation()
|
||||||
{
|
{
|
||||||
_mkfs_validation_check
|
_xfs_mkfs_validation_check
|
||||||
if [ "$?" -eq 0 ]; then
|
if [ "$?" -eq 0 ]; then
|
||||||
_notrun "Requires newer mkfs with stricter input checks: the oldest supported version of xfsprogs is 4.7."
|
_notrun "Requires newer mkfs with stricter input checks: the oldest supported version of xfsprogs is 4.7."
|
||||||
fi
|
fi
|
||||||
@@ -3917,7 +3921,7 @@ _require_xfs_mkfs_validation()
|
|||||||
# The oposite of _require_xfs_mkfs_validation.
|
# The oposite of _require_xfs_mkfs_validation.
|
||||||
_require_xfs_mkfs_without_validation()
|
_require_xfs_mkfs_without_validation()
|
||||||
{
|
{
|
||||||
_mkfs_validation_check
|
_xfs_mkfs_validation_check
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
_notrun "Requires older mkfs without strict input checks: the last supported version of xfsprogs is 4.5."
|
_notrun "Requires older mkfs without strict input checks: the last supported version of xfsprogs is 4.5."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user