From beb211475b0a2ff64faaf8d5c19afbd2cfee21cc Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Mon, 8 Sep 2014 22:26:52 +1000 Subject: [PATCH] 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 Reviewed-by: Steve French Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- common/rc | 23 +++++++++++++++++++++++ tests/generic/005 | 8 ++------ tests/generic/023 | 1 + tests/generic/024 | 1 + tests/generic/025 | 1 + tests/generic/131 | 1 + 6 files changed, 29 insertions(+), 6 deletions(-) diff --git a/common/rc b/common/rc index 4f32469f..21581218 100644 --- a/common/rc +++ b/common/rc @@ -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 diff --git a/tests/generic/005 b/tests/generic/005 index d78e43fb..70f60738 100755 --- a/tests/generic/005 +++ b/tests/generic/005 @@ -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 diff --git a/tests/generic/023 b/tests/generic/023 index 114485c2..1062b5b6 100755 --- a/tests/generic/023 +++ b/tests/generic/023 @@ -45,6 +45,7 @@ _supported_os Linux _require_test _requires_renameat2 +_require_test_symlinks # real QA test starts here diff --git a/tests/generic/024 b/tests/generic/024 index 8945191c..bcc246e8 100755 --- a/tests/generic/024 +++ b/tests/generic/024 @@ -45,6 +45,7 @@ _supported_os Linux _require_test _requires_renameat2 +_require_test_symlinks rename_dir=$TEST_DIR/$$ mkdir $rename_dir diff --git a/tests/generic/025 b/tests/generic/025 index 6b6c8abb..da295a30 100755 --- a/tests/generic/025 +++ b/tests/generic/025 @@ -45,6 +45,7 @@ _supported_os Linux _require_test _requires_renameat2 +_require_test_symlinks rename_dir=$TEST_DIR/$$ mkdir $rename_dir diff --git a/tests/generic/131 b/tests/generic/131 index b4e3ff06..3bcb0d16 100755 --- a/tests/generic/131 +++ b/tests/generic/131 @@ -45,6 +45,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_test +_require_test_fcntl_advisory_locks TESTFILE=$TEST_DIR/lock_file -- 2.39.5