diff options
Diffstat (limited to 'tools/testing/ktest/ktest.pl')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 87af8a68ab25..75f8cecdd549 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1437,16 +1437,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 +1473,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"); } @@ -4193,7 +4205,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 +4260,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 +4428,7 @@ if ($opt{"POWEROFF_ON_SUCCESS"}) { doprint "\n $successes of $opt{NUM_TESTS} tests were successful\n\n"; if ($email_when_finished) { - send_email("KTEST: Your [$test_type] test has finished!", + send_email("KTEST: Your test has finished!", "$successes of $opt{NUM_TESTS} tests started at $script_start_time were successful!"); } exit 0; |