Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4520488yba; Wed, 17 Apr 2019 13:18:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyc8a+iYKH8a+haSus4qvP/8VOoyPEmev79vxxEevimG3naPej9hjUkN9yo0IwZMii1oc8X X-Received: by 2002:a62:52c3:: with SMTP id g186mr91873757pfb.173.1555532325525; Wed, 17 Apr 2019 13:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555532325; cv=none; d=google.com; s=arc-20160816; b=qSbByh9uzuzq1C7BQpa9Vb/3LZTxDyB/Qc2Vi1MHdOg8+m520SmFgG8B6nidPfTOFR mFt3BAH6PXSnPfdRKmx2vTcYHHKNd/bygHFTawdTMxYNuCnunpiEe1T2AOKfRrG0Gpb+ xh5dsfv5DuzpSmI8WVRyvPtwWSnk7sIdlM1Wsl1T6Xw0etijLBj3OCZjYon8pIkUsy3w 7rbbXOwFB06Dw8/Vm4DeyazhQ732pSO4uvxcYpe0xVuik4jR3WUXoN2L+ybcaeYTp8gL fVTRCQ5stcnhr92u5dVC1hOeFgukGHv0IJX61AuRjua8Pe45FCI7zvAY+5m37zJ7ErUd ZmJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=MJa2SIKpZRKKehK1gNw+VkBBO1lY21+bu8NGUXXrhro=; b=giXi1Vzxo/3VF6Pdbb6zUbUEP2Ol6wD8EQ0mPPA4JROjOLZqafB9xC01StdNYnG40F VtqIwcy4sdVFc3MEygOz9QSmRvXy8gnj82s8a0Mo7Pzsfv6vy/PTDWH3inF9Py1YOjIy 6RyCCp0HGGsDsvTsJIcF5ehRPcF3WCB+feSn3U5qV0MV2UqkFLkVfiSQOIm0+OvhqOLu qLiiSqIUg2sWk7adMCKzQEP0OjGtWb3tIP3UaInoGa9/Tut8KKW5fsjQA/R60cohaneC SOzDtRitV6dxFDrhGk1e9omJp/1Ovm4HMmXlIKG96k2swfr65aGg5ItgfeOuvqReNYEY G5Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si51185581pgd.166.2019.04.17.13.18.30; Wed, 17 Apr 2019 13:18:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732634AbfDQURl (ORCPT + 99 others); Wed, 17 Apr 2019 16:17:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:39812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727340AbfDQURl (ORCPT ); Wed, 17 Apr 2019 16:17:41 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BAAF720651; Wed, 17 Apr 2019 20:17:40 +0000 (UTC) Date: Wed, 17 Apr 2019 16:17:39 -0400 From: Steven Rostedt To: Masayoshi Mizuma Cc: Masayoshi Mizuma , linux-kernel@vger.kernel.org Subject: Re: [PATCH] ktest: Add support for meta characters in GRUB_MENU Message-ID: <20190417161739.7046d028@gandalf.local.home> In-Reply-To: <20190417201114.14839-1-msys.mizuma@gmail.com> References: <20190417201114.14839-1-msys.mizuma@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Apr 2019 16:11:14 -0400 Masayoshi Mizuma wrote: > From: Masayoshi Mizuma > > ktest fails if meta characters are in GRUB_MENU, for example > GRUB_MENU = 'Fedora (test)' > Thanks for the patch! One little nit below though. > The failure happens because the meta characters are not escaped, > so the menu doesn't match in any entries in GRUB_FILE. > > Use quotameta() to escape the meta characters. > > Signed-off-by: Masayoshi Mizuma > --- > tools/testing/ktest/ktest.pl | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl > index 87af8a68ab25..ea07d43856b8 100755 > --- a/tools/testing/ktest/ktest.pl > +++ b/tools/testing/ktest/ktest.pl > @@ -1866,9 +1866,10 @@ sub get_grub2_index { > or dodie "unable to get $grub_file"; > > my $found = 0; > + my $_grub_menu = quotemeta($grub_menu); I'd like to avoid names that start with underscore. Could you call this: $grub_menu_qt or something similar, to be a bit more descriptive of what the variable is. Thanks! -- Steve > > while () { > - if (/^menuentry.*$grub_menu/) { > + if (/^menuentry.*$_grub_menu/) { > $grub_number++; > $found = 1; > last; > @@ -1909,9 +1910,10 @@ sub get_grub_index { > or dodie "unable to get menu.lst"; > > my $found = 0; > + my $_grub_menu = quotemeta($grub_menu); > > while () { > - if (/^\s*title\s+$grub_menu\s*$/) { > + if (/^\s*title\s+$_grub_menu\s*$/) { > $grub_number++; > $found = 1; > last;