mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
cifs: skip tests that need POSIX support for nounix mounts
CIFS/SMB protocol without POSIX extensions doesn't support operations with symbolic links and advisory byte-range locks from the same process. Add checks these features and use them in generic tests that require such operations. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Reviewed-by: Steve French <smfrench@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
0e9141e49d
commit
beb211475b
@@ -2428,6 +2428,29 @@ _require_btrfs_fs_feature()
|
||||
_notrun "Feature $feat not supported by the available btrfs version"
|
||||
}
|
||||
|
||||
_require_test_symlinks()
|
||||
{
|
||||
# IRIX UDF does not support symlinks
|
||||
[ "$HOSTOS" = "IRIX" -a "$FSTYP" = 'udf' ] && \
|
||||
_notrun "Require symlinks support"
|
||||
target=`mktemp -p $TEST_DIR`
|
||||
link=`mktemp -p $TEST_DIR -u`
|
||||
ln -s `basename $target` $link
|
||||
if [ "$?" -ne 0 ]; then
|
||||
rm -f $target
|
||||
_notrun "Require symlinks support"
|
||||
fi
|
||||
rm -f $target $link
|
||||
}
|
||||
|
||||
_require_test_fcntl_advisory_locks()
|
||||
{
|
||||
[ "$FSTYP" != "cifs" ] && return 0
|
||||
cat /proc/mounts | grep $TEST_DEV | grep cifs | grep -q "nobrl" && return 0
|
||||
cat /proc/mounts | grep $TEST_DEV | grep cifs | grep -qE "nounix|forcemand" && \
|
||||
_notrun "Require fcntl advisory locks support"
|
||||
}
|
||||
|
||||
_get_total_inode()
|
||||
{
|
||||
if [ -z "$1" ]; then
|
||||
|
||||
+2
-6
@@ -67,13 +67,9 @@ _touch()
|
||||
# real QA test starts here
|
||||
_supported_fs generic
|
||||
_require_test
|
||||
_require_test_symlinks
|
||||
|
||||
# IRIX UDF does not support symlinks
|
||||
if [ $FSTYP == 'udf' ]; then
|
||||
_supported_os Linux
|
||||
else
|
||||
_supported_os Linux IRIX
|
||||
fi
|
||||
_supported_os Linux IRIX
|
||||
|
||||
cd $TEST_DIR
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ _supported_os Linux
|
||||
|
||||
_require_test
|
||||
_requires_renameat2
|
||||
_require_test_symlinks
|
||||
|
||||
# real QA test starts here
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ _supported_os Linux
|
||||
|
||||
_require_test
|
||||
_requires_renameat2
|
||||
_require_test_symlinks
|
||||
|
||||
rename_dir=$TEST_DIR/$$
|
||||
mkdir $rename_dir
|
||||
|
||||
@@ -45,6 +45,7 @@ _supported_os Linux
|
||||
|
||||
_require_test
|
||||
_requires_renameat2
|
||||
_require_test_symlinks
|
||||
|
||||
rename_dir=$TEST_DIR/$$
|
||||
mkdir $rename_dir
|
||||
|
||||
@@ -45,6 +45,7 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_test
|
||||
_require_test_fcntl_advisory_locks
|
||||
|
||||
TESTFILE=$TEST_DIR/lock_file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user