From patchwork Fri Aug 29 19:42:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4812341 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 C1EC39F37E for ; Fri, 29 Aug 2014 19:42:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D91092011B for ; Fri, 29 Aug 2014 19:42:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E454A20117 for ; Fri, 29 Aug 2014 19:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbaH2Tml (ORCPT ); Fri, 29 Aug 2014 15:42:41 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:59623 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753383AbaH2Tmi (ORCPT ); Fri, 29 Aug 2014 15:42:38 -0400 Received: by mail-la0-f53.google.com with SMTP id s18so3237647lam.40 for ; Fri, 29 Aug 2014 12:42:36 -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=nV6KnRTIL1yoiNSVs8f/jJEnFClXkn0vbGbTx2ssC/E=; b=xUPiB6WhSjqY6Qfz62kjJqWJG0lVQ17sLPoKZT2Tj7SvHCoQDEm11SXlx8Kykesm6c LGDkM80PGRDzgk3cB9uGtSTxnME++cw6xRMg4pbugMJB7AF7DXEMInwuyLKD6LK8iem0 anBD9BH8l/IkZ5XGSdSFirpprnE2DDWbMM39kv2Ulizddoz4vr0fZH3c/g8ubTf429ul ag2sWxjBQtW74fD8hn7LOSGhf6oQhf/RJR5A3RfoFgOl+nO5ga8aIsY2VLf2pWPwIAFA DzWazrM+axv6HY1eAnR/cJghy7gQDtyqPl1FObSrblZXJkalu+bThRb9TEw4/XUceh2Q 9roQ== X-Received: by 10.152.5.42 with SMTP id p10mr13476812lap.82.1409341356937; Fri, 29 Aug 2014 12:42:36 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.28]) by mx.google.com with ESMTPSA id os7sm1301670lbb.42.2014.08.29.12.42.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Aug 2014 12:42:35 -0700 (PDT) From: Pavel Shilovsky To: fstests@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@samba.org, David Disseldorp , Steve French Subject: [PATCH v3 3/3] cifs: skip tests that need POSIX support for nounix mounts Date: Fri, 29 Aug 2014 23:42:20 +0400 Message-Id: <1409341340-27031-4-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409341340-27031-1-git-send-email-pshilovsky@samba.org> References: <1409341340-27031-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 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. Reviewed-by: Steve French Signed-off-by: Pavel Shilovsky --- 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 8b427fc..e1b3098 100644 --- a/common/rc +++ b/common/rc @@ -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 diff --git a/tests/generic/005 b/tests/generic/005 index d78e43f..70f6073 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 114485c..1062b5b 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 8945191..bcc246e 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 6b6c8ab..da295a3 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 b4e3ff0..3bcb0d1 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