From patchwork Fri Jun 24 15:08:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 9197759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB2F460871 for ; Fri, 24 Jun 2016 15:08:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAFED284BC for ; Fri, 24 Jun 2016 15:08:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF480284BE; Fri, 24 Jun 2016 15:08:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D976284BC for ; Fri, 24 Jun 2016 15:08:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbcFXPIh (ORCPT ); Fri, 24 Jun 2016 11:08:37 -0400 Received: from mx2.suse.de ([195.135.220.15]:58741 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750988AbcFXPIh (ORCPT ); Fri, 24 Jun 2016 11:08:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 71810ABA6; Fri, 24 Jun 2016 15:08:35 +0000 (UTC) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id 22DCA84F2E; Fri, 24 Jun 2016 11:08:34 -0400 (EDT) From: jeffm@suse.com To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 1/4] fstests: btrfs/048: extend _filter_btrfs_prop_error to handle additional errors Date: Fri, 24 Jun 2016 11:08:31 -0400 Message-Id: <1466780914-23884-1-git-send-email-jeffm@suse.com> X-Mailer: git-send-email 2.7.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff Mahoney btrfsprogs v4.5.3 changed the formatting of some error messages. This patch extends the filter for btrfs prop to handle those. Signed-off-by: Jeff Mahoney --- common/filter.btrfs | 10 +++++++--- tests/btrfs/048 | 6 ++++-- tests/btrfs/048.out | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/common/filter.btrfs b/common/filter.btrfs index 9970f4d..54361d4 100644 --- a/common/filter.btrfs +++ b/common/filter.btrfs @@ -72,15 +72,19 @@ _filter_btrfs_compress_property() sed -e "s/compression=\(lzo\|zlib\)/COMPRESSION=XXX/g" } -# filter name of the property from the output, optionally verify against $1 +# filter error messages from btrfs prop, optionally verify against $1 # recognized message(s): # "object is not compatible with property: label" +# "invalid value for property:{, value}" +# "failed to {get,set} compression for $PATH[.:]: Invalid argument" _filter_btrfs_prop_error() { if ! [ -z "$1" ]; then - sed -e "s/\(compatible with property\): $1/\1/" + sed -e "s#\(compatible with property\): $1#\1#" \ + -e "s#^\(.*failed to [sg]et compression for $1\)[:.] \(.*\)#\1: \2#" else - sed -e "s/^\(.*compatible with property\).*/\1/" + sed -e "s#^\(.*compatible with property\).*#\1#" \ + -e "s#^\(.*invalid value for property\):.*#\1#" fi } diff --git a/tests/btrfs/048 b/tests/btrfs/048 index 4a36303..0b907b0 100755 --- a/tests/btrfs/048 +++ b/tests/btrfs/048 @@ -79,7 +79,8 @@ echo -e "\nTesting subvolume ro property" _run_btrfs_util_prog subvolume create $SCRATCH_MNT/sv1 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1 ro echo "***" -$BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 ro foo +$BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 ro foo 2>&1 | + _filter_btrfs_prop_error echo "***" $BTRFS_UTIL_PROG property set $SCRATCH_MNT/sv1 ro true echo "***" @@ -99,7 +100,8 @@ $BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/file1 compression $BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/subdir1 compression echo "***" $BTRFS_UTIL_PROG property set $SCRATCH_MNT/testdir/file1 compression \ - foo 2>&1 | _filter_scratch + foo 2>&1 | _filter_scratch | + _filter_btrfs_prop_error SCRATCH_MNT/testdir/file1 echo "***" $BTRFS_UTIL_PROG property set $SCRATCH_MNT/testdir/file1 compression lzo $BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir/file1 compression diff --git a/tests/btrfs/048.out b/tests/btrfs/048.out index 0b20d0b..3e4e3d2 100644 --- a/tests/btrfs/048.out +++ b/tests/btrfs/048.out @@ -15,7 +15,7 @@ ERROR: object is not compatible with property Testing subvolume ro property ro=false *** -ERROR: invalid value for property. +ERROR: invalid value for property *** *** ro=true @@ -27,7 +27,7 @@ ro=false Testing compression property *** -ERROR: failed to set compression for SCRATCH_MNT/testdir/file1. Invalid argument +ERROR: failed to set compression for SCRATCH_MNT/testdir/file1: Invalid argument *** compression=lzo compression=lzo