* [PATCH 0/5] [GIT PULL] ktest for v3.4
@ 2012-03-21 16:01 Steven Rostedt
2012-03-21 16:01 ` [PATCH 1/5] ktest: Add INSTALL_MOD_STRIP=1 when installing modules Steven Rostedt
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-03-21 16:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
Linus,
(hopefully my signed tag scripts works this time)
Please pull the latest ktest-v3.4 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
ktest-v3.4
Head SHA1: 5909e3e9c417e56ceb61a4733441766bf4be82cc
Steven Rostedt (5):
ktest: Add INSTALL_MOD_STRIP=1 when installing modules
ktest: Add warning when bugs are ignored
ktest: Add SCP_TO_TARGET_INSTALL option
ktest: Fix SWITCH_TO_GOOD to also reboot the machine
ktest: Allow a test to override REBOOT_ON_SUCCESS
----
tools/testing/ktest/ktest.pl | 56 +++++++++++++++++++++++++++++++-------
tools/testing/ktest/sample.conf | 14 +++++++--
2 files changed, 56 insertions(+), 14 deletions(-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] ktest: Add INSTALL_MOD_STRIP=1 when installing modules
2012-03-21 16:01 [PATCH 0/5] [GIT PULL] ktest for v3.4 Steven Rostedt
@ 2012-03-21 16:01 ` Steven Rostedt
2012-03-21 16:01 ` [PATCH 2/5] ktest: Add warning when bugs are ignored Steven Rostedt
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-03-21 16:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 790 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
To keep the modules from bloating the target's filesystem
strip them during the install.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 9507c4b..2b63190 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1643,7 +1643,7 @@ sub install {
return;
}
- run_command "$make INSTALL_MOD_PATH=$tmpdir modules_install" or
+ run_command "$make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$tmpdir modules_install" or
dodie "Failed to install modules";
my $modlib = "/lib/modules/$version";
--
1.7.8.3
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] ktest: Add warning when bugs are ignored
2012-03-21 16:01 [PATCH 0/5] [GIT PULL] ktest for v3.4 Steven Rostedt
2012-03-21 16:01 ` [PATCH 1/5] ktest: Add INSTALL_MOD_STRIP=1 when installing modules Steven Rostedt
@ 2012-03-21 16:01 ` Steven Rostedt
2012-03-21 16:01 ` [PATCH 3/5] ktest: Add SCP_TO_TARGET_INSTALL option Steven Rostedt
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-03-21 16:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
When IGNORE_ERRORS is set, ktest will not fail a test if a backtrace
is detected. But this can be an issue if the user added it in the
config but forgot to remove it. They may be left wondering why their
test did not fail, or even worse, why their bisect gave the wrong
commit.
Add a warning in the output if IGNORE_WARNINGS is set, and ktest detects
a kernel error.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 2b63190..0a5f6cb 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1460,6 +1460,7 @@ sub get_sha1 {
sub monitor {
my $booted = 0;
my $bug = 0;
+ my $bug_ignored = 0;
my $skip_call_trace = 0;
my $loops;
@@ -1531,9 +1532,13 @@ sub monitor {
}
if ($full_line =~ /call trace:/i) {
- if (!$ignore_errors && !$bug && !$skip_call_trace) {
- $bug = 1;
- $failure_start = time;
+ if (!$bug && !$skip_call_trace) {
+ if ($ignore_errors) {
+ $bug_ignored = 1;
+ } else {
+ $bug = 1;
+ $failure_start = time;
+ }
}
}
@@ -1595,6 +1600,10 @@ sub monitor {
fail "failed - never got a boot prompt." and return 0;
}
+ if ($bug_ignored) {
+ doprint "WARNING: Call Trace detected but ignored due to IGNORE_ERRORS=1\n";
+ }
+
return 1;
}
--
1.7.8.3
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] ktest: Add SCP_TO_TARGET_INSTALL option
2012-03-21 16:01 [PATCH 0/5] [GIT PULL] ktest for v3.4 Steven Rostedt
2012-03-21 16:01 ` [PATCH 1/5] ktest: Add INSTALL_MOD_STRIP=1 when installing modules Steven Rostedt
2012-03-21 16:01 ` [PATCH 2/5] ktest: Add warning when bugs are ignored Steven Rostedt
@ 2012-03-21 16:01 ` Steven Rostedt
2012-03-21 16:01 ` [PATCH 4/5] ktest: Fix SWITCH_TO_GOOD to also reboot the machine Steven Rostedt
2012-03-21 16:01 ` [PATCH 5/5] ktest: Allow a test to override REBOOT_ON_SUCCESS Steven Rostedt
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-03-21 16:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 4331 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Currently the option used to scp both the modules to the target as well
as the kernel image are the same (SCP_TO_TARGET). But some embedded
boards may require them to be different. The modules may need to be put
directly on the board, but the kernel image may need to go to a
tftpserver.
Add the option SCP_TO_TARGET_INSTALL that will allow the user to change
the config so that they may have the modules and image got to different
machines.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 26 ++++++++++++++++++++++----
tools/testing/ktest/sample.conf | 14 +++++++++++---
2 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 0a5f6cb..1143e6c 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -46,6 +46,7 @@ my %default = (
"DIE_ON_FAILURE" => 1,
"SSH_EXEC" => "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND",
"SCP_TO_TARGET" => "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE",
+ "SCP_TO_TARGET_INSTALL" => "\${SCP_TO_TARGET}",
"REBOOT" => "ssh \$SSH_USER\@\$MACHINE reboot",
"STOP_AFTER_SUCCESS" => 10,
"STOP_AFTER_FAILURE" => 60,
@@ -91,6 +92,7 @@ my $powercycle_after_reboot;
my $poweroff_after_halt;
my $ssh_exec;
my $scp_to_target;
+my $scp_to_target_install;
my $power_off;
my $grub_menu;
my $grub_number;
@@ -243,6 +245,7 @@ my %option_map = (
"BUILD_TARGET" => \$build_target,
"SSH_EXEC" => \$ssh_exec,
"SCP_TO_TARGET" => \$scp_to_target,
+ "SCP_TO_TARGET_INSTALL" => \$scp_to_target_install,
"CHECKOUT" => \$checkout,
"TARGET_IMAGE" => \$target_image,
"LOCALVERSION" => \$localversion,
@@ -1349,8 +1352,7 @@ sub run_ssh {
}
sub run_scp {
- my ($src, $dst) = @_;
- my $cp_scp = $scp_to_target;
+ my ($src, $dst, $cp_scp) = @_;
$cp_scp =~ s/\$SRC_FILE/$src/g;
$cp_scp =~ s/\$DST_FILE/$dst/g;
@@ -1358,6 +1360,22 @@ sub run_scp {
return run_command "$cp_scp";
}
+sub run_scp_install {
+ my ($src, $dst) = @_;
+
+ my $cp_scp = $scp_to_target_install;
+
+ return run_scp($src, $dst, $cp_scp);
+}
+
+sub run_scp_mod {
+ my ($src, $dst) = @_;
+
+ my $cp_scp = $scp_to_target;
+
+ return run_scp($src, $dst, $cp_scp);
+}
+
sub get_grub_index {
if ($reboot_type ne "grub") {
@@ -1630,7 +1648,7 @@ sub install {
my $cp_target = eval_kernel_version $target_image;
- run_scp "$outputdir/$build_target", "$cp_target" or
+ run_scp_install "$outputdir/$build_target", "$cp_target" or
dodie "failed to copy image";
my $install_mods = 0;
@@ -1665,7 +1683,7 @@ sub install {
run_command "cd $tmpdir && tar -cjf $modtar lib/modules/$version" or
dodie "making tarball";
- run_scp "$tmpdir/$modtar", "/tmp" or
+ run_scp_mod "$tmpdir/$modtar", "/tmp" or
dodie "failed to copy modules";
unlink "$tmpdir/$modtar";
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf
index 5ea04c6..b682456 100644
--- a/tools/testing/ktest/sample.conf
+++ b/tools/testing/ktest/sample.conf
@@ -710,10 +710,18 @@
# The variables SSH_USER, MACHINE and SSH_COMMAND are defined
#SSH_EXEC = ssh $SSH_USER@$MACHINE $SSH_COMMAND";
-# The way to copy a file to the target
+# The way to copy a file to the target (install and modules)
# (default scp $SRC_FILE $SSH_USER@$MACHINE:$DST_FILE)
-# The variables SSH_USER, MACHINE, SRC_FILE and DST_FILE are defined.
-#SCP_TO_TARGET = scp $SRC_FILE $SSH_USER@$MACHINE:$DST_FILE
+# The variables SSH_USER, MACHINE are defined by the config
+# SRC_FILE and DST_FILE are ktest internal variables and
+# should only have '$' and not the '${}' notation.
+# (default scp $SRC_FILE ${SSH_USER}@${MACHINE}:$DST_FILE)
+#SCP_TO_TARGET = echo skip scp for $SRC_FILE $DST_FILE
+
+# If install needs to be different than modules, then this
+# option will override the SCP_TO_TARGET for installation.
+# (default ${SCP_TO_TARGET} )
+#SCP_TO_TARGET_INSTALL = scp $SRC_FILE tftp@tftpserver:$DST_FILE
# The nice way to reboot the target
# (default ssh $SSH_USER@$MACHINE reboot)
--
1.7.8.3
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] ktest: Fix SWITCH_TO_GOOD to also reboot the machine
2012-03-21 16:01 [PATCH 0/5] [GIT PULL] ktest for v3.4 Steven Rostedt
` (2 preceding siblings ...)
2012-03-21 16:01 ` [PATCH 3/5] ktest: Add SCP_TO_TARGET_INSTALL option Steven Rostedt
@ 2012-03-21 16:01 ` Steven Rostedt
2012-03-21 16:01 ` [PATCH 5/5] ktest: Allow a test to override REBOOT_ON_SUCCESS Steven Rostedt
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-03-21 16:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
When the option SWITCH_TO_GOOD is set, it will be called when the system
needs to reboot to the good server. But currently, this keeps the reboot
from happening. The SWITCH_TO_GOOD is just a way to get to a new kernel,
it may not mean to not reboot.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 1143e6c..e7fed79 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -1116,7 +1116,6 @@ sub reboot_to_good {
if (defined($switch_to_good)) {
run_command $switch_to_good;
- return;
}
reboot $time;
--
1.7.8.3
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] ktest: Allow a test to override REBOOT_ON_SUCCESS
2012-03-21 16:01 [PATCH 0/5] [GIT PULL] ktest for v3.4 Steven Rostedt
` (3 preceding siblings ...)
2012-03-21 16:01 ` [PATCH 4/5] ktest: Fix SWITCH_TO_GOOD to also reboot the machine Steven Rostedt
@ 2012-03-21 16:01 ` Steven Rostedt
4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-03-21 16:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Linus Torvalds
[-- Attachment #1: Type: text/plain, Size: 2213 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
The option REBOOT_ON_SUCCESS is global, and will have the machine reboot
the the box if all tests are successful. But a test may not want the
machine to reboot, and perhaps have the kernel it loaded be used to
install the next kernel. Or the last test may set up a kernel that the
user may want to look at. In this case, the user could have the global
option REBOOT_ON_SUCCESS be true, but if a test is defined to run at the
end, that test can override the global option and keep the kernel it
installed for the user to log in with.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index e7fed79..c858152 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -87,6 +87,7 @@ my $reboot_on_error;
my $switch_to_good;
my $switch_to_test;
my $poweroff_on_error;
+my $reboot_on_success;
my $die_on_failure;
my $powercycle_after_reboot;
my $poweroff_after_halt;
@@ -213,6 +214,7 @@ my %option_map = (
"SWITCH_TO_GOOD" => \$switch_to_good,
"SWITCH_TO_TEST" => \$switch_to_test,
"POWEROFF_ON_ERROR" => \$poweroff_on_error,
+ "REBOOT_ON_SUCCESS" => \$reboot_on_success,
"DIE_ON_FAILURE" => \$die_on_failure,
"POWER_OFF" => \$power_off,
"POWERCYCLE_AFTER_REBOOT" => \$powercycle_after_reboot,
@@ -3552,8 +3554,10 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
die "failed to checkout $checkout";
}
- $no_reboot = 0;
-
+ # A test may opt to not reboot the box
+ if ($reboot_on_success) {
+ $no_reboot = 0;
+ }
if ($test_type eq "bisect") {
bisect $i;
@@ -3598,8 +3602,12 @@ if ($opt{"POWEROFF_ON_SUCCESS"}) {
halt;
} elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot) {
reboot_to_good;
+} elsif (defined($switch_to_good)) {
+ # still need to get to the good kernel
+ run_command $switch_to_good;
}
+
doprint "\n $successes of $opt{NUM_TESTS} tests were successful\n\n";
exit 0;
--
1.7.8.3
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-03-21 16:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-21 16:01 [PATCH 0/5] [GIT PULL] ktest for v3.4 Steven Rostedt
2012-03-21 16:01 ` [PATCH 1/5] ktest: Add INSTALL_MOD_STRIP=1 when installing modules Steven Rostedt
2012-03-21 16:01 ` [PATCH 2/5] ktest: Add warning when bugs are ignored Steven Rostedt
2012-03-21 16:01 ` [PATCH 3/5] ktest: Add SCP_TO_TARGET_INSTALL option Steven Rostedt
2012-03-21 16:01 ` [PATCH 4/5] ktest: Fix SWITCH_TO_GOOD to also reboot the machine Steven Rostedt
2012-03-21 16:01 ` [PATCH 5/5] ktest: Allow a test to override REBOOT_ON_SUCCESS Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox