From patchwork Mon Jul 29 18:55:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2835113 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D1BBF9F4D4 for ; Mon, 29 Jul 2013 18:56:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B92CE20383 for ; Mon, 29 Jul 2013 18:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 866E02013C for ; Mon, 29 Jul 2013 18:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751635Ab3G2S4A (ORCPT ); Mon, 29 Jul 2013 14:56:00 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:58830 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750918Ab3G2Sz7 (ORCPT ); Mon, 29 Jul 2013 14:55:59 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 5D6C39A0403 for ; Mon, 29 Jul 2013 12:55:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1375124159; bh=QTOxs06CQDzbZkNKAVn5R8U9nbAL2vf1E6UwPjaxspc=; h=From:To:Subject:Date; b=nTprhO3XVimf4aViryn/U623AsQ58FUp5nt228Tqtw3NDNxkpJCliVFkB5ccZ4VKh RF3mVB6O4dHo5x7Wbj5JC+2M13aMBqdJCr4mbtsSQ73RrlIRCNyV+9+J0fOR8dIMfn /2W2Ni8uHakQPMzafHuThw1P09Mq8qBmHC/0VCj8= X-ASG-Debug-ID: 1375124158-03d6a577cb3c4880001-6jHSXT Received: from CAS1.int.fusionio.com (cas1.int.fusionio.com [10.101.1.40]) by mx1.fusionio.com with ESMTP id qItPe5zMZQpJwJO0 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Mon, 29 Jul 2013 12:55:58 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (10.101.1.160) by mail.fusionio.com (10.101.1.40) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 29 Jul 2013 12:55:58 -0600 From: Josef Bacik To: , , , Subject: [PATCH] xfstests: generic/315: allow a little tolerance for our used check Date: Mon, 29 Jul 2013 14:55:56 -0400 X-ASG-Orig-Subj: [PATCH] xfstests: generic/315: allow a little tolerance for our used check Message-ID: <1375124156-17620-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-Originating-IP: [10.101.1.160] X-Barracuda-Connect: cas1.int.fusionio.com[10.101.1.40] X-Barracuda-Start-Time: 1375124158 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Bayes: INNOCENT GLOBAL 0.0717 1.0000 -1.5649 X-Barracuda-Spam-Score: -0.96 X-Barracuda-Spam-Status: No, SCORE=-0.96 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.137413 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP So df in btrfs is tricky at best, and relying on it for accurate information is not great, but it's the best way to verify this test. To get around btrfs being inconsistent sometimes just use _within_tolerance to check our new df value to make sure that our truncate did something. With this patch I no longer see transient failures of this test. Thanks, Signed-off-by: Josef Bacik Reviewed-by: Jie Liu --- tests/generic/315 | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tests/generic/315 b/tests/generic/315 index 7cfc40d..9c01b5e 100644 --- a/tests/generic/315 +++ b/tests/generic/315 @@ -73,7 +73,8 @@ sync # Preallocated disk space should be released avail_done=`df -P $TEST_DIR | awk 'END {print $4}'` -[ "$avail_done" -eq "$avail_begin" ] || _fail "Available disk space ($avail_done KiB)" +_within_tolerance "df" $avail_done $avail_begin 1% +[ $? -eq 0 ] || _fail "Available disk space ($avail_done KiB) wanted ($avail_begin KiB)" # success, all done exit