diff options
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index debc6898e60b..ca6ff99ab1a5 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -862,9 +862,12 @@ sub get_grub_index { | |||
862 | open(IN, "$ssh_grub |") | 862 | open(IN, "$ssh_grub |") |
863 | or die "unable to get menu.lst"; | 863 | or die "unable to get menu.lst"; |
864 | 864 | ||
865 | my $found = 0; | ||
866 | |||
865 | while (<IN>) { | 867 | while (<IN>) { |
866 | if (/^\s*title\s+$grub_menu\s*$/) { | 868 | if (/^\s*title\s+$grub_menu\s*$/) { |
867 | $grub_number++; | 869 | $grub_number++; |
870 | $found = 1; | ||
868 | last; | 871 | last; |
869 | } elsif (/^\s*title\s/) { | 872 | } elsif (/^\s*title\s/) { |
870 | $grub_number++; | 873 | $grub_number++; |
@@ -873,7 +876,7 @@ sub get_grub_index { | |||
873 | close(IN); | 876 | close(IN); |
874 | 877 | ||
875 | die "Could not find '$grub_menu' in /boot/grub/menu on $machine" | 878 | die "Could not find '$grub_menu' in /boot/grub/menu on $machine" |
876 | if ($grub_number < 0); | 879 | if (!$found); |
877 | doprint "$grub_number\n"; | 880 | doprint "$grub_number\n"; |
878 | } | 881 | } |
879 | 882 | ||