Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4516423yba; Wed, 17 Apr 2019 13:13:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyix4RHNLk65fvy6PixdEa2CmieYd1EQgDhzwGS8smct8LSEtE9OnZG+ilRUHJF4MdkmYy X-Received: by 2002:a17:902:4381:: with SMTP id j1mr27027798pld.173.1555532036296; Wed, 17 Apr 2019 13:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555532036; cv=none; d=google.com; s=arc-20160816; b=LoiQN8kaWqoulSNp10pDuR/JQyTdToVQMPx1nheNwJMMIuy2zHmMEeHREs2b5kU7iy RVQAl/xZ3U6nSzhRGTGZ5JAzshinrjaVtw+TuxivrWSz/NopxRIJqKH2kETlH0uRX8Re yFmr9Y+4SjKx5xBLE1q5FbjfaiU873tEzck9Ezl13+BMcz4TWkQ9aCUvTJZprU/aX8xn 9SyTUSXWNWSgsohVvA99MRCHl6arv8kilsS5CgNUnoqu/WvFrmU3dfvZrgcwFRrsfFs0 J6JEm/xk73g7QX+HQksvz/xR/MvM9V5GR2XVWcmco8KYEdI5afxN9kcAToPSOTAKvQUa VOcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=78vEBc9reM9YM8/f3/8CuxrOvyd7mTbu1OAcBFD8s4U=; b=gAyf7jnX53UEbdsYxIfKmKqnUz52KQ/842NsZoyI4/GJaO2VVV1rQp+fYRbXqFGFuS BLOdPRQCkq28B+J/ab6DfQWGqTr7KL/L173+Gwf2EYJaOBlCNgNThRxN83Pp4pe2c/LK hVCRzce9pc4qnm/IGygjlFMIxC1kOHQdLb7BZJ6k4k63IsHdJgtXaPhzZOMrc4pRQ41K 6F+BtZRb+o95PXaPBMkblSrxq0Gr4iVNPlCyob6QUammh1K/LY03BVNMtkxjm6SjOdVh +dtaIp2Rpl/NtUxkaXSu8td4Aft0ITFfNXc5UinntpCplrhV+GR0fJESLVm11qTHj2SI oTmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FZCgFKcn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w126si47856pfw.53.2019.04.17.13.13.41; Wed, 17 Apr 2019 13:13:56 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FZCgFKcn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731382AbfDQUMt (ORCPT + 99 others); Wed, 17 Apr 2019 16:12:49 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33604 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfDQUMt (ORCPT ); Wed, 17 Apr 2019 16:12:49 -0400 Received: by mail-qk1-f194.google.com with SMTP id k189so15180608qkc.0 for ; Wed, 17 Apr 2019 13:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=78vEBc9reM9YM8/f3/8CuxrOvyd7mTbu1OAcBFD8s4U=; b=FZCgFKcn8BCht+46g4iy7p6p8v2LOtTndu5g8Lvd6F2eQsBWHcYOM1d5DVVCItbps0 uJzaHxrOOy0pQeLnobtt/0/Nno1sKsMaLfXEIyuYwH3zbaad9Tp2xc91m/FR+alxhbA7 uQC4OXOHVatTx2d9lpqYWa61pNY3zKVsYSMpc/K42MKjPLKcREDg4gw7mHMobLKJCT3G nZxnmwAULwrvIsEVvdfpkWwWzVwnYqoaBDs111blw/Iq6KyQFcYR1E07BJiFl29UGOu8 NElX0XQ5nkParhm5uNdgaCU66VtBqkpsstP3SdyNg99BF9ySsZFysxQ3dlTKvzrGf/Ck Bm9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=78vEBc9reM9YM8/f3/8CuxrOvyd7mTbu1OAcBFD8s4U=; b=Atw5SiO4ujEUgH1MO1WB6lGAyzfjsDV6C0dx7I5Vplr/fw1e2JA4zfmIAAiJsMo0AV UKalPdnUgQcfIC1sWfiI4N2RZBno2dCC11VjvDuUZBOUiwhfAGx3YNHayCskaiE2nolA S8wrhd1avJrpNOwwC5D0QdN8sZ0iA5yiHMQOuc8uVe7ltu9MONcqSmden3Co8mQrcI+a YTQhEnmgKiPNKfg5g+6d9VOqymKyxciPQtAY4kGOkQC9P1SMW6JLxjvUki4HNVwYZcCG 7xxh9EFK+Hy3cyOwVJXGZCg4bBs5qwrAEgRZSSpI67s9x2SlrJ8cX/jOLNPaDGJDfVdE I+IQ== X-Gm-Message-State: APjAAAVOxWx0S2Cg+JUZvPXvu32qLSDj33E+bL9RwNmEfUfrpaZvoZ0j /tL63AfWgeG8nhGOiSKYpg== X-Received: by 2002:a37:c15:: with SMTP id 21mr67837665qkm.50.1555531968203; Wed, 17 Apr 2019 13:12:48 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id v8sm35659259qtc.69.2019.04.17.13.12.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 13:12:47 -0700 (PDT) From: Masayoshi Mizuma To: Steven Rostedt Cc: Masayoshi Mizuma , Masayoshi Mizuma , linux-kernel@vger.kernel.org Subject: [PATCH] ktest: Add support for meta characters in GRUB_MENU Date: Wed, 17 Apr 2019 16:11:14 -0400 Message-Id: <20190417201114.14839-1-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masayoshi Mizuma ktest fails if meta characters are in GRUB_MENU, for example GRUB_MENU = 'Fedora (test)' 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); 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; -- 2.20.1