From patchwork Wed Mar 20 00:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10860611 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 929F515AC for ; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1B528500 for ; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 627352998B; Wed, 20 Mar 2019 00:44:53 +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,MAILING_LIST_MULTI,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 1006228500 for ; Wed, 20 Mar 2019 00:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727157AbfCTAow (ORCPT ); Tue, 19 Mar 2019 20:44:52 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57096 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfCTAow (ORCPT ); Tue, 19 Mar 2019 20:44:52 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2K0crv1008307; Wed, 20 Mar 2019 00:44:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=4QcHAOVrcakXX/EXLdKSmdiDx4DvRguz2z3xlKuIZPY=; b=WWJDC9joUFCVDMd4KIsV52TMhPHsWFuY3sRlu3uloovacCFFf6SW+GIAPYddZ7ME/bsD TYMduBGPSUQhZrAj2czd/x4Bl57qFzNANKUq/bJnjWU0wKMRQfx3/O4IVjkc25er3WF3 xcIZxuAyChCKgJ7EstW724cgjI44HAKuBSUvkAm0BrlTfJ54TFMjwf7usL8atukOxSkh 5lwCtZgv02re900by9dixkdvwB7cna2v9q2k/+0aMHNRBiV5Qr8TPHFQ6kJzsA98+oEb tA64xgbwJjatfij2QNU/Qp+L0BrammxD176j/LNGa6i0n2soCFt8yxWzff1KFAJkF38I 6w== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2r8pner3wg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:50 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2K0inDs019440 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 00:44:49 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2K0inqX003665; Wed, 20 Mar 2019 00:44:49 GMT Received: from localhost (/10.159.245.168) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Mar 2019 17:44:48 -0700 Subject: [PATCH 02/12] check: really improve test list randomization From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 19 Mar 2019 17:44:49 -0700 Message-ID: <155304268908.31707.9639554348139720057.stgit@magnolia> In-Reply-To: <155304267647.31707.14180452399822113095.stgit@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9200 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=940 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903200003 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 coreutils provides the shuf(1) utility that randomizes the order of a list and seeds its random number generator with /dev/urandom. It's a bit speedier than awk, so use it if available. Signed-off-by: Darrick J. Wong --- check | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check b/check index ecd1d39a..a2c5ba21 100755 --- a/check +++ b/check @@ -243,7 +243,11 @@ _prepare_test_list() # sort the list of tests into numeric order if $randomize; then - sorter="awk -v seed=$RANDOM -f randomize.awk" + if type shuf >& /dev/null; then + sorter="shuf" + else + sorter="awk -v seed=$RANDOM -f randomize.awk" + fi else sorter="cat" fi