diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 16:57:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 16:57:29 -0400 |
commit | 5415ba99c229105a6939a7f9effe21045b8b2e5b (patch) | |
tree | 6fbf10cfba3e946f8011539408c843c038564e1a | |
parent | 9e8529afc4518f4e5d610001545ebc97e1333c79 (diff) | |
parent | df5f7c66013c46cec9aa8156af257bc5eb29b5c5 (diff) |
Merge tag 'ktest-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
Pull ktest update from Steven Rostedt:
"A couple of fixes to handle a config file that tests multiple machines
and has conflicts it the grub menus. That is, if the machines use the
same grub menu name, but they are at different locations in the
menu.lst file"
* tag 'ktest-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
ktest: Reset grub menu cache with different machines
ktest: Allow tests to use different GRUB_MENUs
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 4e67d52eb3a2..0d7fd8b51544 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -73,6 +73,7 @@ my $ktest_config; | |||
73 | my $version; | 73 | my $version; |
74 | my $have_version = 0; | 74 | my $have_version = 0; |
75 | my $machine; | 75 | my $machine; |
76 | my $last_machine; | ||
76 | my $ssh_user; | 77 | my $ssh_user; |
77 | my $tmpdir; | 78 | my $tmpdir; |
78 | my $builddir; | 79 | my $builddir; |
@@ -108,6 +109,7 @@ my $scp_to_target; | |||
108 | my $scp_to_target_install; | 109 | my $scp_to_target_install; |
109 | my $power_off; | 110 | my $power_off; |
110 | my $grub_menu; | 111 | my $grub_menu; |
112 | my $last_grub_menu; | ||
111 | my $grub_file; | 113 | my $grub_file; |
112 | my $grub_number; | 114 | my $grub_number; |
113 | my $grub_reboot; | 115 | my $grub_reboot; |
@@ -1538,7 +1540,9 @@ sub run_scp_mod { | |||
1538 | 1540 | ||
1539 | sub get_grub2_index { | 1541 | sub get_grub2_index { |
1540 | 1542 | ||
1541 | return if (defined($grub_number)); | 1543 | return if (defined($grub_number) && defined($last_grub_menu) && |
1544 | $last_grub_menu eq $grub_menu && defined($last_machine) && | ||
1545 | $last_machine eq $machine); | ||
1542 | 1546 | ||
1543 | doprint "Find grub2 menu ... "; | 1547 | doprint "Find grub2 menu ... "; |
1544 | $grub_number = -1; | 1548 | $grub_number = -1; |
@@ -1565,6 +1569,8 @@ sub get_grub2_index { | |||
1565 | die "Could not find '$grub_menu' in $grub_file on $machine" | 1569 | die "Could not find '$grub_menu' in $grub_file on $machine" |
1566 | if (!$found); | 1570 | if (!$found); |
1567 | doprint "$grub_number\n"; | 1571 | doprint "$grub_number\n"; |
1572 | $last_grub_menu = $grub_menu; | ||
1573 | $last_machine = $machine; | ||
1568 | } | 1574 | } |
1569 | 1575 | ||
1570 | sub get_grub_index { | 1576 | sub get_grub_index { |
@@ -1577,7 +1583,9 @@ sub get_grub_index { | |||
1577 | if ($reboot_type ne "grub") { | 1583 | if ($reboot_type ne "grub") { |
1578 | return; | 1584 | return; |
1579 | } | 1585 | } |
1580 | return if (defined($grub_number)); | 1586 | return if (defined($grub_number) && defined($last_grub_menu) && |
1587 | $last_grub_menu eq $grub_menu && defined($last_machine) && | ||
1588 | $last_machine eq $machine); | ||
1581 | 1589 | ||
1582 | doprint "Find grub menu ... "; | 1590 | doprint "Find grub menu ... "; |
1583 | $grub_number = -1; | 1591 | $grub_number = -1; |
@@ -1604,6 +1612,8 @@ sub get_grub_index { | |||
1604 | die "Could not find '$grub_menu' in /boot/grub/menu on $machine" | 1612 | die "Could not find '$grub_menu' in /boot/grub/menu on $machine" |
1605 | if (!$found); | 1613 | if (!$found); |
1606 | doprint "$grub_number\n"; | 1614 | doprint "$grub_number\n"; |
1615 | $last_grub_menu = $grub_menu; | ||
1616 | $last_machine = $machine; | ||
1607 | } | 1617 | } |
1608 | 1618 | ||
1609 | sub wait_for_input | 1619 | sub wait_for_input |