summaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2018-03-22 16:28:18 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2018-04-06 14:05:24 -0400
commitb337f9790a0c8f0f01abf9fe3e1f48894b773899 (patch)
tree2ac3f01f04ea98c81bcd2228b97c649e99011a6c /tools/testing/ktest
parenta9adc261e978b9214fd505030c24e75b07dcf52f (diff)
ktest.pl: Allow for the config-bisect.pl output to display to console
When commands are run in ktest, they are only displayed in the ktest log file, but that is not sufficient for outputting the display for config bisects. The result of a config bisect is not shown. Add a way to display the output of "run_command" which is the subroutine used by ktest to execute commands. Use this feature to display the output of config-bisect.pl executions to see the progress as well as the result. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-xtools/testing/ktest/ktest.pl16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index ad00ce699749..79c2f99629de 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1692,6 +1692,7 @@ sub run_command {
1692 my $end_time; 1692 my $end_time;
1693 my $dolog = 0; 1693 my $dolog = 0;
1694 my $dord = 0; 1694 my $dord = 0;
1695 my $dostdout = 0;
1695 my $pid; 1696 my $pid;
1696 1697
1697 $command =~ s/\$SSH_USER/$ssh_user/g; 1698 $command =~ s/\$SSH_USER/$ssh_user/g;
@@ -1710,9 +1711,15 @@ sub run_command {
1710 } 1711 }
1711 1712
1712 if (defined($redirect)) { 1713 if (defined($redirect)) {
1713 open (RD, ">$redirect") or 1714 if ($redirect eq 1) {
1714 dodie "failed to write to redirect $redirect"; 1715 $dostdout = 1;
1715 $dord = 1; 1716 # Have the output of the command on its own line
1717 doprint "\n";
1718 } else {
1719 open (RD, ">$redirect") or
1720 dodie "failed to write to redirect $redirect";
1721 $dord = 1;
1722 }
1716 } 1723 }
1717 1724
1718 my $hit_timeout = 0; 1725 my $hit_timeout = 0;
@@ -1734,6 +1741,7 @@ sub run_command {
1734 } 1741 }
1735 print LOG $line if ($dolog); 1742 print LOG $line if ($dolog);
1736 print RD $line if ($dord); 1743 print RD $line if ($dord);
1744 print $line if ($dostdout);
1737 } 1745 }
1738 1746
1739 waitpid($pid, 0); 1747 waitpid($pid, 0);
@@ -3118,7 +3126,7 @@ sub run_config_bisect {
3118 my $cmd; 3126 my $cmd;
3119 my $ret; 3127 my $ret;
3120 3128
3121 run_command "$builddir/tools/testing/ktest/config-bisect.pl -b $outputdir $good $bad $last_result"; 3129 run_command "$builddir/tools/testing/ktest/config-bisect.pl -b $outputdir $good $bad $last_result", 1;
3122 3130
3123 # config-bisect returns: 3131 # config-bisect returns:
3124 # 0 if there is more to bisect 3132 # 0 if there is more to bisect