From patchwork Wed Sep 18 20:29:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2909351 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCF1CBFF05 for ; Wed, 18 Sep 2013 20:29:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47CD1203DC for ; Wed, 18 Sep 2013 20:29:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7A34203E5 for ; Wed, 18 Sep 2013 20:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117Ab3IRU3b (ORCPT ); Wed, 18 Sep 2013 16:29:31 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:37995 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675Ab3IRU3a (ORCPT ); Wed, 18 Sep 2013 16:29:30 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 889299A06B6 for ; Wed, 18 Sep 2013 14:29:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1379536169; bh=V6tjiXy0jKm0i7qybAIZ0d9Yy+W+CcE4sCdOQhkM7W4=; h=From:To:Subject:Date; b=aTKKlNd74NJ+4jjqUL4Ej2k/0Rx+8JsETPkzoc7l7kL8r7L1E/Qim3GGYcwVtrNkk Sv41VpMKfSyTdhyvj7LT2JR4I1rkY8kSvGPQqeRxTVjMn6I+gftWJmSfGXebo6fB4K RJ1cn7sybbrgNm9Jdo8XJqpSvdY9U90HrG/+fWfk= X-ASG-Debug-ID: 1379536168-03d6a50f70f11e0001-6jHSXT Received: from CAS2.int.fusionio.com (cas2.int.fusionio.com [10.101.1.41]) by mx1.fusionio.com with ESMTP id rbE1JJtDEOqNC92h (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Wed, 18 Sep 2013 14:29:28 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (10.101.1.160) by mail.fusionio.com (10.101.1.41) with Microsoft SMTP Server (TLS) id 14.3.158.1; Wed, 18 Sep 2013 14:29:27 -0600 From: Josef Bacik To: , Subject: [PATCH] xfstests: introduce _filter_backtick Date: Wed, 18 Sep 2013 16:29:26 -0400 X-ASG-Orig-Subj: [PATCH] xfstests: introduce _filter_backtick Message-ID: <1379536166-19232-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.101.1.160] X-Barracuda-Connect: cas2.int.fusionio.com[10.101.1.41] X-Barracuda-Start-Time: 1379536168 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.140733 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 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 Apparently the GNU guys decided to change their error output from something like Error `Error message' To Error 'Error message' So to fix this I've introduced _filter_backtick which will change any ` to ' and then changed the output of the tests that were failing for me because of this output. I tested this on a new box that has the new output and an old box which has the old output and it appears to fix the issue. Thanks, Signed-off-by: Josef Bacik --- common/filter | 7 +++++++ tests/generic/193 | 18 ++++++++++-------- tests/generic/193.out | 16 ++++++++-------- tests/generic/245 | 3 ++- tests/generic/245.out | 2 +- tests/generic/294 | 2 +- tests/generic/294.out | 8 ++++---- tests/generic/306 | 2 +- tests/generic/306.out | 2 +- 9 files changed, 35 insertions(+), 25 deletions(-) diff --git a/common/filter b/common/filter index ee738ca..ec49e18 100644 --- a/common/filter +++ b/common/filter @@ -280,5 +280,12 @@ _filter_size_to_bytes() echo $((${size:0:${#size}-1}*$mul)) } +# Old gnu utils used to spit out something like "Error `blah'" but the new ones +# do "Error 'blah'" so fix the ` to be a ' so we are consistent +_filter_backtick() +{ + sed -e "s/\`/\'/g" +} + # make sure this script returns success /bin/true diff --git a/tests/generic/193 b/tests/generic/193 index 4fa20ff..2186997 100755 --- a/tests/generic/193 +++ b/tests/generic/193 @@ -91,17 +91,18 @@ echo _create_files echo "user: chown root owned file to qa_user (should fail)" -su ${qa_user} -c "chown ${qa_user} $test_root" 2>&1 | _filter_files +su ${qa_user} -c "chown ${qa_user} $test_root" 2>&1 | _filter_files | \ + _filter_backtick echo "user: chown root owned file to root (should fail)" -su ${qa_user} -c "chown root $test_root" 2>&1 | _filter_files +su ${qa_user} -c "chown root $test_root" 2>&1 | _filter_files | _filter_backtick echo "user: chown qa_user owned file to qa_user (should succeed)" su ${qa_user} -c "chown ${qa_user} $test_user" # this would work without _POSIX_CHOWN_RESTRICTED echo "user: chown qa_user owned file to root (should fail)" -su ${qa_user} -c "chown root $test_user" 2>&1 | _filter_files +su ${qa_user} -c "chown root $test_user" 2>&1 | _filter_files | _filter_backtick _cleanup_files @@ -115,13 +116,14 @@ echo _create_files echo "user: chgrp root owned file to root (should fail)" -su ${qa_user} -c "chgrp root $test_root" 2>&1 | _filter_files +su ${qa_user} -c "chgrp root $test_root" 2>&1 | _filter_files | _filter_backtick echo "user: chgrp qa_user owned file to root (should fail)" -su ${qa_user} -c "chgrp root $test_user" 2>&1 | _filter_files +su ${qa_user} -c "chgrp root $test_user" 2>&1 | _filter_files | _filter_backtick echo "user: chgrp root owned file to qa_user (should fail)" -su ${qa_user} -c "chgrp ${qa_user} $test_root" 2>&1 | _filter_files +su ${qa_user} -c "chgrp ${qa_user} $test_root" 2>&1 | _filter_files | \ + _filter_backtick echo "user: chgrp qa_user owned file to qa_user (should succeed)" su ${qa_user} -c "chgrp ${qa_user} $test_user" @@ -144,7 +146,7 @@ echo "user: chmod a+r on qa_user owned file (should succeed)" su ${qa_user} -c "chmod a+r $test_user" echo "user: chmod a+r on root owned file (should fail)" -su ${qa_user} -c "chmod a+r $test_root" 2>&1 | _filter_files +su ${qa_user} -c "chmod a+r $test_root" 2>&1 | _filter_files | _filter_backtick # # Setup a file owned by the qa_user, but with a group ID that @@ -283,7 +285,7 @@ echo "user: touch qa_user file (should succeed)" su ${qa_user} -c "touch $test_user" echo "user: touch root file (should fail)" -su ${qa_user} -c "touch $test_root" 2>&1 | _filter_files +su ${qa_user} -c "touch $test_root" 2>&1 | _filter_files | _filter_backtick _cleanup_files diff --git a/tests/generic/193.out b/tests/generic/193.out index 357a7c1..7a7f89a 100644 --- a/tests/generic/193.out +++ b/tests/generic/193.out @@ -3,28 +3,28 @@ QA output created by 193 testing ATTR_UID user: chown root owned file to qa_user (should fail) -chown: changing ownership of `test.root': Operation not permitted +chown: changing ownership of 'test.root': Operation not permitted user: chown root owned file to root (should fail) -chown: changing ownership of `test.root': Operation not permitted +chown: changing ownership of 'test.root': Operation not permitted user: chown qa_user owned file to qa_user (should succeed) user: chown qa_user owned file to root (should fail) -chown: changing ownership of `test.user': Operation not permitted +chown: changing ownership of 'test.user': Operation not permitted testing ATTR_GID user: chgrp root owned file to root (should fail) -chgrp: changing group of `test.root': Operation not permitted +chgrp: changing group of 'test.root': Operation not permitted user: chgrp qa_user owned file to root (should fail) -chgrp: changing group of `test.user': Operation not permitted +chgrp: changing group of 'test.user': Operation not permitted user: chgrp root owned file to qa_user (should fail) -chgrp: changing group of `test.root': Operation not permitted +chgrp: changing group of 'test.root': Operation not permitted user: chgrp qa_user owned file to qa_user (should succeed) testing ATTR_MODE user: chmod a+r on qa_user owned file (should succeed) user: chmod a+r on root owned file (should fail) -chmod: changing permissions of `test.root': Operation not permitted +chmod: changing permissions of 'test.root': Operation not permitted check that the sgid bit is cleared -rw-rw-rw- check that suid bit is not cleared @@ -60,5 +60,5 @@ testing ATTR_*TIMES_SET user: touch qa_user file (should succeed) user: touch root file (should fail) -touch: cannot touch `test.root': Permission denied +touch: cannot touch 'test.root': Permission denied *** done diff --git a/tests/generic/245 b/tests/generic/245 index 9b87fbb..a2811ce 100755 --- a/tests/generic/245 +++ b/tests/generic/245 @@ -65,7 +65,8 @@ touch $dir/aa/1 mkdir $dir/ab/aa touch $dir/ab/aa/2 -mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty +mv $dir/ab/aa/ $dir 2>&1 | _filter_test_dir | _filter_directory_not_empty | \ + _filter_backtick status=0 exit $status diff --git a/tests/generic/245.out b/tests/generic/245.out index 8322aac..f5b5f18 100644 --- a/tests/generic/245.out +++ b/tests/generic/245.out @@ -1,2 +1,2 @@ QA output created by 245 -mv: cannot move `TEST_DIR/test-mv/ab/aa/' to `TEST_DIR/test-mv/aa': File exists +mv: cannot move 'TEST_DIR/test-mv/ab/aa/' to 'TEST_DIR/test-mv/aa': File exists diff --git a/tests/generic/294 b/tests/generic/294 index fa7f339..ef02e18 100755 --- a/tests/generic/294 +++ b/tests/generic/294 @@ -65,7 +65,7 @@ mkdir $THIS_TEST_DIR || _fail "Could not create dir for test" _create_files 2>&1 | _filter_scratch _scratch_mount -o remount,ro || _fail "Could not remount scratch readonly" -_create_files 2>&1 | _filter_scratch +_create_files 2>&1 | _filter_scratch | _filter_backtick # success, all done status=0 diff --git a/tests/generic/294.out b/tests/generic/294.out index 027d9fc..1ac1c67 100644 --- a/tests/generic/294.out +++ b/tests/generic/294.out @@ -1,5 +1,5 @@ QA output created by 294 -mknod: `SCRATCH_MNT/294.test/testnode': File exists -mkdir: cannot create directory `SCRATCH_MNT/294.test/testdir': File exists -touch: cannot touch `SCRATCH_MNT/294.test/testtarget': Read-only file system -ln: creating symbolic link `SCRATCH_MNT/294.test/testlink': File exists +mknod: 'SCRATCH_MNT/294.test/testnode': File exists +mkdir: cannot create directory 'SCRATCH_MNT/294.test/testdir': File exists +touch: cannot touch 'SCRATCH_MNT/294.test/testtarget': Read-only file system +ln: creating symbolic link 'SCRATCH_MNT/294.test/testlink': File exists diff --git a/tests/generic/306 b/tests/generic/306 index 04d28df..47235ec 100755 --- a/tests/generic/306 +++ b/tests/generic/306 @@ -71,7 +71,7 @@ _scratch_mount -o ro || _fail "Could not mount scratch readonly" # We should be able to read & write to/from these devices even on an RO fs echo "== try to create new file" -touch $SCRATCH_MNT/this_should_fail 2>&1 | _filter_scratch +touch $SCRATCH_MNT/this_should_fail 2>&1 | _filter_scratch | _filter_backtick echo "== pwrite to null device" $XFS_IO_PROG -c "pwrite 0 512" $DEVNULL | _filter_xfs_io echo "== pread from zero device" diff --git a/tests/generic/306.out b/tests/generic/306.out index 69bfb42..fb3748b 100644 --- a/tests/generic/306.out +++ b/tests/generic/306.out @@ -1,6 +1,6 @@ QA output created by 306 == try to create new file -touch: cannot touch `SCRATCH_MNT/this_should_fail': Read-only file system +touch: cannot touch 'SCRATCH_MNT/this_should_fail': Read-only file system == pwrite to null device wrote 512/512 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)