From patchwork Mon Aug 5 16:53:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 2838845 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB3D19F485 for ; Mon, 5 Aug 2013 16:53:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA747202B7 for ; Mon, 5 Aug 2013 16:53:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8571120240 for ; Mon, 5 Aug 2013 16:53:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228Ab3HEQxT (ORCPT ); Mon, 5 Aug 2013 12:53:19 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:36548 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753147Ab3HEQxS (ORCPT ); Mon, 5 Aug 2013 12:53:18 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq2so3594613pbb.19 for ; Mon, 05 Aug 2013 09:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qVz8qJbl4G4tHrFSd0VyLOBrsFKh1a8TmFnfs76M0pY=; b=yo15nZn7mDSgj+g7ejJv5FbHebMpydScbHwYtBdvM3px0ovZkEGhT3hy5jzoZmN/X1 FZEKfiSSqtKJngF7ZuGA/Xn3OzewLdHdf6bVNF8FV6Kp2HdkgUfsfYpaNhVjhJ2rMZqQ 42AgggjdQ+KCIDCM5DEaHKXdfyootAnoXWRxrytWbYE2tD4zxHa6Bs8UxrbcCBXaGbJz /4abR3kId3l2CP7sQ7UXNhmJTG6keJiuGhjY3zKqP2n1H9Q9KB3+o4eFHdgTN43j1IVh OALLG0bl3ERnxUVSwOwa0iQlWYX3gg4Lwt132ASM1FJ843s6+VSje6u/zfFReD9wKGrj JQGQ== MIME-Version: 1.0 X-Received: by 10.69.0.168 with SMTP id az8mr23612737pbd.51.1375721597648; Mon, 05 Aug 2013 09:53:17 -0700 (PDT) Received: by 10.68.122.228 with HTTP; Mon, 5 Aug 2013 09:53:17 -0700 (PDT) In-Reply-To: <20130805165918.2e3ac36e@f163.suse.de> References: <20130805165918.2e3ac36e@f163.suse.de> Date: Mon, 5 Aug 2013 11:53:17 -0500 Message-ID: Subject: Re: xfstests integration From: Steve French To: David Disseldorp Cc: linux-cifs 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI,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 I couldn't find much - but I did see this small patch which I had put together quickly so they could run against cifs On Mon, Aug 5, 2013 at 9:59 AM, David Disseldorp wrote: > Hi Steve, > > At SambaXP this year you mentioned that you had done some preliminary > work towards using the xfstests suite alongside cifs.ko. Do you happen > to still have the git repo lying around somewhere? > > Cheers, David diff --git a/common b/common index 0723224..b2334f8 100644 --- a/common +++ b/common @@ -126,6 +126,7 @@ check options -xfs test XFS (default) -udf test UDF -nfs test NFS + -cifs test CIFS -l line mode diff -xdiff graphical mode diff -udiff show unified diff (default) @@ -158,6 +159,11 @@ testlist options xpand=false ;; + -cifs) # -cifs ... set FSTYP to cifs + FSTYP=cifs + xpand=false + ;; + -g) # -g group ... pick from group file group=true xpand=false @@ -311,4 +317,6 @@ case "$FSTYP" in ;; nfs) ;; + cifs) + ;; esac diff --git a/common.config b/common.config index 7bed1c5..1e37840 100644 --- a/common.config +++ b/common.config @@ -188,6 +188,7 @@ case "$HOSTOS" in export BTRFS_UTIL_PROG="`set_prog_path btrfs`" export XFS_FSR_PROG="`set_prog_path xfs_fsr`" export MKFS_NFS_PROG="false" + export MKFS_CIFS_PROG="false" ;; esac @@ -221,7 +222,7 @@ fi echo $TEST_DEV | grep -q ":" > /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 an NFS or CIFS filesystem" exit 1 fi @@ -243,7 +244,7 @@ fi echo $SCRATCH_DEV | grep -q ":" > /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 an NFS or CIFS filesystem" exit 1 fi diff --git a/common.rc b/common.rc index 602513a..7ae2f7a 100644 --- a/common.rc +++ b/common.rc @@ -85,6 +85,10 @@ _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" @@ -116,6 +120,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" ;; @@ -327,6 +334,9 @@ _scratch_mkfs() nfs*) # do nothing for nfs ;; + cifs) + # do nothing for cifs + ;; udf) $MKFS_UDF_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null ;; @@ -736,6 +746,13 @@ _require_scratch() _notrun "this test requires a valid \$SCRATCH_DEV" fi ;; + cifs) + echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1 + if [ -z "$SCRATCH_DEV" -o "$?" != "0" ] + then + _notrun "this test requires a valid \$SCRATCH_DEV" + fi + ;; *) if [ -z "$SCRATCH_DEV" -o "`_is_block_dev $SCRATCH_DEV`" = "" ] then @@ -1394,6 +1411,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 ;; @@ -1426,6 +1446,9 @@ _check_scratch_fs() nfs*) # Don't know how to check an NFS filesystem, yet. ;; + cifs) + # Don't know how to check an CIFS filesystem, yet. + ;; btrfs) _check_btrfs_filesystem $SCRATCH_DEV ;; @@ -1517,6 +1540,32 @@ _setup_nfs_scratchdir() testdir=$SCRATCH_MNT } +_setup_cifs_scratchdir() +{ + [ "$FSTYP" != "cifs" ] \ + && _fail "setup_cifs_testdir: \$FSTYP is not cifs" + [ -z "$SCRATCH_DEV" ] \ + && _notrun "this test requires a valid host fs for \$SCRATCH_DEV" + [ -z "$SCRATCH_MNT" ] \ + && _notrun "this test requires a valid \$SCRATCH_MNT" + + # mounted? + if _mount | grep -q $SCRATCH_DEV + then + # if it's mounted, make sure its on $SCRATCH_MNT + if ! _mount | grep $SCRATCH_DEV | grep -q $SCRATCH_MNT + then + _fail "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting" + fi + $UMOUNT_PROG $SCRATCH_DEV + fi + + _scratch_mkfs + _scratch_mount + + testdir=$SCRATCH_MNT +} + # # Warning for UDF and NFS: # this function calls _setup_udf_scratchdir and _setup_udf_scratchdir @@ -1535,6 +1584,9 @@ _setup_testdir() nfs*) _setup_nfs_scratchdir ;; + cifs) + _setup_cifs_scratchdir + ;; *) testdir=$TEST_DIR ;; @@ -1552,6 +1604,10 @@ _cleanup_testdir() # umount testdir as it is $SCRATCH_MNT which could be used by xfs next [ -n "$testdir" ] && $UMOUNT_PROG $testdir ;; + cifs) + # umount testdir as it is $SCRATCH_MNT which could be used by xfs next + [ -n "$testdir" ] && $UMOUNT_PROG $testdir + ;; *) # do nothing, testdir is $TEST_DIR :