| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH v2 12/12] xfstests: check if filesystem supports chattr |
| From: | Junho Ryu <jayr@xxxxxxxxxx> |
| Date: | Tue, 17 Dec 2013 14:18:42 -0800 |
| Cc: | branto@xxxxxxxxxx, hughd@xxxxxxxxxx, tytso@xxxxxxx, Junho Ryu <jayr@xxxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uPfhngOtLBLaHJJMyF4xJ0t6H/h2tepNsP2PpGtivL4=; b=I4R35crWXxAY/fhaweoNgUP/M9EC31HJqrFpnesPvBB6Qr4HI4/iLWYDwQqcbiv9Yb ob08fSIsxPvuCWRd1BHsqnc25dimbiWfZ3jHsQOgZMZyD2XqDaLLKlDLACIwD68Fi79h 6iPaibXcZsqrJIFMBme2VLYiqig63Obg3dHkTVDRmgWeIWu59e9mRPTZuBf9RaWQrKIG AAYZJZmJxZz8BeaTuCZzK2reKjSRUWlF7a8wZgjTPncl0tz64Jg7ANd77ArjoU85oQfO VG+tVEd+PpRTGzM7JB4Ud93eOYgHG7PP7BQlVTsHVOSTVHGPEnbcsNcSVM0THHpHPvCk DZMA== |
| In-reply-to: | <1387318722-3050-1-git-send-email-jayr@xxxxxxxxxx> |
| References: | <1387318722-3050-1-git-send-email-jayr@xxxxxxxxxx> |
Add _require_chattr which verifies exit code of chattr command and call
it before running generic/277.
Signed-off-by: Junho Ryu <jayr@xxxxxxxxxx>
---
v2: extracted from patch 9
common/attr | 13 +++++++++++++
tests/generic/277 | 2 ++
2 files changed, 15 insertions(+)
diff --git a/common/attr b/common/attr
index 4a3ac9e..278633f 100644
--- a/common/attr
+++ b/common/attr
@@ -218,5 +218,18 @@ else # Assume max ~1 block of attrs
fi
export MAX_ATTRVAL_SIZE
+
+_require_chattr()
+{
+ touch $TEST_DIR/syscalltest
+ chattr +A $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+ if [ $? -ne 0 ]; then
+ _notrun "chattr has failed to change attribute of a file in TEST_DIR"
+ fi
+ cat $TEST_DIR/syscalltest.out >> $seqres.full
+
+ rm -f $TEST_DIR/syscalltest.out
+}
+
# make sure this script returns success
/bin/true
diff --git a/tests/generic/277 b/tests/generic/277
index 8461ad9..c31f7c4 100755
--- a/tests/generic/277
+++ b/tests/generic/277
@@ -38,11 +38,13 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
+. ./common/attr
# real QA test starts here
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_chattr
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
--
1.8.5.1
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH v2 11/12] xfstests: do not unmount before calling _check_scratch_fs(), Junho Ryu |
|---|---|
| Next by Date: | [PATCH v2 08/12] xfstests: add executable permission to tests, Junho Ryu |
| Previous by Thread: | [PATCH v2 11/12] xfstests: do not unmount before calling _check_scratch_fs(), Junho Ryu |
| Next by Thread: | Re: [PATCH v2 12/12] xfstests: check if filesystem supports chattr, Junho Ryu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |