Skip to content

Commit 2e07c9f

Browse files
committed
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>
1 parent 69973b8 commit 2e07c9f

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,10 @@ sub dodie {
14121412
system("stty $stty_orig");
14131413
}
14141414

1415+
if (defined($post_test)) {
1416+
run_command $post_test;
1417+
}
1418+
14151419
die @_, "\n";
14161420
}
14171421

@@ -1624,10 +1628,6 @@ sub save_logs {
16241628

16251629
sub fail {
16261630

1627-
if (defined($post_test)) {
1628-
run_command $post_test;
1629-
}
1630-
16311631
if ($die_on_failure) {
16321632
dodie @_;
16331633
}
@@ -1660,6 +1660,10 @@ sub fail {
16601660
save_logs "fail", $store_failures;
16611661
}
16621662

1663+
if (defined($post_test)) {
1664+
run_command $post_test;
1665+
}
1666+
16631667
return 1;
16641668
}
16651669

@@ -2489,10 +2493,6 @@ sub halt {
24892493
sub success {
24902494
my ($i) = @_;
24912495

2492-
if (defined($post_test)) {
2493-
run_command $post_test;
2494-
}
2495-
24962496
$successes++;
24972497

24982498
my $name = "";
@@ -2517,6 +2517,10 @@ sub success {
25172517
doprint "Reboot and wait $sleep_time seconds\n";
25182518
reboot_to_good $sleep_time;
25192519
}
2520+
2521+
if (defined($post_test)) {
2522+
run_command $post_test;
2523+
}
25202524
}
25212525

25222526
sub answer_bisect {

0 commit comments

Comments
 (0)