aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest/ktest.pl
diff options
context:
space:
mode:
authorMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>2019-04-17 19:58:23 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-04-17 22:36:30 -0400
commit68911069f509ba3bf0f513d9af00309e07932906 (patch)
treea0bc5f05cdd38d4b8a357e6887c483f6a09e5b90 /tools/testing/ktest/ktest.pl
parentktest: Show name and iteration on errors (diff)
downloadlinux-dev-68911069f509ba3bf0f513d9af00309e07932906.tar.xz
linux-dev-68911069f509ba3bf0f513d9af00309e07932906.zip
ktest: Add support for meta characters in GRUB_MENU
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 quotemeta() to escape the meta characters. Link: http://lkml.kernel.org/r/20190417235823.18176-1-msys.mizuma@gmail.com Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest/ktest.pl')
-rwxr-xr-xtools/testing/ktest/ktest.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 75f8cecdd549..3bec099a6cf4 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1878,9 +1878,10 @@ sub get_grub2_index {
or dodie "unable to get $grub_file";
my $found = 0;
+ my $grub_menu_qt = quotemeta($grub_menu);
while (<IN>) {
- if (/^menuentry.*$grub_menu/) {
+ if (/^menuentry.*$grub_menu_qt/) {
$grub_number++;
$found = 1;
last;
@@ -1921,9 +1922,10 @@ sub get_grub_index {
or dodie "unable to get menu.lst";
my $found = 0;
+ my $grub_menu_qt = quotemeta($grub_menu);
while (<IN>) {
- if (/^\s*title\s+$grub_menu\s*$/) {
+ if (/^\s*title\s+$grub_menu_qt\s*$/) {
$grub_number++;
$found = 1;
last;