From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 1/2] ktest: Allow tests to use different GRUB_MENUs
Date: Mon, 29 Apr 2013 09:39:40 -0400 [thread overview]
Message-ID: <20130429134016.228713678@goodmis.org> (raw)
In-Reply-To: 20130429133939.352003598@goodmis.org
[-- 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 --]
next prev parent reply other threads:[~2013-04-29 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 13:39 [PATCH 0/2] [GIT PULL] ktest: Updates for v3.10 Steven Rostedt
2013-04-29 13:39 ` Steven Rostedt [this message]
2013-04-29 13:39 ` [PATCH 2/2] ktest: Reset grub menu cache with different machines Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130429134016.228713678@goodmis.org \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.