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>
This commit is contained in:
parent
f9dfb65b05
commit
a9dd5d6317
1 changed files with 19 additions and 11 deletions
|
@ -103,6 +103,7 @@ my $in_patchcheck = 0;
|
||||||
my $run_test;
|
my $run_test;
|
||||||
my $redirect;
|
my $redirect;
|
||||||
my $buildlog;
|
my $buildlog;
|
||||||
|
my $testlog;
|
||||||
my $dmesg;
|
my $dmesg;
|
||||||
my $monitor_fp;
|
my $monitor_fp;
|
||||||
my $monitor_pid;
|
my $monitor_pid;
|
||||||
|
@ -1021,17 +1022,19 @@ sub fail {
|
||||||
mkpath($faildir) or
|
mkpath($faildir) or
|
||||||
die "can't create $faildir";
|
die "can't create $faildir";
|
||||||
}
|
}
|
||||||
if (-f "$output_config") {
|
|
||||||
cp "$output_config", "$faildir/config" or
|
my %files = (
|
||||||
die "failed to copy .config";
|
"config" => $output_config,
|
||||||
}
|
"buildlog" => $buildlog,
|
||||||
if (-f $buildlog) {
|
"dmesg" => $dmesg,
|
||||||
cp $buildlog, "$faildir/buildlog" or
|
"testlog" => $testlog,
|
||||||
die "failed to move $buildlog";
|
);
|
||||||
}
|
|
||||||
if (-f $dmesg) {
|
while (my ($name, $source) = each(%files)) {
|
||||||
cp $dmesg, "$faildir/dmesg" or
|
if (-f "$source") {
|
||||||
die "failed to move $dmesg";
|
cp "$source", "$faildir/$name" or
|
||||||
|
die "failed to copy $source";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doprint "*** Saved info to $faildir ***\n";
|
doprint "*** Saved info to $faildir ***\n";
|
||||||
|
@ -1669,7 +1672,10 @@ sub child_run_test {
|
||||||
$poweroff_on_error = 0;
|
$poweroff_on_error = 0;
|
||||||
$die_on_failure = 1;
|
$die_on_failure = 1;
|
||||||
|
|
||||||
|
$redirect = "$testlog";
|
||||||
run_command $run_test or $failed = 1;
|
run_command $run_test or $failed = 1;
|
||||||
|
undef $redirect;
|
||||||
|
|
||||||
exit $failed;
|
exit $failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3169,6 +3175,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
|
||||||
$target = "$ssh_user\@$machine";
|
$target = "$ssh_user\@$machine";
|
||||||
|
|
||||||
$buildlog = "$tmpdir/buildlog-$machine";
|
$buildlog = "$tmpdir/buildlog-$machine";
|
||||||
|
$testlog = "$tmpdir/testlog-$machine";
|
||||||
$dmesg = "$tmpdir/dmesg-$machine";
|
$dmesg = "$tmpdir/dmesg-$machine";
|
||||||
$make = "$makecmd O=$outputdir";
|
$make = "$makecmd O=$outputdir";
|
||||||
$output_config = "$outputdir/.config";
|
$output_config = "$outputdir/.config";
|
||||||
|
@ -3205,6 +3212,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
|
||||||
|
|
||||||
unlink $dmesg;
|
unlink $dmesg;
|
||||||
unlink $buildlog;
|
unlink $buildlog;
|
||||||
|
unlink $testlog;
|
||||||
|
|
||||||
if (defined($addconfig)) {
|
if (defined($addconfig)) {
|
||||||
my $min = $minconfig;
|
my $min = $minconfig;
|
||||||
|
|
Loading…
Add table
Reference in a new issue