From patchwork Sun Jan 27 07:50:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10782693 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 B3F1A139A for ; Sun, 27 Jan 2019 07:51:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A11302C1DD for ; Sun, 27 Jan 2019 07:51:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 943C52C1E3; Sun, 27 Jan 2019 07:51:10 +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 63B642BDDB for ; Sun, 27 Jan 2019 07:51:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726422AbfA0HvJ (ORCPT ); Sun, 27 Jan 2019 02:51:09 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45520 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726419AbfA0HvI (ORCPT ); Sun, 27 Jan 2019 02:51:08 -0500 Received: by mail-wr1-f65.google.com with SMTP id t6so14451318wrr.12; Sat, 26 Jan 2019 23:51:06 -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=0tRJEmx3zOREv7sCbtAr99LcdxWi9pEiAU6aZzDCbYM=; b=k5L3n0bVu/bS++hIaQstVfgERFBOYMdhf5Dfi4LeS93ctz1jljn2kBwQZ17G07k0J9 eDAlP3m3pSpdJ50/JDOomA6Sl+K3u3n51wXnzJ5UffLUPsS1/uf5qkKULnEl5tU8Mqbf E45ZA0ZmfMMOZOVC64T4P1joWEEm8Zjd4bhAMjG6U/+hIMDamBw3b7723v4uQlxcKCJW zvJhPUlOPlq3Xp/XDZ2d55gdYp2tYpjeKDkwBuY8punaw852UVZTVZkFUIbtMDPotFUr Vd3mlw53yKK700TKpASeQOQYdlYWat5RnoTAD6MRuCMFkmlon6ZSlZl5kaZW99dEMmCa iI/A== 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=0tRJEmx3zOREv7sCbtAr99LcdxWi9pEiAU6aZzDCbYM=; b=SXIW2hnOQ8jk8+5KLk27HsZjW6CzIJ2ozokl+iFMbSce0HxR2RLvnAx35wsUWRF4Ca OgFcMRMLJ6trTLHbahpK9hQCRxhrtmEwV8rSumGw48YgqpqaqrWyJi38fWUg/KD2tTZo kFpxJ/y5Jg9dTLhh0KhP6dUpfGCULv4YgDqEoRD/IZ+fbonjuvkEE5JYilX/fhZQPt3V LdlD9WAx8BMQEca4fWSHoQvaHQEVpnAx0dp+QwYHGPO7Ma+bMVapFEcXjr9xaVO2rLFG zS/+uW8qewUJhYIOCMYk8RNlSj++lLBDVdeCyq4dFclWqd8rYj/prvLFLEGrs2aNQ273 2sng== X-Gm-Message-State: AJcUukd2MggW/oha4Ka8bS4A8SEngW6ixurbTo2H41Xk0+g39y2xkGFT j5IC65vBz8QdCxHlYSQ88Tc= X-Google-Smtp-Source: ALg8bN4N78Aqq3tHp8wCl5wfnhHM6pjrb30P2/RUdVhSDUZjylnVxHLjjc2ex9ZrM3ZravxGX1B7yg== X-Received: by 2002:adf:ef50:: with SMTP id c16mr17259621wrp.198.1548575465346; Sat, 26 Jan 2019 23:51:05 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Jan 2019 23:51:04 -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 1/2] common/dump: do not override test cleanup trap Date: Sun, 27 Jan 2019 09:50:56 +0200 Message-Id: <20190127075057.25254-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 Instead, call _cleanup_dump explicitly from a private _cleanup. Remove the generic cleanup bits (rm $tmp.*) from _cleanup_dump. The only xfs/dump test that had anything other than rm $tmp.* in _cleanup in xfs/287, but that was _scratch_unmount, which is not needed anyway. Signed-off-by: Amir Goldstein --- common/dump | 6 +----- tests/xfs/022 | 9 ++++++++- tests/xfs/023 | 9 ++++++++- tests/xfs/024 | 9 ++++++++- tests/xfs/025 | 9 ++++++++- tests/xfs/026 | 9 ++++++++- tests/xfs/027 | 9 ++++++++- tests/xfs/028 | 9 ++++++++- tests/xfs/035 | 9 ++++++++- tests/xfs/036 | 9 ++++++++- tests/xfs/037 | 9 ++++++++- tests/xfs/038 | 9 ++++++++- tests/xfs/039 | 9 ++++++++- tests/xfs/043 | 9 ++++++++- tests/xfs/046 | 9 ++++++++- tests/xfs/047 | 9 ++++++++- tests/xfs/055 | 9 ++++++++- tests/xfs/056 | 9 ++++++++- tests/xfs/059 | 9 ++++++++- tests/xfs/060 | 9 ++++++++- tests/xfs/061 | 9 ++++++++- tests/xfs/063 | 9 ++++++++- tests/xfs/064 | 9 ++++++++- tests/xfs/065 | 9 ++++++++- tests/xfs/066 | 1 + tests/xfs/068 | 9 ++++++++- tests/xfs/266 | 9 ++++++++- tests/xfs/267 | 9 ++++++++- tests/xfs/268 | 9 ++++++++- tests/xfs/281 | 9 ++++++++- tests/xfs/282 | 9 ++++++++- tests/xfs/283 | 9 ++++++++- tests/xfs/287 | 2 +- tests/xfs/296 | 1 + tests/xfs/301 | 1 + tests/xfs/302 | 1 + 36 files changed, 246 insertions(+), 36 deletions(-) diff --git a/common/dump b/common/dump index 4d1a1607..89fa0391 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() +_cleanup_dump() { # Some tests include this before checking _supported_fs xfs # and the sleeps & checks here get annoying @@ -236,7 +233,6 @@ _cleanup() fi cd $here - rm -f $tmp.* if [ -n "$DEBUGDUMP" ]; then # save it for inspection diff --git a/tests/xfs/022 b/tests/xfs/022 index e1162798..e668a6fc 100755 --- a/tests/xfs/022 +++ b/tests/xfs/022 @@ -17,7 +17,14 @@ 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 "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} . ./common/rc . ./common/dump diff --git a/tests/xfs/023 b/tests/xfs/023 index b0763402..f7805b85 100755 --- a/tests/xfs/023 +++ b/tests/xfs/023 @@ -15,7 +15,14 @@ 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 "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/024 b/tests/xfs/024 index bf222150..b4ecd790 100755 --- a/tests/xfs/024 +++ b/tests/xfs/024 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/025 b/tests/xfs/025 index 5ce844e6..74039062 100755 --- a/tests/xfs/025 +++ b/tests/xfs/025 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/026 b/tests/xfs/026 index d4fd636c..96f71293 100755 --- a/tests/xfs/026 +++ b/tests/xfs/026 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/027 b/tests/xfs/027 index 8459c5ad..7a501f03 100755 --- a/tests/xfs/027 +++ b/tests/xfs/027 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/028 b/tests/xfs/028 index b71039b9..bedfa3d3 100755 --- a/tests/xfs/028 +++ b/tests/xfs/028 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/035 b/tests/xfs/035 index 1874173f..2e09c35c 100755 --- a/tests/xfs/035 +++ b/tests/xfs/035 @@ -14,7 +14,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/036 b/tests/xfs/036 index 8d61a719..a7e7d572 100755 --- a/tests/xfs/036 +++ b/tests/xfs/036 @@ -14,7 +14,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/037 b/tests/xfs/037 index 478157e4..aea557fc 100755 --- a/tests/xfs/037 +++ b/tests/xfs/037 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/038 b/tests/xfs/038 index 43fdc2c3..8ae93dad 100755 --- a/tests/xfs/038 +++ b/tests/xfs/038 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/039 b/tests/xfs/039 index 79284afd..7b213e33 100755 --- a/tests/xfs/039 +++ b/tests/xfs/039 @@ -14,7 +14,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/043 b/tests/xfs/043 index b60c2870..5db2d6f9 100755 --- a/tests/xfs/043 +++ b/tests/xfs/043 @@ -16,7 +16,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/046 b/tests/xfs/046 index c5358c29..0955e453 100755 --- a/tests/xfs/046 +++ b/tests/xfs/046 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/047 b/tests/xfs/047 index ddf871f8..2fdfef14 100755 --- a/tests/xfs/047 +++ b/tests/xfs/047 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/055 b/tests/xfs/055 index 8a30d4b3..58144e98 100755 --- a/tests/xfs/055 +++ b/tests/xfs/055 @@ -14,7 +14,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/056 b/tests/xfs/056 index 533fef2e..b0f70e90 100755 --- a/tests/xfs/056 +++ b/tests/xfs/056 @@ -14,7 +14,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/059 b/tests/xfs/059 index 949dbe81..0121872a 100755 --- a/tests/xfs/059 +++ b/tests/xfs/059 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/060 b/tests/xfs/060 index ca709983..a7048a66 100755 --- a/tests/xfs/060 +++ b/tests/xfs/060 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/061 b/tests/xfs/061 index fcea0ee8..f8a639fc 100755 --- a/tests/xfs/061 +++ b/tests/xfs/061 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/063 b/tests/xfs/063 index f4c65807..b6d4c03a 100755 --- a/tests/xfs/063 +++ b/tests/xfs/063 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/064 b/tests/xfs/064 index f8fc382a..8adb406a 100755 --- a/tests/xfs/064 +++ b/tests/xfs/064 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/065 b/tests/xfs/065 index 3fcdb604..c3472486 100755 --- a/tests/xfs/065 +++ b/tests/xfs/065 @@ -16,7 +16,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/066 b/tests/xfs/066 index b7da7966..90e1251c 100755 --- a/tests/xfs/066 +++ b/tests/xfs/066 @@ -22,6 +22,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { + _cleanup_dump cd / rm -f $tmp.* } diff --git a/tests/xfs/068 b/tests/xfs/068 index c755bc3e..7f5900fc 100755 --- a/tests/xfs/068 +++ b/tests/xfs/068 @@ -18,7 +18,14 @@ 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 "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} . ./common/rc . ./common/dump diff --git a/tests/xfs/266 b/tests/xfs/266 index 9084f5b9..73c1096d 100755 --- a/tests/xfs/266 +++ b/tests/xfs/266 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # # Add a new file and append a subset of the fill'ed files diff --git a/tests/xfs/267 b/tests/xfs/267 index 8887f4c1..d13ec19a 100755 --- a/tests/xfs/267 +++ b/tests/xfs/267 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # # create a 40 MiB file with an extended attr. diff --git a/tests/xfs/268 b/tests/xfs/268 index c2686302..fa5b9283 100755 --- a/tests/xfs/268 +++ b/tests/xfs/268 @@ -15,7 +15,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # # create two 12 MiB files with extended attrs. diff --git a/tests/xfs/281 b/tests/xfs/281 index 9df6154c..43534f10 100755 --- a/tests/xfs/281 +++ b/tests/xfs/281 @@ -13,7 +13,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/282 b/tests/xfs/282 index bb4975c4..3f0d8e59 100755 --- a/tests/xfs/282 +++ b/tests/xfs/282 @@ -15,7 +15,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/283 b/tests/xfs/283 index e647cef9..eab9f96b 100755 --- a/tests/xfs/283 +++ b/tests/xfs/283 @@ -15,7 +15,14 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + _cleanup_dump + cd / + rm -f $tmp.* +} # get standard environment, filters and checks . ./common/rc diff --git a/tests/xfs/287 b/tests/xfs/287 index bde15e94..8dc754a5 100755 --- a/tests/xfs/287 +++ b/tests/xfs/287 @@ -23,8 +23,8 @@ rm -f $seqres.full _cleanup() { + _cleanup_dump cd / - _scratch_unmount 2>/dev/null rm -rf $tmp.* } diff --git a/tests/xfs/296 b/tests/xfs/296 index bc190faf..e17adaa1 100755 --- a/tests/xfs/296 +++ b/tests/xfs/296 @@ -17,6 +17,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { + _cleanup_dump cd / rm -f $tmp.* } diff --git a/tests/xfs/301 b/tests/xfs/301 index 440d314b..231e4a18 100755 --- a/tests/xfs/301 +++ b/tests/xfs/301 @@ -17,6 +17,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { + _cleanup_dump cd / rm -f $tmp.* } diff --git a/tests/xfs/302 b/tests/xfs/302 index de619874..92806a23 100755 --- a/tests/xfs/302 +++ b/tests/xfs/302 @@ -17,6 +17,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { + _cleanup_dump cd / rm -f $tmp.* } 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: 10782697 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 756CC1515 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 666152BDDB for ; Sun, 27 Jan 2019 07:51:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AB822C1E3; 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=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 EFDAC2BDDB for ; Sun, 27 Jan 2019 07:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726435AbfA0HvJ (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: 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 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