From patchwork Fri Nov 14 13:27:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 5305921 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 78990C11AC for ; Fri, 14 Nov 2014 13:29:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B18122017D for ; Fri, 14 Nov 2014 13:29:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE64220145 for ; Fri, 14 Nov 2014 13:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933794AbaKNN3M (ORCPT ); Fri, 14 Nov 2014 08:29:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46953 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935253AbaKNN3M (ORCPT ); Fri, 14 Nov 2014 08:29:12 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAEDT9HV011088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2014 08:29:10 -0500 Received: from jtulak.redhat.com (ovpn-112-57.ams2.redhat.com [10.36.112.57]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAEDT1KM016807; Fri, 14 Nov 2014 08:29:07 -0500 From: =?UTF-8?q?Jan=20=C5=A4ul=C3=A1k?= To: fstests@vger.kernel.org Cc: =?UTF-8?q?Jan=20=C5=A4ul=C3=A1k?= , lczerner@redhat.com, david@fromorbit.com Subject: [PATCH 4/7] get_group_list changed to more universal get_list_from_file Date: Fri, 14 Nov 2014 14:27:44 +0100 Message-Id: <1415971667-16873-4-git-send-email-jtulak@redhat.com> In-Reply-To: <1415971667-16873-1-git-send-email-jtulak@redhat.com> References: <1415971667-16873-1-git-send-email-jtulak@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This patch changes name of get_group_list and adds one argument to make it useful not only for groups, but also for environments. It works the same, just it takes the file name as an argument instead of hardcoded 'group'. Signed-off-by: Jan ?ulák --- check | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/check b/check index a246d92..bdfd877 100755 --- a/check +++ b/check @@ -88,12 +88,15 @@ testlist options exit 0 } -get_group_list() +# Get all tests tagged with specified group/environment +# from a specified file. +get_list_from_file() { grp=$1 + file=$2 for d in $SRC_GROUPS $FSTYP; do - l=$(sed -n < $SRC_DIR/$d/group \ + l=$(sed -n < $SRC_DIR/$d/$file \ -e 's/#.*//' \ -e 's/$/ /' \ -e "s;\(^[0-9][0-9][0-9]\).* $grp .*;$SRC_DIR/$d/\1;p") @@ -162,7 +165,7 @@ _prepare_test_list() # Specified groups to include for group in $GROUP_LIST; do - list=$(get_group_list $group) + list=$(get_list_from_file $group "group") if [ -z "$list" ]; then echo "Group \"$group\" is empty or not defined?" exit 1 @@ -181,7 +184,7 @@ _prepare_test_list() # Specified groups to exclude for xgroup in $XGROUP_LIST; do - list=$(get_group_list $xgroup) + list=$(get_list_from_file $xgroup "group") if [ -z "$list" ]; then echo "Group \"$xgroup\" is empty or not defined?" exit 1