From: Masayoshi Mizuma <msys.mizuma@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masayoshi Mizuma <msys.mizuma@gmail.com>,
Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/6] ktest: introduce _get_grub_index
Date: Thu, 9 May 2019 17:36:42 -0400 [thread overview]
Message-ID: <20190509213647.6276-2-msys.mizuma@gmail.com> (raw)
In-Reply-To: <20190509213647.6276-1-msys.mizuma@gmail.com>
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Introduce _get_grub_index() to deal with Boot Loader
Specification (BLS) and cleanup.
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
---
tools/testing/ktest/ktest.pl | 37 ++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 275ad8ac8872..43868ee07e17 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1871,6 +1871,43 @@ sub run_scp_mod {
return run_scp($src, $dst, $cp_scp);
}
+sub _get_grub_index {
+
+ my ($command, $target, $skip) = @_;
+
+ return if (defined($grub_number) && defined($last_grub_menu) &&
+ $last_grub_menu eq $grub_menu && defined($last_machine) &&
+ $last_machine eq $machine);
+
+ doprint "Find $reboot_type menu ... ";
+ $grub_number = -1;
+
+ my $ssh_grub = $ssh_exec;
+ $ssh_grub =~ s,\$SSH_COMMAND,$command,g;
+
+ open(IN, "$ssh_grub |")
+ or dodie "unable to execute $command";
+
+ my $found = 0;
+
+ while (<IN>) {
+ if (/$target/) {
+ $grub_number++;
+ $found = 1;
+ last;
+ } elsif (/$skip/) {
+ $grub_number++;
+ }
+ }
+ close(IN);
+
+ dodie "Could not find '$grub_menu' through $command on $machine"
+ if (!$found);
+ doprint "$grub_number\n";
+ $last_grub_menu = $grub_menu;
+ $last_machine = $machine;
+}
+
sub get_grub2_index {
return if (defined($grub_number) && defined($last_grub_menu) &&
--
2.20.1
next prev parent reply other threads:[~2019-05-09 21:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 21:36 [PATCH v2 0/6] ktest: support for Boot Loader Specification Masayoshi Mizuma
2019-05-09 21:36 ` Masayoshi Mizuma [this message]
2019-05-09 21:36 ` [PATCH v2 2/6] ktest: cleanup get_grub_index Masayoshi Mizuma
2019-05-09 21:36 ` [PATCH v2 3/6] ktest: introduce grub2bls REBOOT_TYPE option Masayoshi Mizuma
2019-05-09 21:36 ` [PATCH v2 4/6] ktest: pass KERNEL_VERSION to POST_KTEST Masayoshi Mizuma
2019-05-09 21:36 ` [PATCH v2 5/6] ktest: remove get_grub2_index Masayoshi Mizuma
2019-05-09 21:36 ` [PATCH v2 6/6] ktest: update sample.conf for grub2bls Masayoshi Mizuma
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=20190509213647.6276-2-msys.mizuma@gmail.com \
--to=msys.mizuma@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.mizuma@jp.fujitsu.com \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®