From patchwork Thu Jan 24 08:33:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10778591 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 EA2791390 for ; Thu, 24 Jan 2019 08:33:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC00F2E1D8 for ; Thu, 24 Jan 2019 08:33:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF8E82E204; Thu, 24 Jan 2019 08:33:20 +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 74E3E2E1D8 for ; Thu, 24 Jan 2019 08:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726516AbfAXIdU (ORCPT ); Thu, 24 Jan 2019 03:33:20 -0500 Received: from mail-wm1-f44.google.com ([209.85.128.44]:36433 "EHLO mail-wm1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbfAXIdU (ORCPT ); Thu, 24 Jan 2019 03:33:20 -0500 Received: by mail-wm1-f44.google.com with SMTP id p6so2042936wmc.1; Thu, 24 Jan 2019 00:33:18 -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; bh=Cg3nJzpF1SvPKlm9dlLFqa8IMi8Ju/lv5/W0r1ssDes=; b=hxQIW2Q2xuz+C8vIIIGOYbsPBlijxhJ+VTffRQhCZKT834AZKUenmfk9IGLi8WeDI8 nNoRrd5TJHcIN8g4t0RrrKi8bLulobv+VyvrkS4ii87rcTLCVyvWaevG8tc+zG32WKEW V2epmM5scrDvr83dEiGAXVoqOp49VRjMz1tgEHl82+QiGwd7764qJ2dIzhZkiFC9mT1Z m5ZtribU/++xmKZF6g1liU/wWCr1uSpVxQQkzIUAqq/0FanHibAwvsERe5JFelrUbfRV TUdQlObATl2qqLwgcqxWniWKXl8ZsnMKu7FLij+SP3kFjhDCK5HaxplF3RMtTJPFY0Mz UtNQ== 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; bh=Cg3nJzpF1SvPKlm9dlLFqa8IMi8Ju/lv5/W0r1ssDes=; b=QujepNVTnycH2FTgMVMew5yRhdrwBZq1efUbb5TGzPR/YOrRVixAgXCUavHC7WmHzF P5jBEO+nWtKDi6KsDa7oeBr/0cBrlYswgeIbhXN1G4xTiv/44ta0hwTke9PzFjSyipUE GFb3kXk2HPHmBaffAA/dOw/qthxXjj/uHzyKh+hAP9P/qdgqZJyUkJf34zBUw2Poxw8S HfAo7pz+81Plje601YcvMl2g/NkQNRltiNNLTrB8Tf0du+YFHEUdS8Lh9PKqCISMU8Wo 6ICUVm8gVJD6TJhdxXc+HcC/gbIegonb94/nDu/SvNbTGT9nKLDQTuT/oH/oAUk95x6T wPgg== X-Gm-Message-State: AJcUukeYdZVoI9XFtSQC36fHg/6blgE7j1GMafFs+yasZzOlDKZ69dvH cGGfvNc+qr5avnM4SrpVdQmpOZSq X-Google-Smtp-Source: ALg8bN4JGx7ar2CMHR/puHmBcbloIoMzbcYhNek7EgNjpKRW9Ur0pTkRwNo05gLb6YC5e5sYulSWmg== X-Received: by 2002:a1c:ab87:: with SMTP id u129mr1616628wme.104.1548318797436; Thu, 24 Jan 2019 00:33:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 00:33:16 -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 1/2] common/dump: do not override test cleanup trap Date: Thu, 24 Jan 2019 10:33:09 +0200 Message-Id: <20190124083310.25928-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently this doesn't matter for the two dump tests xfs/022 and xfs/068 because they do not have a _cleanup() routine and the override dump _cleanup() routine does the generic cleanup as well. Instead, call the _dump_cleanup explicitly from the trap in those tests. Signed-off-by: Amir Goldstein --- common/dump | 5 +---- tests/xfs/022 | 2 +- tests/xfs/068 | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/common/dump b/common/dump index 4d1a1607..47d14601 100644 --- a/common/dump +++ b/common/dump @@ -45,9 +45,6 @@ session_label="stress_$seq" nobody=4 # define this uid/gid as a number do_quota_check=true # do quota check if quotas enabled -# install our cleaner -trap "_cleanup; exit \$status" 0 1 2 3 15 - # start inventory from a known base - move it aside for test for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do if [ -d $dir ]; then @@ -227,7 +224,7 @@ _wipe_fs() # Cleanup created dirs and files # Called by trap # -_cleanup() +_dump_cleanup() { # Some tests include this before checking _supported_fs xfs # and the sleeps & checks here get annoying diff --git a/tests/xfs/022 b/tests/xfs/022 index e1162798..f091b7c5 100755 --- a/tests/xfs/022 +++ b/tests/xfs/022 @@ -17,7 +17,7 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15 +trap "_dump_cleanup; exit \$status" 0 1 2 3 15 . ./common/rc . ./common/dump diff --git a/tests/xfs/068 b/tests/xfs/068 index c755bc3e..95a8cd12 100755 --- a/tests/xfs/068 +++ b/tests/xfs/068 @@ -18,7 +18,7 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15 +trap "_dump_cleanup; exit \$status" 0 1 2 3 15 . ./common/rc . ./common/dump 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