Re: [GIT PULL] ktest: Updates for 5.2

2019-05-15 Thread Linus Torvalds
On Wed, May 15, 2019 at 10:56 AM Steven Rostedt  wrote:
>
> Updates to ktest.pl

Your pull request is showing stale data.

>  - Handle meta data in GRUB_MENU
>
>  - Add variable to cusomize what return value the reboot code should return.

These were already long merged, from your first pull request last Monday.

See

  68253e718c27 ("Merge tag 'ktest-v5.1' of
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest")

and your own pull request

  Message-ID: <20190506133837.55832...@gandalf.local.home>

Hmm?

Linus


Re: [GIT PULL] ktest: Updates for 5.2

2019-05-15 Thread pr-tracker-bot
The pull request you sent on Wed, 15 May 2019 13:56:02 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git 
> ktest-v5.2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/b06ed1e7a2fa9b636f368a9e97c3c8877623f8b2

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


Re: [GIT PULL] ktest: Updates for 5.2

2019-05-15 Thread Steven Rostedt
On Wed, 15 May 2019 16:45:31 -0700
Linus Torvalds  wrote:

> On Wed, May 15, 2019 at 10:56 AM Steven Rostedt  wrote:
> >
> > Updates to ktest.pl  
> 
> Your pull request is showing stale data.
> 
> >  - Handle meta data in GRUB_MENU
> >
> >  - Add variable to cusomize what return value the reboot code should 
> > return.  
> 
> These were already long merged, from your first pull request last Monday.

Bah! I forgot that I did that. I even saw the tag I sent you last time
and that didn't even hit to me that I already sent these.

I do a short log on what I plan on sending and write up the change log
based on this.

I should have done a commit diff on your upstream tree and not just
base my pull request on where I started with your tree.

> 
> See
> 
>   68253e718c27 ("Merge tag 'ktest-v5.1' of
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest")
> 
> and your own pull request
> 
>   Message-ID: <20190506133837.55832...@gandalf.local.home>
> 

Yeah, do you want me to make a new message, where it doesn't repeat the
previous pull? It will still have the same sha1 head, as nothing should
have changed, as its based on the same commit as that last pull.

-- Steve


[GIT PULL] ktest: Updates for 5.2

2019-05-15 Thread Steven Rostedt


Linus,

Updates to ktest.pl

 - Handle meta data in GRUB_MENU

 - Add variable to cusomize what return value the reboot code should return.

 - Add support for grub2bls boot loader

 - Show name and test iteration number in error message sent in mail

 - Minor fixes and clean ups


Please pull the latest ktest-v5.2 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
ktest-v5.2

Tag SHA1: dc82a4cd3af167da18747d7029afdb81c11e5fe9
Head SHA1: d20f6b41b7c2715b3d900f2da02029dbc14cd60a


Masayoshi Mizuma (8):
  ktest: Add support for meta characters in GRUB_MENU
  ktest: introduce REBOOT_RETURN_CODE to confirm the result of REBOOT
  ktest: introduce _get_grub_index
  ktest: cleanup get_grub_index
  ktest: introduce grub2bls REBOOT_TYPE option
  ktest: pass KERNEL_VERSION to POST_KTEST
  ktest: remove get_grub2_index
  ktest: update sample.conf for grub2bls

Steven Rostedt (VMware) (1):
  ktest: Show name and iteration on errors


 tools/testing/ktest/ktest.pl| 122 
 tools/testing/ktest/sample.conf |  24 +++-
 2 files changed, 95 insertions(+), 51 deletions(-)
---
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 87af8a68ab25..4711f57e809a 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -58,11 +58,13 @@ my %default = (
 "SCP_TO_TARGET"=> "scp \$SRC_FILE 
\$SSH_USER\@\$MACHINE:\$DST_FILE",
 "SCP_TO_TARGET_INSTALL"=> "\${SCP_TO_TARGET}",
 "REBOOT"   => "ssh \$SSH_USER\@\$MACHINE reboot",
+"REBOOT_RETURN_CODE"   => 255,
 "STOP_AFTER_SUCCESS"   => 10,
 "STOP_AFTER_FAILURE"   => 60,
 "STOP_TEST_AFTER"  => 600,
 "MAX_MONITOR_WAIT" => 1800,
 "GRUB_REBOOT"  => "grub2-reboot",
+"GRUB_BLS_GET" => "grubby --info=ALL",
 "SYSLINUX" => "extlinux",
 "SYSLINUX_PATH"=> "/boot/extlinux",
 "CONNECT_TIMEOUT"  => 25,
@@ -105,6 +107,7 @@ my $reboot_type;
 my $reboot_script;
 my $power_cycle;
 my $reboot;
+my $reboot_return_code;
 my $reboot_on_error;
 my $switch_to_good;
 my $switch_to_test;
@@ -123,6 +126,7 @@ my $last_grub_menu;
 my $grub_file;
 my $grub_number;
 my $grub_reboot;
+my $grub_bls_get;
 my $syslinux;
 my $syslinux_path;
 my $syslinux_label;
@@ -278,6 +282,7 @@ my %option_map = (
 "POST_BUILD_DIE"   => \$post_build_die,
 "POWER_CYCLE"  => \$power_cycle,
 "REBOOT"   => \$reboot,
+"REBOOT_RETURN_CODE"   => \$reboot_return_code,
 "BUILD_NOCLEAN"=> \$noclean,
 "MIN_CONFIG"   => \$minconfig,
 "OUTPUT_MIN_CONFIG"=> \$output_minconfig,
@@ -292,6 +297,7 @@ my %option_map = (
 "GRUB_MENU"=> \$grub_menu,
 "GRUB_FILE"=> \$grub_file,
 "GRUB_REBOOT"  => \$grub_reboot,
+"GRUB_BLS_GET" => \$grub_bls_get,
 "SYSLINUX" => \$syslinux,
 "SYSLINUX_PATH"=> \$syslinux_path,
 "SYSLINUX_LABEL"   => \$syslinux_label,
@@ -437,7 +443,7 @@ EOF
 ;
 $config_help{"REBOOT_TYPE"} = << "EOF"
  Way to reboot the box to the test kernel.
- Only valid options so far are "grub", "grub2", "syslinux", and "script".
+ Only valid options so far are "grub", "grub2", "grub2bls", "syslinux", and 
"script".
 
  If you specify grub, it will assume grub version 1
  and will search in /boot/grub/menu.lst for the title \$GRUB_MENU
@@ -451,6 +457,8 @@ $config_help{"REBOOT_TYPE"} = << "EOF"
  If you specify grub2, then you also need to specify both \$GRUB_MENU
  and \$GRUB_FILE.
 
+ If you specify grub2bls, then you also need to specify \$GRUB_MENU.
+
  If you specify syslinux, then you may use SYSLINUX to define the syslinux
  command (defaults to extlinux), and SYSLINUX_PATH to specify the path to
  the syslinux install (defaults to /boot/extlinux). But you have to specify
@@ -476,6 +484,9 @@ $config_help{"GRUB_MENU"} = << "EOF"
  menu must be a non-nested menu. Add the quotes used in the menu
  to guarantee your selection, as the first menuentry with the content
  of \$GRUB_MENU that is found will be used.
+
+ For grub2bls, \$GRUB_MENU is searched on the result of \$GRUB_BLS_GET
+ command for the lines that begin with "title".
 EOF
 ;
 $config_help{"GRUB_FILE"} = << "EOF"
@@ -692,7 +703,7 @@ sub get_mandatory_configs {
}
 }
 
-if ($rtype eq "grub") {
+if (($rtype eq "grub") or ($rtype eq "grub2bls")) {
get_mandatory_config("GRUB_MENU");
 }
 
@@ -1437,16 +1448,27 @@ sub do_not_reboot {
 
 my $in_die = 0;
 
+sub get_test_name() {
+my $name;
+
+if (defined($test_name)) {
+   $name = "$test_name:$test_type";
+} else {
+   $name = $test_type;
+}
+return $name;
+}
+
 sub dodie {
 

Re: [GIT PULL] ktest: Updates for 5.2

2019-05-07 Thread pr-tracker-bot
The pull request you sent on Mon, 6 May 2019 13:38:37 -0400:

> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git 
> ktest-v5.1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/68253e718c2778427db451e39a8366aa49982b71

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[GIT PULL] ktest: Updates for 5.2

2019-05-06 Thread Steven Rostedt


Linus,

Minor updates to ktest.pl

 - Handle meta characters in grub memu
 - Use configurable reboot return code for handling ssh reboots
 - Display names and iteration number on error message


Please pull the latest ktest-v5.1 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
ktest-v5.1

Tag SHA1: 32cb828776e96e89268929a200aee24ea9a11a9e
Head SHA1: 37e1677330bdc2e96e70f18701e589876f054c67


Masayoshi Mizuma (2):
  ktest: Add support for meta characters in GRUB_MENU
  ktest: introduce REBOOT_RETURN_CODE to confirm the result of REBOOT

Steven Rostedt (VMware) (1):
  ktest: Show name and iteration on errors


 tools/testing/ktest/ktest.pl| 41 +
 tools/testing/ktest/sample.conf |  4 
 2 files changed, 37 insertions(+), 8 deletions(-)
---
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 87af8a68ab25..275ad8ac8872 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -58,6 +58,7 @@ my %default = (
 "SCP_TO_TARGET"=> "scp \$SRC_FILE 
\$SSH_USER\@\$MACHINE:\$DST_FILE",
 "SCP_TO_TARGET_INSTALL"=> "\${SCP_TO_TARGET}",
 "REBOOT"   => "ssh \$SSH_USER\@\$MACHINE reboot",
+"REBOOT_RETURN_CODE"   => 255,
 "STOP_AFTER_SUCCESS"   => 10,
 "STOP_AFTER_FAILURE"   => 60,
 "STOP_TEST_AFTER"  => 600,
@@ -105,6 +106,7 @@ my $reboot_type;
 my $reboot_script;
 my $power_cycle;
 my $reboot;
+my $reboot_return_code;
 my $reboot_on_error;
 my $switch_to_good;
 my $switch_to_test;
@@ -278,6 +280,7 @@ my %option_map = (
 "POST_BUILD_DIE"   => \$post_build_die,
 "POWER_CYCLE"  => \$power_cycle,
 "REBOOT"   => \$reboot,
+"REBOOT_RETURN_CODE"   => \$reboot_return_code,
 "BUILD_NOCLEAN"=> \$noclean,
 "MIN_CONFIG"   => \$minconfig,
 "OUTPUT_MIN_CONFIG"=> \$output_minconfig,
@@ -1437,16 +1440,27 @@ sub do_not_reboot {
 
 my $in_die = 0;
 
+sub get_test_name() {
+my $name;
+
+if (defined($test_name)) {
+   $name = "$test_name:$test_type";
+} else {
+   $name = $test_type;
+}
+return $name;
+}
+
 sub dodie {
 
 # avoid recusion
 return if ($in_die);
 $in_die = 1;
 
-doprint "CRITICAL FAILURE... ", @_, "\n";
-
 my $i = $iteration;
 
+doprint "CRITICAL FAILURE... [TEST $i] ", @_, "\n";
+
 if ($reboot_on_error && !do_not_reboot) {
 
doprint "REBOOTING\n";
@@ -1462,7 +1476,8 @@ sub dodie {
 }
 
 if ($email_on_error) {
-send_email("KTEST: critical failure for your [$test_type] test",
+   my $name = get_test_name;
+send_email("KTEST: critical failure for test $i [$name]",
 "Your test started at $script_start_time has failed 
with:\n@_\n");
 }
 
@@ -1737,6 +1752,7 @@ sub run_command {
 my $dord = 0;
 my $dostdout = 0;
 my $pid;
+my $command_orig = $command;
 
 $command =~ s/\$SSH_USER/$ssh_user/g;
 $command =~ s/\$MACHINE/$machine/g;
@@ -1791,6 +1807,11 @@ sub run_command {
 # shift 8 for real exit status
 $run_command_status = $? >> 8;
 
+if ($command_orig eq $default{REBOOT} &&
+   $run_command_status == $reboot_return_code) {
+   $run_command_status = 0;
+}
+
 close(CMD);
 close(LOG) if ($dolog);
 close(RD)  if ($dord);
@@ -1866,9 +1887,10 @@ sub get_grub2_index {
or dodie "unable to get $grub_file";
 
 my $found = 0;
+my $grub_menu_qt = quotemeta($grub_menu);
 
 while () {
-   if (/^menuentry.*$grub_menu/) {
+   if (/^menuentry.*$grub_menu_qt/) {
$grub_number++;
$found = 1;
last;
@@ -1909,9 +1931,10 @@ sub get_grub_index {
or dodie "unable to get menu.lst";
 
 my $found = 0;
+my $grub_menu_qt = quotemeta($grub_menu);
 
 while () {
-   if (/^\s*title\s+$grub_menu\s*$/) {
+   if (/^\s*title\s+$grub_menu_qt\s*$/) {
$grub_number++;
$found = 1;
last;
@@ -4193,7 +4216,8 @@ sub send_email {
 
 sub cancel_test {
 if ($email_when_canceled) {
-send_email("KTEST: Your [$test_type] test was cancelled",
+   my $name = get_test_name;
+send_email("KTEST: Your [$name] test was cancelled",
 "Your test started at $script_start_time was cancelled: sig 
int");
 }
 die "\nCaught Sig Int, test interrupted: $!\n"
@@ -4247,7 +4271,8 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
 run_command $pre_ktest;
 }
 if ($email_when_started) {
-send_email("KTEST: Your [$test_type] test was started",
+   my $name = get_test_name;
+send_email("KTEST: Your [$name] test was started",
 "Your test was started on $script_start_time");
 }
 }
@@ -4414,7 +4439,7 @@ if ($opt{"