From patchwork Fri Nov 9 04:19:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Murphy Zhou X-Patchwork-Id: 10675277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4943113BF for ; Fri, 9 Nov 2018 04:19:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 388A22E658 for ; Fri, 9 Nov 2018 04:19:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BF042E65D; Fri, 9 Nov 2018 04:19:27 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham 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 CDC4C2E658 for ; Fri, 9 Nov 2018 04:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbeKIN6K (ORCPT ); Fri, 9 Nov 2018 08:58:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56898 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727378AbeKIN6K (ORCPT ); Fri, 9 Nov 2018 08:58:10 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9E788B102 for ; Fri, 9 Nov 2018 04:19:25 +0000 (UTC) Received: from localhost (dhcp-12-130.nay.redhat.com [10.66.12.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A56618664; Fri, 9 Nov 2018 04:19:24 +0000 (UTC) From: Xiong Murphy Zhou To: fstests@vger.kernel.org Cc: Xiong Murphy Zhou Subject: [PATCH] generic/398: filter out extra string from newer mv Date: Fri, 9 Nov 2018 12:19:13 +0800 Message-Id: <20181109041913.31032-1-xzhou@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 09 Nov 2018 04:19:25 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP mv command produces a leading string "renamed" from some time. This breaks generic/398. Adding a _filter_mv to filter it out. Tested this patch on Fedora 28. sh-4.2$ rpm -qf /usr/bin/mv coreutils-8.22-23.el7.x86_64 sh-4.2$ mv -v 1 2 ‘1’ -> ‘2’ sh-4.2$ h-4.4# rpm -qf /usr/bin/mv coreutils-8.30-5.el8.x86_64 sh-4.4# mv -v 1 2 renamed '1' -> '2' sh-4.4# igned-off-by: Xiong Murphy Zhou --- common/filter | 6 ++++++ tests/generic/398 | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/common/filter b/common/filter index e87740dd..ed082d24 100644 --- a/common/filter +++ b/common/filter @@ -504,6 +504,12 @@ _filter_mknod() sed -e "s/mknod: [\`']\(.*\)': File exists/mknod: \1: File exists/" } +# Remove leading "rename" in "mv -v" output +_filter_mv() +{ + sed -e "s/^renamed //" +} + _filter_lostfound() { sed -e '/^lost+found$/d' diff --git a/tests/generic/398 b/tests/generic/398 index 58b54af0..efb8348c 100755 --- a/tests/generic/398 +++ b/tests/generic/398 @@ -95,7 +95,7 @@ ln -v $edir1/efile1 $udir/efile1 |& _filter_scratch rm $udir/efile1 # undo echo -e "\n*** Rename encrypted => unencrypted ***" -mv -v $edir1/efile1 $udir/efile1 |& _filter_scratch +mv -v $edir1/efile1 $udir/efile1 |& _filter_scratch |& _filter_mv mv $udir/efile1 $edir1/efile1 # undo @@ -119,9 +119,9 @@ src/renameat2 -x $edir1/efile1 $udir/ufile |& _filter_scratch echo -e "\n\n*** Special file tests ***" mkfifo $edir1/fifo -mv -v $edir1/fifo $edir2/fifo | _filter_scratch -mv -v $edir2/fifo $udir/fifo | _filter_scratch -mv -v $udir/fifo $edir1/fifo | _filter_scratch +mv -v $edir1/fifo $edir2/fifo | _filter_scratch |& _filter_mv +mv -v $edir2/fifo $udir/fifo | _filter_scratch |& _filter_mv +mv -v $udir/fifo $edir1/fifo | _filter_scratch |& _filter_mv mkfifo $udir/fifo src/renameat2 -x $udir/fifo $edir1/fifo ln -v $edir1/fifo $edir2/fifo | _filter_scratch