From patchwork Thu Feb 11 05:56:19 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: 8276731 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD524BEEE5 for ; Thu, 11 Feb 2016 05:56:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F15F520373 for ; Thu, 11 Feb 2016 05:56:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EAC820351 for ; Thu, 11 Feb 2016 05:56:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750811AbcBKF43 (ORCPT ); Thu, 11 Feb 2016 00:56:29 -0500 Received: from imap.thunk.org ([74.207.234.97]:35995 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751034AbcBKF41 (ORCPT ); Thu, 11 Feb 2016 00:56:27 -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=oXmiZdes13ilkYsFi6exxtn4VJdquzay2Go6/XBl7+Q=; b=teLCZu0Al74t1yNLMTR5iBQoKZ0yxeRE/3zKKk5wHBJx+Dbszr3Kfy9MAhMqb3BiNbL2Vk9sDpv51BGt3E0NQshsuakJIg+6bANLU73qa4Mbtjx/TA9mWv0dTvjyO9dHwl31z2cC6lZLVGP7vENEcQy64LzBm+EXK+UTOqWyQ2U=; Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.84) (envelope-from ) id 1aTkEs-0003iD-DB; Thu, 11 Feb 2016 05:56:26 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 181F182E679; Thu, 11 Feb 2016 00:56:25 -0500 (EST) From: Theodore Ts'o To: fstests@vger.kernel.org Cc: hughd@google.com, Theodore Ts'o Subject: [PATCH 10/13] xfstests: generic/079 and generic/277 requires chattr, not xattrs Date: Thu, 11 Feb 2016 00:56:19 -0500 Message-Id: <1455170182-32587-11-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455170182-32587-1-git-send-email-tytso@mit.edu> References: <1455170182-32587-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=-7.0 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 --- 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 a585bd1..8754c17 100644 --- a/common/rc +++ b/common/rc @@ -3018,6 +3018,22 @@ _require_test_lsattr() _notrun "lsattr not supported by test filesystem type: $FSTYP" } +_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 39ebdc3..27858e4 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