public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] [GIT PULL] ktest: Updates for v3.10
@ 2013-04-29 13:39 Steven Rostedt
  2013-04-29 13:39 ` [PATCH 1/2] ktest: Allow tests to use different GRUB_MENUs Steven Rostedt
  2013-04-29 13:39 ` [PATCH 2/2] ktest: Reset grub menu cache with different machines Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Rostedt @ 2013-04-29 13:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]


Linus,

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.

Please pull the latest ktest-v3.10 tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
ktest-v3.10

Head SHA1: 66566ce651763c542ef4e420335148ebe9dbc082


Steven Rostedt (Red Hat) (2):
      ktest: Allow tests to use different GRUB_MENUs
      ktest: Reset grub menu cache with different machines

----
 tools/testing/ktest/ktest.pl |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] ktest: Allow tests to use different GRUB_MENUs
  2013-04-29 13:39 [PATCH 0/2] [GIT PULL] ktest: Updates for v3.10 Steven Rostedt
@ 2013-04-29 13:39 ` Steven Rostedt
  2013-04-29 13:39 ` [PATCH 2/2] ktest: Reset grub menu cache with different machines Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2013-04-29 13:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

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>
---
 tools/testing/ktest/ktest.pl |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 4e67d52..7958cd4 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -108,6 +108,7 @@ my $scp_to_target;
 my $scp_to_target_install;
 my $power_off;
 my $grub_menu;
+my $last_grub_menu;
 my $grub_file;
 my $grub_number;
 my $grub_reboot;
@@ -1538,7 +1539,8 @@ sub run_scp_mod {
 
 sub get_grub2_index {
 
-    return if (defined($grub_number));
+    return if (defined($grub_number) && defined($last_grub_menu) &&
+	       $last_grub_menu eq $grub_menu);
 
     doprint "Find grub2 menu ... ";
     $grub_number = -1;
@@ -1565,6 +1567,7 @@ sub get_grub2_index {
     die "Could not find '$grub_menu' in $grub_file on $machine"
 	if (!$found);
     doprint "$grub_number\n";
+    $last_grub_menu = $grub_menu;
 }
 
 sub get_grub_index {
@@ -1577,7 +1580,8 @@ sub get_grub_index {
     if ($reboot_type ne "grub") {
 	return;
     }
-    return if (defined($grub_number));
+    return if (defined($grub_number) && defined($last_grub_menu) &&
+	       $last_grub_menu eq $grub_menu);
 
     doprint "Find grub menu ... ";
     $grub_number = -1;
@@ -1604,6 +1608,7 @@ sub get_grub_index {
     die "Could not find '$grub_menu' in /boot/grub/menu on $machine"
 	if (!$found);
     doprint "$grub_number\n";
+    $last_grub_menu = $grub_menu;
 }
 
 sub wait_for_input
-- 
1.7.10.4



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ktest: Reset grub menu cache with different machines
  2013-04-29 13:39 [PATCH 0/2] [GIT PULL] ktest: Updates for v3.10 Steven Rostedt
  2013-04-29 13:39 ` [PATCH 1/2] ktest: Allow tests to use different GRUB_MENUs Steven Rostedt
@ 2013-04-29 13:39 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2013-04-29 13:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 1928 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

Different tests may use a different machine. In such cases, we need to
try to get the current grub menu index. If the same grub menu is used
for two different machines, it may not be at the same index on the
second machine. A search for the index must be performed again.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 7958cd4..0d7fd8b 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -73,6 +73,7 @@ my $ktest_config;
 my $version;
 my $have_version = 0;
 my $machine;
+my $last_machine;
 my $ssh_user;
 my $tmpdir;
 my $builddir;
@@ -1540,7 +1541,8 @@ sub run_scp_mod {
 sub get_grub2_index {
 
     return if (defined($grub_number) && defined($last_grub_menu) &&
-	       $last_grub_menu eq $grub_menu);
+	       $last_grub_menu eq $grub_menu && defined($last_machine) &&
+	       $last_machine eq $machine);
 
     doprint "Find grub2 menu ... ";
     $grub_number = -1;
@@ -1568,6 +1570,7 @@ sub get_grub2_index {
 	if (!$found);
     doprint "$grub_number\n";
     $last_grub_menu = $grub_menu;
+    $last_machine = $machine;
 }
 
 sub get_grub_index {
@@ -1581,7 +1584,8 @@ sub get_grub_index {
 	return;
     }
     return if (defined($grub_number) && defined($last_grub_menu) &&
-	       $last_grub_menu eq $grub_menu);
+	       $last_grub_menu eq $grub_menu && defined($last_machine) &&
+	       $last_machine eq $machine);
 
     doprint "Find grub menu ... ";
     $grub_number = -1;
@@ -1609,6 +1613,7 @@ sub get_grub_index {
 	if (!$found);
     doprint "$grub_number\n";
     $last_grub_menu = $grub_menu;
+    $last_machine = $machine;
 }
 
 sub wait_for_input
-- 
1.7.10.4



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-29 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 13:39 [PATCH 0/2] [GIT PULL] ktest: Updates for v3.10 Steven Rostedt
2013-04-29 13:39 ` [PATCH 1/2] ktest: Allow tests to use different GRUB_MENUs Steven Rostedt
2013-04-29 13:39 ` [PATCH 2/2] ktest: Reset grub menu cache with different machines Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox