public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: "John 'Warthog9' Hawley" <warthog9@kernel.org>
Subject: [for-next][PATCH 1/5] ktest: Have POST_TEST run after the test has totally completed
Date: Tue, 07 Feb 2017 15:06:48 -0500	[thread overview]
Message-ID: <20170207201722.125225689@goodmis.org> (raw)
In-Reply-To: 20170207200647.623277817@goodmis.org

[-- Attachment #1: 0001-ktest-Have-POST_TEST-run-after-the-test-has-totally-.patch --]
[-- Type: text/plain, Size: 1647 bytes --]

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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>
---
 tools/testing/ktest/ktest.pl | 20 ++++++++++++--------
 1 file 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 {
 	    system("stty $stty_orig");
     }
 
+    if (defined($post_test)) {
+	run_command $post_test;
+    }
+
     die @_, "\n";
 }
 
@@ -1624,10 +1628,6 @@ sub save_logs {
 
 sub fail {
 
-	if (defined($post_test)) {
-		run_command $post_test;
-	}
-
 	if ($die_on_failure) {
 		dodie @_;
 	}
@@ -1660,6 +1660,10 @@ sub fail {
 	    save_logs "fail", $store_failures;
         }
 
+	if (defined($post_test)) {
+		run_command $post_test;
+	}
+
 	return 1;
 }
 
@@ -2489,10 +2493,6 @@ sub halt {
 sub success {
     my ($i) = @_;
 
-    if (defined($post_test)) {
-	run_command $post_test;
-    }
-
     $successes++;
 
     my $name = "";
@@ -2517,6 +2517,10 @@ sub success {
 	doprint "Reboot and wait $sleep_time seconds\n";
 	reboot_to_good $sleep_time;
     }
+
+    if (defined($post_test)) {
+	run_command $post_test;
+    }
 }
 
 sub answer_bisect {
-- 
2.10.2

  reply	other threads:[~2017-02-07 20:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 20:06 [for-next][PATCH 0/5] ktest: Updates for 4.11 Steven Rostedt
2017-02-07 20:06 ` Steven Rostedt [this message]
2017-02-07 20:06 ` [for-next][PATCH 2/5] ktest: Fix child exit code processing Steven Rostedt
2017-02-07 20:06 ` [for-next][PATCH 3/5] ktest: Add timeout to ssh command Steven Rostedt
2017-02-07 20:06 ` [for-next][PATCH 4/5] ktest.pl: Powercycle the box on reboot if no connection can be made Steven Rostedt
2017-02-07 20:06 ` [for-next][PATCH 5/5] ktest: Add variable run_command_status to save status of commands executed Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207201722.125225689@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=warthog9@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox