From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: "John 'Warthog9' Hawley" <warthog9@kernel.org>
Subject: [for-next][PATCH 5/5] ktest: Add variable run_command_status to save status of commands executed
Date: Tue, 07 Feb 2017 15:06:52 -0500 [thread overview]
Message-ID: <20170207201722.733442820@goodmis.org> (raw)
In-Reply-To: 20170207200647.623277817@goodmis.org
[-- Attachment #1: 0005-ktest-Add-variable-run_command_status-to-save-status.patch --]
[-- Type: text/plain, Size: 2007 bytes --]
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Create a variable called run_command_status that saves the status of the
executed commands and can be used by other functions later to test for
status.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 6a1484cc4436..29470b554711 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -179,6 +179,7 @@ my $localversion;
my $iteration = 0;
my $successes = 0;
my $stty_orig;
+my $run_command_status = 0;
my $bisect_good;
my $bisect_bad;
@@ -1736,11 +1737,8 @@ sub run_command {
}
waitpid($pid, 0);
- my $failed = $?;
-
- if ($hit_timeout) {
- $failed = 1;
- }
+ # shift 8 for real exit status
+ $run_command_status = $? >> 8;
close(CMD);
close(LOG) if ($dolog);
@@ -1755,13 +1753,17 @@ sub run_command {
doprint "[$delta seconds] ";
}
- if ($failed) {
+ if ($hit_timeout) {
+ $run_command_status = 1;
+ }
+
+ if ($run_command_status) {
doprint "FAILED!\n";
} else {
doprint "SUCCESS\n";
}
- return !$failed;
+ return !$run_command_status;
}
sub run_ssh {
@@ -2578,16 +2580,15 @@ sub answer_bisect {
}
sub child_run_test {
- my $failed = 0;
# child should have no power
$reboot_on_error = 0;
$poweroff_on_error = 0;
$die_on_failure = 1;
- run_command $run_test, $testlog or $failed = 1;
+ run_command $run_test, $testlog;
- exit $failed;
+ exit $run_command_status;
}
my $child_done;
@@ -3371,7 +3372,6 @@ sub config_bisect {
save_config \%good_configs, $good_config;
save_config \%bad_configs, $bad_config;
-
if (defined($config_bisect_check) && $config_bisect_check ne "0") {
if ($config_bisect_check ne "good") {
doprint "Testing bad config\n";
--
2.10.2
prev parent 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 ` [for-next][PATCH 1/5] ktest: Have POST_TEST run after the test has totally completed Steven Rostedt
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 ` Steven Rostedt [this message]
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.733442820@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.