From patchwork Sat Feb 13 17:41:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 8300401 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 544B69F372 for ; Sat, 13 Feb 2016 17:41:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 649D92042C for ; Sat, 13 Feb 2016 17:41:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4E1320416 for ; Sat, 13 Feb 2016 17:41:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751031AbcBMRlQ (ORCPT ); Sat, 13 Feb 2016 12:41:16 -0500 Received: from imap.thunk.org ([74.207.234.97]:34528 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750875AbcBMRlP (ORCPT ); Sat, 13 Feb 2016 12:41:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=aruaZwbMcLI7MhXkNiPOGjslC25Kva8nAZiNve++rhY=; b=v7ZYlHQd8WhYwXfEbgWJjMyov2IspV3Fl5Yxjp+faRCjye5uM9e36+mgzl6LZkq5Bd7Nzk+kbBYaBv+Pgsn28UNVYUrhJsuypaTSP6tLYjl+umPtbmcpymS498AIc1pnR2MqbX1OuW/aroF+ZQ11S1YmjJLtHEcOdHZW4ElEcb0=; Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.84) (envelope-from ) id 1aUeC2-0004cZ-M7; Sat, 13 Feb 2016 17:41:14 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id F2FF482E0A1; Sat, 13 Feb 2016 12:41:12 -0500 (EST) From: Theodore Ts'o To: fstests@vger.kernel.org Cc: hughd@google.com, Theodore Ts'o Subject: [PATCH 13/16] xfstests: generic/079 and generic/277 requires chattr, not xattrs Date: Sat, 13 Feb 2016 12:41:06 -0500 Message-Id: <1455385269-26319-14-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455385269-26319-1-git-send-email-tytso@mit.edu> References: <1455385269-26319-1-git-send-email-tytso@mit.edu> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@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 From: Hugh Dickins Add a new helper, _require_chattr, which allows the test to explicitly check to see if the file system supports a specific chattr flag, as not all file systems support chattr +A or chattr +i, and the presence of extended attribute support is has nothing to do with a specific chattr flag being supported. Signed-off-by: Hugh Dickins Signed-off-by: Theodore Ts'o Reviewed-by: Christoph Hellwig --- common/rc | 16 ++++++++++++++++ tests/generic/079 | 2 +- tests/generic/277 | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 42415a7..0e5320f 100644 --- a/common/rc +++ b/common/rc @@ -3133,6 +3133,22 @@ _xfs_bmapx_find() { "$XFS_IO_PROG" -c "bmap -${param}lpv" "$file" | grep -c "$@" } +_require_chattr() +{ + attribute=$1 + + touch $TEST_DIR/syscalltest + chattr "+$attribute" $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1 + status=$? + chattr "-$attribute" $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1 + if [ "$status" -ne 0 ]; then + _notrun "file system doesn't support chattr +$attribute" + fi + cat $TEST_DIR/syscalltest.out >> $seqres.full + + rm -f $TEST_DIR/syscalltest.out +} + _get_total_inode() { if [ -z "$1" ]; then diff --git a/tests/generic/079 b/tests/generic/079 index 041d9c0..5cceeba 100755 --- a/tests/generic/079 +++ b/tests/generic/079 @@ -48,7 +48,7 @@ _cleanup() _supported_fs generic _supported_os Linux -_require_attrs +_require_chattr i _require_scratch [ -x $timmutable ] || _notrun "t_immutable was not built for this platform" diff --git a/tests/generic/277 b/tests/generic/277 index f92235b..8e2a32f 100755 --- a/tests/generic/277 +++ b/tests/generic/277 @@ -44,7 +44,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs generic _supported_os Linux _require_scratch -_require_attrs +_require_chattr A _scratch_mkfs > /dev/null 2>&1 _scratch_mount