From patchwork Tue Aug 26 20:28:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4783861 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0E613C0338 for ; Tue, 26 Aug 2014 20:29:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3BE82015E for ; Tue, 26 Aug 2014 20:29:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D47BE2017E for ; Tue, 26 Aug 2014 20:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753595AbaHZU3k (ORCPT ); Tue, 26 Aug 2014 16:29:40 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:40531 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbaHZU3j (ORCPT ); Tue, 26 Aug 2014 16:29:39 -0400 Received: by mail-la0-f46.google.com with SMTP id b8so15872782lan.33 for ; Tue, 26 Aug 2014 13:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rmiy7kWP6MeRc+U6ZMChZS2QTHwDH8Dh5ccLnqACY5g=; b=FYvNpE/tEw1amllCJQlsqLhPYE43KUFNzsfmyJ0tFQmn5BmeKYVSYdEo3on3GltTU7 xF+x1v/jN5Bppxic22Zi83Tt+6rjrJQ9x1y/SUSVMxKE3Wsi29PUkvb1klc3ixm3nSbq kzWql7ysmpNUTHm/e7J7/DeMb2aqtbaeNQ+WiFssTk9xTvqql7VApqCC5XIbqoGHu1Jl w+WmQoHpAeM3CXaZ0EFiOnmzWmH+P6Bktv8pwBk7wS4wKMcngX3sMOEqgg7kTSGK9uu3 ikC6g9SyaQKshKL1iIKEncsPgD8k+ih/HWoJnlBWtzoQVF+Ls04CDtbpGKU7N9QJpj1V B4Jw== X-Received: by 10.112.34.78 with SMTP id x14mr28588455lbi.38.1409084977141; Tue, 26 Aug 2014 13:29:37 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.63]) by mx.google.com with ESMTPSA id n11sm6837126lbl.13.2014.08.26.13.29.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 13:29:35 -0700 (PDT) From: Pavel Shilovsky To: fstests@vger.kernel.org Cc: linux-cifs@vger.kernel.org, samba-technical@samba.org, David Disseldorp , Steve French Subject: [PATCH v2 2/3] common: add cifs support Date: Wed, 27 Aug 2014 00:28:37 +0400 Message-Id: <1409084918-17764-3-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409084918-17764-1-git-send-email-pshilovsky@samba.org> References: <1409084918-17764-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Pass -cifs argument from the command line to enable cifs testing for $TEST_DEV. Reviewed-by: Steve French Signed-off-by: Pavel Shilovsky --- README | 5 +++-- check | 2 ++ common/config | 31 +++++++++++++++++++++++++++---- common/rc | 26 ++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/README b/README index b299c8f..95a81c6 100644 --- a/README +++ b/README @@ -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 or CIFS, 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)] diff --git a/check b/check index 77c6559..42a1ac2 100755 --- a/check +++ b/check @@ -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 ; diff --git a/common/config b/common/config index 10cc6fe..fc21b37 100644 --- a/common/config +++ b/common/config @@ -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 diff --git a/common/rc b/common/rc index d9c9995..8b427fc 100644 --- a/common/rc +++ b/common/rc @@ -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 ;;