aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-03-08 09:33:35 -0500
committerSteven Rostedt <rostedt@goodmis.org>2013-03-08 09:33:35 -0500
commit752d96657cf4844793ac4d62d02a0733396ef16c (patch)
tree1365b5ca270473ae8baa48253982b6a67b3057f7 /tools/testing/ktest
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
ktest: Allow tests to use different GRUB_MENUs
To save connecting and searching for a given grub menu for each test, ktest.pl will cache the grub number it found. The problem is that different tests might use a different grub menu, but ktest.pl will ignore it. Instead, have ktest.pl check if the grub menu it used to cache the content is the same as when it grabbed the menu. If not, grab it again, otherwise just return the cached value. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-xtools/testing/ktest/ktest.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 4e67d52eb3a2..7958cd4d6567 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -108,6 +108,7 @@ my $scp_to_target;
108my $scp_to_target_install; 108my $scp_to_target_install;
109my $power_off; 109my $power_off;
110my $grub_menu; 110my $grub_menu;
111my $last_grub_menu;
111my $grub_file; 112my $grub_file;
112my $grub_number; 113my $grub_number;
113my $grub_reboot; 114my $grub_reboot;
@@ -1538,7 +1539,8 @@ sub run_scp_mod {
1538 1539
1539sub get_grub2_index { 1540sub get_grub2_index {
1540 1541
1541 return if (defined($grub_number)); 1542 return if (defined($grub_number) && defined($last_grub_menu) &&
1543 $last_grub_menu eq $grub_menu);
1542 1544
1543 doprint "Find grub2 menu ... "; 1545 doprint "Find grub2 menu ... ";
1544 $grub_number = -1; 1546 $grub_number = -1;
@@ -1565,6 +1567,7 @@ sub get_grub2_index {
1565 die "Could not find '$grub_menu' in $grub_file on $machine" 1567 die "Could not find '$grub_menu' in $grub_file on $machine"
1566 if (!$found); 1568 if (!$found);
1567 doprint "$grub_number\n"; 1569 doprint "$grub_number\n";
1570 $last_grub_menu = $grub_menu;
1568} 1571}
1569 1572
1570sub get_grub_index { 1573sub get_grub_index {
@@ -1577,7 +1580,8 @@ sub get_grub_index {
1577 if ($reboot_type ne "grub") { 1580 if ($reboot_type ne "grub") {
1578 return; 1581 return;
1579 } 1582 }
1580 return if (defined($grub_number)); 1583 return if (defined($grub_number) && defined($last_grub_menu) &&
1584 $last_grub_menu eq $grub_menu);
1581 1585
1582 doprint "Find grub menu ... "; 1586 doprint "Find grub menu ... ";
1583 $grub_number = -1; 1587 $grub_number = -1;
@@ -1604,6 +1608,7 @@ sub get_grub_index {
1604 die "Could not find '$grub_menu' in /boot/grub/menu on $machine" 1608 die "Could not find '$grub_menu' in /boot/grub/menu on $machine"
1605 if (!$found); 1609 if (!$found);
1606 doprint "$grub_number\n"; 1610 doprint "$grub_number\n";
1611 $last_grub_menu = $grub_menu;
1607} 1612}
1608 1613
1609sub wait_for_input 1614sub wait_for_input