aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2017-02-07 11:49:21 -0500
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2017-02-07 11:49:21 -0500
commit2e07c9f55ecabdf78746b9808fec6ab549a07f8a (patch)
treeee5bc330d98f1296ff61b819b6334538c85e794d
parent69973b830859bc6529a7a0468ba0d80ee5117826 (diff)
ktest: Have POST_TEST run after the test has totally completed
The POST_TEST config is to be executed after a test has fully compeleted, whether the test passed or failed. It currently is executed at the moment that the test has been decided if it failed or not. As the test does other clean ups, it isn't truly finished. Move the POST_TEST execution to after all the test cleanups have been done. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rwxr-xr-xtools/testing/ktest/ktest.pl20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index d08e214ec6e7..caa90d391a96 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1412,6 +1412,10 @@ sub dodie {
1412 system("stty $stty_orig"); 1412 system("stty $stty_orig");
1413 } 1413 }
1414 1414
1415 if (defined($post_test)) {
1416 run_command $post_test;
1417 }
1418
1415 die @_, "\n"; 1419 die @_, "\n";
1416} 1420}
1417 1421
@@ -1624,10 +1628,6 @@ sub save_logs {
1624 1628
1625sub fail { 1629sub fail {
1626 1630
1627 if (defined($post_test)) {
1628 run_command $post_test;
1629 }
1630
1631 if ($die_on_failure) { 1631 if ($die_on_failure) {
1632 dodie @_; 1632 dodie @_;
1633 } 1633 }
@@ -1660,6 +1660,10 @@ sub fail {
1660 save_logs "fail", $store_failures; 1660 save_logs "fail", $store_failures;
1661 } 1661 }
1662 1662
1663 if (defined($post_test)) {
1664 run_command $post_test;
1665 }
1666
1663 return 1; 1667 return 1;
1664} 1668}
1665 1669
@@ -2489,10 +2493,6 @@ sub halt {
2489sub success { 2493sub success {
2490 my ($i) = @_; 2494 my ($i) = @_;
2491 2495
2492 if (defined($post_test)) {
2493 run_command $post_test;
2494 }
2495
2496 $successes++; 2496 $successes++;
2497 2497
2498 my $name = ""; 2498 my $name = "";
@@ -2517,6 +2517,10 @@ sub success {
2517 doprint "Reboot and wait $sleep_time seconds\n"; 2517 doprint "Reboot and wait $sleep_time seconds\n";
2518 reboot_to_good $sleep_time; 2518 reboot_to_good $sleep_time;
2519 } 2519 }
2520
2521 if (defined($post_test)) {
2522 run_command $post_test;
2523 }
2520} 2524}
2521 2525
2522sub answer_bisect { 2526sub answer_bisect {