From patchwork Thu Nov 16 01:22:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10060551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF25160230 for ; Thu, 16 Nov 2017 01:22:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E14B32A45E for ; Thu, 16 Nov 2017 01:22:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5F712A466; Thu, 16 Nov 2017 01:22:31 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 5FE872A463 for ; Thu, 16 Nov 2017 01:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933185AbdKPBWa (ORCPT ); Wed, 15 Nov 2017 20:22:30 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49055 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932650AbdKPBWa (ORCPT ); Wed, 15 Nov 2017 20:22:30 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAG1MR5m021374 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 01:22:28 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAG1MR1D014440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 01:22:27 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vAG1MQTT028939; Thu, 16 Nov 2017 01:22:26 GMT Received: from localhost (/73.25.142.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 15 Nov 2017 17:22:26 -0800 Subject: [PATCH 1/5] common/fuzzy: if the fuzz verb is random, keep fuzzing until we get a new value From: "Darrick J. Wong" To: eguan@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Wed, 15 Nov 2017 17:22:25 -0800 Message-ID: <151079534548.25590.4625031168242667972.stgit@magnolia> In-Reply-To: <151079533937.25590.1037061486182471724.stgit@magnolia> References: <151079533937.25590.1037061486182471724.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong If the fuzz verb is 'random', keep generating new random values until we get one that is distinct from the previous value. Signed-off-by: Darrick J. Wong --- common/fuzzy | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/fuzzy b/common/fuzzy index b9c7399..390f91f 100644 --- a/common/fuzzy +++ b/common/fuzzy @@ -179,9 +179,14 @@ _scratch_xfs_fuzz_metadata_field() { for arg in "$@"; do cmds+=("-c" "${arg}") done - _scratch_xfs_db -x "${cmds[@]}" -c "fuzz ${fuzz_arg} ${key} ${value}" - echo - newval="$(_scratch_xfs_get_metadata_field "${key}" "$@" 2> /dev/null)" + while true; do + _scratch_xfs_db -x "${cmds[@]}" -c "fuzz ${fuzz_arg} ${key} ${value}" + echo + newval="$(_scratch_xfs_get_metadata_field "${key}" "$@" 2> /dev/null)" + if [ "${key}" != "random" ] || [ "${oldval}" != "${newval}" ]; then + break; + fi + done if [ "${oldval}" = "${newval}" ]; then echo "Field ${key} already set to ${newval}, skipping test." return 1