aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorRabin Vincent <rabin@rab.in>2011-11-18 06:35:29 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-11-18 12:03:27 -0500
commita9dd5d631729eea8686703fbb25a7a9d4c75a724 (patch)
tree50c7a9279a20a77506e7dc0072338b254c23a189 /tools/testing
parentf9dfb65b055c56678afa03e13e942761459ea53d (diff)
ktest: Save test output
The test output may contain useful information; save it along with the already-saved buildlog, dmesg, and .config. Link: http://lkml.kernel.org/r/1321616131-21352-1-git-send-email-rabin@rab.in Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/ktest/ktest.pl30
1 files changed, 19 insertions, 11 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 8b4c2535b266..e93c21cc0aa9 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -103,6 +103,7 @@ my $in_patchcheck = 0;
103my $run_test; 103my $run_test;
104my $redirect; 104my $redirect;
105my $buildlog; 105my $buildlog;
106my $testlog;
106my $dmesg; 107my $dmesg;
107my $monitor_fp; 108my $monitor_fp;
108my $monitor_pid; 109my $monitor_pid;
@@ -1021,17 +1022,19 @@ sub fail {
1021 mkpath($faildir) or 1022 mkpath($faildir) or
1022 die "can't create $faildir"; 1023 die "can't create $faildir";
1023 } 1024 }
1024 if (-f "$output_config") { 1025
1025 cp "$output_config", "$faildir/config" or 1026 my %files = (
1026 die "failed to copy .config"; 1027 "config" => $output_config,
1027 } 1028 "buildlog" => $buildlog,
1028 if (-f $buildlog) { 1029 "dmesg" => $dmesg,
1029 cp $buildlog, "$faildir/buildlog" or 1030 "testlog" => $testlog,
1030 die "failed to move $buildlog"; 1031 );
1031 } 1032
1032 if (-f $dmesg) { 1033 while (my ($name, $source) = each(%files)) {
1033 cp $dmesg, "$faildir/dmesg" or 1034 if (-f "$source") {
1034 die "failed to move $dmesg"; 1035 cp "$source", "$faildir/$name" or
1036 die "failed to copy $source";
1037 }
1035 } 1038 }
1036 1039
1037 doprint "*** Saved info to $faildir ***\n"; 1040 doprint "*** Saved info to $faildir ***\n";
@@ -1669,7 +1672,10 @@ sub child_run_test {
1669 $poweroff_on_error = 0; 1672 $poweroff_on_error = 0;
1670 $die_on_failure = 1; 1673 $die_on_failure = 1;
1671 1674
1675 $redirect = "$testlog";
1672 run_command $run_test or $failed = 1; 1676 run_command $run_test or $failed = 1;
1677 undef $redirect;
1678
1673 exit $failed; 1679 exit $failed;
1674} 1680}
1675 1681
@@ -3169,6 +3175,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
3169 $target = "$ssh_user\@$machine"; 3175 $target = "$ssh_user\@$machine";
3170 3176
3171 $buildlog = "$tmpdir/buildlog-$machine"; 3177 $buildlog = "$tmpdir/buildlog-$machine";
3178 $testlog = "$tmpdir/testlog-$machine";
3172 $dmesg = "$tmpdir/dmesg-$machine"; 3179 $dmesg = "$tmpdir/dmesg-$machine";
3173 $make = "$makecmd O=$outputdir"; 3180 $make = "$makecmd O=$outputdir";
3174 $output_config = "$outputdir/.config"; 3181 $output_config = "$outputdir/.config";
@@ -3205,6 +3212,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
3205 3212
3206 unlink $dmesg; 3213 unlink $dmesg;
3207 unlink $buildlog; 3214 unlink $buildlog;
3215 unlink $testlog;
3208 3216
3209 if (defined($addconfig)) { 3217 if (defined($addconfig)) {
3210 my $min = $minconfig; 3218 my $min = $minconfig;