CIFS support for XFS test suite
Subsystems (3)
v3 cover CIFS support for XFS test suite
These are patches that adds CIFS support to XFS tests.
The first patch changes generic/013 test to use mount options provided for $TEST_DEV for remount. The second patch adds "-cifs" command line argument and CIFS specific variables. The third patch disables tests that need POSIX behavior from filesystem for unix cifs mounts.
With these patches applied, most of generic/shared $TEST_DEV tests pass for the recent kernel cifs module.
Changes since v2:
1) patch #3 uses separate _require_test_{feature} functions rather than generic _require_test_posix_ext
2) patch #2 adds UDF notes to README
Pavel Shilovsky (3):
generic/013: encapsulate remount during cleanup
common: add cifs support
cifs: skip tests that need POSIX support for nounix mounts
README | 5 +++-- check | 2 ++ common/config | 31 +++++++++++++++++++++++++++---- common/rc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/005 | 8 ++------ tests/generic/013 | 2 +- tests/generic/023 | 1 + tests/generic/024 | 1 + tests/generic/025 | 1 + tests/generic/131 | 1 + 10 files changed, 94 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): 1409341340-27031-1-git-send-email-pshilovsky-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org
PATCH v3 1/3 generic/013: encapsulate remount during cleanup
The existing code calls remount for $TEST_DEV with constantly defined mount options. This can fail if a user specifies different mount options. Fix this by using new _test_remount() call that remounts $TEST_DEV.
--- common/rc | 6 ++++++ tests/generic/013 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
common/rc +6 -0
@@ -218,6 +218,12 @@ _test_mount() _mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR } +_test_remount() +{ + $UMOUNT_PROG $TEST_DEV + _test_mount +} + _scratch_mkfs_options() { _scratch_options mkfs
tests/generic/013 +1 -1
@@ -35,7 +35,7 @@ _cleanup() { cd / # we might get here with a RO FS - mount -o remount,rw $TEST_DEV >/dev/null 2>&1 + _test_remount # now remove fsstress directory. # N.B. rm(1) on IRIX can find problems when building up a long pathname # such that what it has is greater the 1024 chars and will
Signature · 1 line
1.9.1
PATCH v3 2/3 common: add cifs support
In reply to a message not in the archivePass -cifs argument from the command line to enable cifs testing for $TEST_DEV. Also mention CIFS and missed UDF in README.
--- README | 5 +++-- check | 2 ++ common/config | 31 +++++++++++++++++++++++++++---- common/rc | 26 ++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-)
README +3 -2
@@ -91,14 +91,15 @@ Running tests: - By default the tests suite will run xfs tests: - ./check '*/001' '*/002' '*/003' - ./check '*/06?' - - You can explicitly specify NFS, otherwise the filesystem type will be - autodetected from $TEST_DEV: + - You can explicitly specify NFS/CIFS/UDF, otherwise the filesystem type will + be autodetected from $TEST_DEV: ./check -nfs [test(s)] - Groups of tests maybe ran by: ./check -g [group(s)] See the 'group' file for details on groups - for udf tests: ./check -udf [test(s)] Running all the udf tests: ./check -udf -g udf - for running nfs tests: ./check -nfs [test(s)] + - for running cifs/smb3 tests: ./check -cifs [test(s)] - To randomize test order: ./check -r [test(s)]
check +2 -0
@@ -68,6 +68,7 @@ usage() check options -nfs test NFS + -cifs test CIFS -tmpfs test TMPFS -l line mode diff -udiff show unified diff (default)
@@ -205,6 +206,7 @@ while [ $# -gt 0 ]; do -\? | -h | --help) usage ;; -nfs) FSTYP=nfs ;; + -cifs) FSTYP=cifs ;; -tmpfs) FSTYP=tmpfs ;; -g) group=$2 ; shift ;
common/config +27 -4
@@ -206,6 +206,7 @@ case "$HOSTOS" in export MKFS_UDF_PROG="`set_prog_path mkfs_udf`" export XFS_FSR_PROG="`set_prog_path /usr/etc/fsr_xfs`" export MKFS_NFS_PROG="false" + export MKFS_CIFS_PROG="false" ;; Linux) export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
@@ -215,6 +216,7 @@ case "$HOSTOS" in export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`" export XFS_FSR_PROG="`set_prog_path xfs_fsr`" export MKFS_NFS_PROG="false" + export MKFS_CIFS_PROG="false" ;; esac
@@ -238,6 +240,9 @@ _mount_opts() nfs) export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS ;; + cifs) + export MOUNT_OPTIONS=$CIFS_MOUNT_OPTIONS + ;; ext2|ext3|ext4|ext4dev) # acls & xattrs aren't turned on by default on ext$FOO export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
@@ -259,6 +264,17 @@ _mount_opts() esac } +_test_mount_opts() +{ + case $FSTYP in + cifs) + export TEST_FS_MOUNT_OPTS=$CIFS_MOUNT_OPTIONS + ;; + *) + ;; + esac +} + _mkfs_opts() { case $FSTYP in
@@ -273,6 +289,9 @@ _mkfs_opts() nfs) export MKFS_OPTIONS=$NFS_MKFS_OPTIONS ;; + cifs) + export MKFS_OPTIONS=$CIFS_MKFS_OPTIONS + ;; reiserfs) export MKFS_OPTIONS="$REISERFS_MKFS_OPTIONS -q" ;;
@@ -366,6 +385,7 @@ get_next_config() { local OLD_FSTYP=$FSTYP local OLD_MOUNT_OPTIONS=$MOUNT_OPTIONS + local OLD_TEST_FS_MOUNT_OPTS=$TEST_FS_MOUNT_OPTS local OLD_MKFS_OPTIONS=$MKFS_OPTIONS local OLD_FSCK_OPTIONS=$FSCK_OPTIONS
@@ -382,10 +402,12 @@ get_next_config() { if [ ! -z "$OLD_FSTYP" ] && [ $OLD_FSTYP != $FSTYP ]; then [ -z "$MOUNT_OPTIONS" ] && _mount_opts + [ -z "$TEST_FS_MOUNT_OPTS" ] && _test_mount_opts [ -z "$MKFS_OPTIONS" ] && _mkfs_opts [ -z "$FSCK_OPTIONS" ] && _fsck_opts else [ -z "$MOUNT_OPTIONS" ] && export MOUNT_OPTIONS=$OLD_MOUNT_OPTIONS + [ -z "$TEST_FS_MOUNT_OPTS" ] && export TEST_FS_MOUNT_OPTS=$OLD_TEST_FS_MOUNT_OPTS [ -z "$MKFS_OPTIONS" ] && export MKFS_OPTIONS=$OLD_MKFS_OPTIONS [ -z "$FSCK_OPTIONS" ] && export FSCK_OPTIONS=$OLD_FSCK_OPTIONS fi
@@ -408,9 +430,9 @@ get_next_config() { exit 1 fi - echo $TEST_DEV | grep -q ":" > /dev/null 2>&1 + echo $TEST_DEV | grep -qE ":|//" > /dev/null 2>&1 if [ ! -b "$TEST_DEV" -a "$?" != "0" ]; then - echo "common/config: Error: \$TEST_DEV ($TEST_DEV) is not a block device or a NFS filesystem" + echo "common/config: Error: \$TEST_DEV ($TEST_DEV) is not a block device or a network filesystem" exit 1 fi
@@ -431,9 +453,9 @@ get_next_config() { export SCRATCH_DEV_NOT_SET=true fi - echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1 + echo $SCRATCH_DEV | grep -qE ":|//" > /dev/null 2>&1 if [ ! -z "$SCRATCH_DEV" -a ! -b "$SCRATCH_DEV" -a "$?" != "0" ]; then - echo "common/config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device or a NFS filesystem" + echo "common/config: Error: \$SCRATCH_DEV ($SCRATCH_DEV) is not a block device or a network filesystem" exit 1 fi
@@ -457,6 +479,7 @@ if [ -z "$CONFIG_INCLUDED" ]; then FSTYP=${FSTYP:=xfs} export FSTYP [ -z "$MOUNT_OPTIONS" ] && _mount_opts + [ -z "$TEST_FS_MOUNT_OPTS" ] && _test_mount_opts [ -z "$MKFS_OPTIONS" ] && _mkfs_opts [ -z "$FSCK_OPTIONS" ] && _fsck_opts fi
common/rc +26 -0
@@ -107,6 +107,8 @@ case "$FSTYP" in ;; nfs) ;; + cifs) + ;; esac # make sure we have a standard umask
@@ -503,6 +505,9 @@ _test_mkfs() nfs*) # do nothing for nfs ;; + cifs) + # do nothing for cifs + ;; udf) $MKFS_UDF_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null ;;
@@ -524,6 +529,9 @@ _scratch_mkfs() nfs*) # do nothing for nfs ;; + cifs) + # do nothing for cifs + ;; udf) $MKFS_UDF_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null ;;
@@ -973,6 +981,9 @@ _require_scratch() nfs*) _notrun "requires a scratch device" ;; + cifs) + _notrun "requires a scratch device" + ;; tmpfs) if [ -z "$SCRATCH_DEV" -o ! -d "$SCRATCH_MNT" ]; then
@@ -1022,6 +1033,15 @@ _require_test() nfs*) _notrun "requires a test device" ;; + cifs) + echo $TEST_DEV | grep -q "//" > /dev/null 2>&1 + if [ -z "$TEST_DEV" -o "$?" != "0" ]; then + _notrun "this test requires a valid \$TEST_DEV" + fi + if [ ! -d "$TEST_DIR" ]; then + _notrun "this test requires a valid \$TEST_DIR" + fi + ;; tmpfs) if [ -z "$TEST_DEV" -o ! -d "$TEST_DIR" ]; then
@@ -1812,6 +1832,9 @@ _check_test_fs() nfs) # no way to check consistency for nfs ;; + cifs) + # no way to check consistency for cifs + ;; udf) # do nothing for now ;;
@@ -1850,6 +1873,9 @@ _check_scratch_fs() nfs*) # Don't know how to check an NFS filesystem, yet. ;; + cifs) + # Don't know how to check a CIFS filesystem, yet. + ;; btrfs) _check_btrfs_filesystem $device ;;
Signature · 1 line
1.9.1
PATCH v3 3/3 cifs: skip tests that need POSIX support for nounix mounts
In reply to Pavel ShilovskyCIFS/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.
--- 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(-)
common/rc +23 -0
@@ -2374,6 +2374,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
tests/generic/005 +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
tests/generic/023 +1 -0
@@ -45,6 +45,7 @@ _supported_os Linux _require_test _requires_renameat2 +_require_test_symlinks # real QA test starts here
tests/generic/024 +1 -0
@@ -45,6 +45,7 @@ _supported_os Linux _require_test _requires_renameat2 +_require_test_symlinks rename_dir=$TEST_DIR/$$ mkdir $rename_dir
tests/generic/025 +1 -0
@@ -45,6 +45,7 @@ _supported_os Linux _require_test _requires_renameat2 +_require_test_symlinks rename_dir=$TEST_DIR/$$ mkdir $rename_dir
tests/generic/131 +1 -0
@@ -45,6 +45,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_test +_require_test_fcntl_advisory_locks TESTFILE=$TEST_DIR/lock_file
Signature · 1 line
1.9.1
2014-08-29 23:42 GMT+04:00 Pavel Shilovsky <[email protected]>:
Quoted 27 lines
These are patches that adds CIFS support to XFS tests.
The first patch changes generic/013 test to use mount options provided for $TEST_DEV for remount. The second patch adds "-cifs" command line argument and CIFS specific variables. The third patch disables tests that need POSIX behavior from filesystem for unix cifs mounts.
With these patches applied, most of generic/shared $TEST_DEV tests pass for the recent kernel cifs module.
Changes since v2:
1) patch #3 uses separate _require_test_{feature} functions rather than generic_require_test_posix_ext
2) patch #2 adds UDF notes to READMEPavel Shilovsky (3):
generic/013: encapsulate remount during cleanup
common: add cifs support
cifs: skip tests that need POSIX support for nounix mountsREADME | 5 +++-- check | 2 ++ common/config | 31 +++++++++++++++++++++++++++---- common/rc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/005 | 8 ++------ tests/generic/013 | 2 +- tests/generic/023 | 1 + tests/generic/024 | 1 + tests/generic/025 | 1 + tests/generic/131 | 1 + 10 files changed, 94 insertions(+), 13 deletions(-)
Quoted 3 lines
--
1.9.1
Any comments on the series?
Signature · 2 lines
Best regards, Pavel Shilovsky.
A message that is not in the archive (sent off-list or not yet received): CAKywueRns+hehrZ3dQ8a8XnaHbd6tNh1BnZAwsTxNTV_w6V6SQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 28 lines · Pavel Shilovsky
2014-08-29 23:42 GMT+04:00 Pavel Shilovsky <[email protected]>:
Quoted 27 lines
These are patches that adds CIFS support to XFS tests.
The first patch changes generic/013 test to use mount options provided for $TEST_DEV for remount. The second patch adds "-cifs" command line argument and CIFS specific variables. The third patch disables tests that need POSIX behavior from filesystem for unix cifs mounts.
With these patches applied, most of generic/shared $TEST_DEV tests pass for the recent kernel cifs module.
Changes since v2:
1) patch #3 uses separate _require_test_{feature} functions rather than generic_require_test_posix_ext
2) patch #2 adds UDF notes to READMEPavel Shilovsky (3):
generic/013: encapsulate remount during cleanup
common: add cifs support
cifs: skip tests that need POSIX support for nounix mountsREADME | 5 +++-- check | 2 ++ common/config | 31 +++++++++++++++++++++++++++---- common/rc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/005 | 8 ++------ tests/generic/013 | 2 +- tests/generic/023 | 1 + tests/generic/024 | 1 + tests/generic/025 | 1 + tests/generic/131 | 1 + 10 files changed, 94 insertions(+), 13 deletions(-)
Quoted 5 lines
Quoted 3 lines
--
1.9.1Any comments on the series?
Patience. It will be friday before I get to it....
Cheers,
Dave.
Signature · 2 lines
Dave Chinner [email protected]