From patchwork Sun Jan 27 07:50:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10782699 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 8BE6A159A for ; Sun, 27 Jan 2019 07:51:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EF882BDDB for ; Sun, 27 Jan 2019 07:51:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7386F2C1E7; Sun, 27 Jan 2019 07:51:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,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 1C6A12C1DD for ; Sun, 27 Jan 2019 07:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726419AbfA0HvJ (ORCPT ); Sun, 27 Jan 2019 02:51:09 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37086 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbfA0HvJ (ORCPT ); Sun, 27 Jan 2019 02:51:09 -0500 Received: by mail-wr1-f67.google.com with SMTP id s12so14494875wrt.4; Sat, 26 Jan 2019 23:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pA2/WcQUHiAQBCPbfO3swSMONkBIhNKIRwj/kNlL1a0=; b=HOzlv6w+CGM5ACGTcp1zlmopPZ3gfpwxMCXtquFwv+IhANnnbDYDNlcg4lpxm+yixU 0/9ushtJlTq1YZdp2ejzkr1bjsktItcr+q5TZEercYXfVN3Z2pJz1worMUUpsa6J38xH mJcslwkK9MaRxgiHz8MSh3Hux3bvACcZCg2dEhjZmB6Y6ZfJEnkeSHkt0uJ4dSbJ7dkZ wHwqkeiF6HFmygKcDmk3QdFltIbf/72jKvx4NUJDQ9jxe/ov7JGUiVhQDAjN2rF/VLR/ 4FgVVkDQwSfJWgO0CO2fI1+CF2zsV1zBMu6T1Vt6Uz7zsQZfwRBs8pMqiRw6GUkte86Z zngQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pA2/WcQUHiAQBCPbfO3swSMONkBIhNKIRwj/kNlL1a0=; b=MGjvHeSIlCrO3Ag5PZNPjsYezLCcyBFvfg0F6V/Sdlpwfhd17lW1W3mqjnxz8VFUHJ 2kXasHXXm8PPzXVbAGbIy0zbwUb+yowRAYCz8WBesixohsCJv7gV0dIsYNCXiT6UIuOe zoIRBOypbeFVnMKtayzICtF6rMywrUKDY9Ko34unTXEE7T2gPPPLo9yDHt5qzjanVAX1 vqKz5shy3CiRjWpmEvU9y1hOWLsDPQ9qEIlIVnpeJKbgRDEVeYCaWZma5+WXLqEwp9UW jkyONPl7bXo4Kd6mJX+PMTIZgoyxctKJIzcsInEHe0I+AfYSeTjAUKZsxqv6VTrKMXZU DXFQ== X-Gm-Message-State: AJcUukepPnYevZnC44MJjS8ub2pj0U9GC6vB48QAAP2EfjpsaRfenbqO sJZRlpylnv/Ubd23AXkwgP4= X-Google-Smtp-Source: ALg8bN7xgq4b7j1GzRCXNxM3DCv1GNn0CgKCyc6hWDvVnyFZbTogOgXYDp1MH35plUK7iwNXpZdiGw== X-Received: by 2002:adf:f0c5:: with SMTP id x5mr16628378wro.77.1548575467206; Sat, 26 Jan 2019 23:51:07 -0800 (PST) Received: from amir-VirtualBox.ctera.local ([188.120.129.201]) by smtp.gmail.com with ESMTPSA id e27sm138117020wra.67.2019.01.26.23.51.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Jan 2019 23:51:06 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Dave Chinner , Zorro Lang , Eric Sandeen , "Darrick J . Wong" , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH v2 2/2] xfs/068: Verify actual file count instead of reported file count Date: Sun, 27 Jan 2019 09:50:57 +0200 Message-Id: <20190127075057.25254-2-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190127075057.25254-1-amir73il@gmail.com> References: <20190127075057.25254-1-amir73il@gmail.com> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test has the number of files/dirs created by xfsrestore hardcoded in golden output. When fsstress is added new ops, the number of files/dirs created with the same random seed changes and this regularly breaks this test, so when new fsstress ops are added they should be either added to the dump test blacklist or golden output of this test needs to be ammended to reflect the change. The golden output includes only the file count reported by xfsrestore and test does not even verify that this is the correct file count. Instead, leave the golden output nuetral and explicitly verify that file count before and after the test are the same. With this change, the test becomes agnostic to fsstress ops and we could also stop blacklisting clone/dedup/copy ops if we want. Signed-off-by: Amir Goldstein --- common/dump | 7 +++++++ tests/xfs/068 | 14 +++++++++++++- tests/xfs/068.out | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/common/dump b/common/dump index 89fa0391..f112fc37 100644 --- a/common/dump +++ b/common/dump @@ -1514,6 +1514,13 @@ _check_quota_file() _check_quota 'xfsdump_quotas' 'xfsdump_quotas_group' 'xfsdump_quotas_proj' } +_count_dumpdir_files() +{ + local ndirs=$(find $dump_dir -type d | wc -l) + local nents=$(find $dump_dir | wc -l) + + echo "$ndirs directories and $nents entries" +} # make sure this script returns success /bin/true diff --git a/tests/xfs/068 b/tests/xfs/068 index 7f5900fc..264a9e96 100755 --- a/tests/xfs/068 +++ b/tests/xfs/068 @@ -30,12 +30,24 @@ _cleanup() . ./common/rc . ./common/dump +# remove previous $seqres.full before test +rm -f $seqres.full + # real QA test starts here _supported_fs xfs _supported_os Linux _create_dumpdir_stress_num 4096 -_do_dump_restore + +echo -n "Before: " >> $seqres.full +_count_dumpdir_files | tee $tmp.before >> $seqres.full + +# filter out the file count, it changes as fsstress adds new operations +_do_dump_restore | sed -e "/entries processed$/s/[0-9][0-9]*/NUM/g" + +echo -n "After: " >> $seqres.full +_count_dumpdir_files | tee $tmp.after >> $seqres.full +diff -u $tmp.before $tmp.after # success, all done exit diff --git a/tests/xfs/068.out b/tests/xfs/068.out index fa3a5523..2b276b77 100644 --- a/tests/xfs/068.out +++ b/tests/xfs/068.out @@ -22,7 +22,7 @@ xfsrestore: session id: ID xfsrestore: media ID: ID xfsrestore: searching media for directory dump xfsrestore: reading directories -xfsrestore: 383 directories and 1335 entries processed +xfsrestore: NUM directories and NUM entries processed xfsrestore: directory post-processing xfsrestore: restoring non-directory files xfsrestore: restore complete: SECS seconds elapsed