From patchwork Thu Jan 24 08:33:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10778595 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 6B2F06C2 for ; Thu, 24 Jan 2019 08:33:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD252E1D8 for ; Thu, 24 Jan 2019 08:33:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 528BD2E209; Thu, 24 Jan 2019 08:33:22 +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=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 E95972E1F3 for ; Thu, 24 Jan 2019 08:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbfAXIdV (ORCPT ); Thu, 24 Jan 2019 03:33:21 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:35728 "EHLO mail-wr1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbfAXIdV (ORCPT ); Thu, 24 Jan 2019 03:33:21 -0500 Received: by mail-wr1-f54.google.com with SMTP id 96so5491782wrb.2; Thu, 24 Jan 2019 00:33:19 -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=BxYCKNH2XZ8vrI9pvrXgMIcP1XHUvi7fzUktzX/zbLk=; b=c8SPaczcCsXKznyJbqRRbyzY73PZRgEQwFe7nanTgsIm2yZRKe4wzyhQ4PcPMm/xss jAUz4fZd/a8uid6LklnU2/lH722o6nzNMb01pjRjPNIYB0+iMo9Lkyjrx1smfiYe+D0p wbdwaNNHJilb3htmyY041qHxyIJBic50lNjFVah1kznD9MPUwbuqGBDlmmiw/KbslbOA WZ/bo/M6KcNpsziHGb73Mg31v70rRYXMblPQA3RBcyg7DUbo/r5Aae3GNtxrevCSdUua Of33MoS4lj03ll+jwfNh44E38qwJMUo2wp9Qd8Qt7b5IeN+K3RT/Ph59fQgSj4+8tX2n XpWQ== 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=BxYCKNH2XZ8vrI9pvrXgMIcP1XHUvi7fzUktzX/zbLk=; b=dCCXgkaaiPQfGCtAKpyNX917pDwssczV35RuByzd1hvxIh3lr0W5A011HGdQ23xD1N drB7KANdfxZcJdxr/Ox/mF8olOuIoTLjo1MhjN0U/2X7sCFhhIKdLjjOoa457dRAJnpt TzX8lkTvPGc/kreZrZGjc+nRz4j0knwzkp7lX7hBjuVqxVYyJoezbeT3HWlw2gwYrsqi ja0qt/lE/6LhQilsADPb8IMNlMK0kj5MvV0HQRiOCy61qINHEgQyoZgU3IBHqflpjQ5O NtaB57x5CirTLbnuBgrwvIDfvJKVQ8wU+z/AqV+G7ojyaMVfjKzxKvBO2yhFmCqTafTo cRfQ== X-Gm-Message-State: AJcUukcXAIRsaA4bloSOYAJkAB8ARlytqmmvl9fIAz1b/A4sfoxGjMqp n7Pa1Fj+z9ildOT/UOsCAyE= X-Google-Smtp-Source: ALg8bN40i4FNc3yV0aWGbguQWeirZNdtUv3burPTTd+7c/JKfFhWFvCBaK/m9FsFAkavRodSdp57JQ== X-Received: by 2002:adf:81c4:: with SMTP id 62mr5800987wra.266.1548318798951; Thu, 24 Jan 2019 00:33:18 -0800 (PST) Received: from amir-VirtualBox.ctera.local ([188.120.129.201]) by smtp.gmail.com with ESMTPSA id p139sm119255107wmd.31.2019.01.24.00.33.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 00:33:18 -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 2/2] xfs/068: Add fsstress generated file count to golden output Date: Thu, 24 Jan 2019 10:33:10 +0200 Message-Id: <20190124083310.25928-2-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190124083310.25928-1-amir73il@gmail.com> References: <20190124083310.25928-1-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test has the number of files/dirs created by fsstress 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. Since the golden output includes only the file count after dump/restore, add also the file count before dump/restore so developers are less likely to forget to check the validity of golden output before commiting the change. For some reason the file count reported by xfsrestore has one directory more than the file count reported by 'find'. I did not investigate why that is, but did verify that this was the same with the original test fsstress ops (i.e. without the added ops insert/mread/mwrite/aread/awrite/readv/writev). Signed-off-by: Amir Goldstein --- common/dump | 7 +++++++ tests/xfs/068 | 1 + tests/xfs/068.out | 1 + 3 files changed, 9 insertions(+) diff --git a/common/dump b/common/dump index 47d14601..23f42216 100644 --- a/common/dump +++ b/common/dump @@ -1515,6 +1515,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 "Created $ndirs directories and $nents entries" +} # make sure this script returns success /bin/true diff --git a/tests/xfs/068 b/tests/xfs/068 index 95a8cd12..ffc293bd 100755 --- a/tests/xfs/068 +++ b/tests/xfs/068 @@ -28,6 +28,7 @@ _supported_fs xfs _supported_os Linux _create_dumpdir_stress_num 4096 +_count_dumpdir_files _do_dump_restore # success, all done diff --git a/tests/xfs/068.out b/tests/xfs/068.out index fa3a5523..61cbbfa4 100644 --- a/tests/xfs/068.out +++ b/tests/xfs/068.out @@ -4,6 +4,7 @@ Creating directory system to dump using fsstress. ----------------------------------------------- fsstress : -f link=10 -f creat=10 -f mkdir=10 -f truncate=5 -f symlink=10 ----------------------------------------------- +Created 382 directories and 1334 entries xfsdump|xfsrestore ... xfsdump -s DUMP_SUBDIR - SCRATCH_MNT | xfsrestore - RESTORE_DIR xfsrestore: using file dump (drive_simple) strategy