lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 12 Aug 2011 15:32:10 +0200
From:	Andrew Jones <drjones@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	drjones@...hat.com, rostedt@...dmis.org
Subject: [PATCH 08/10] ktest: test faster, put REBOOT_ON_SUCCESS to more work

Allow the user to decide if it's necessary to reboot after each
successful test or not. If a successfully booted target supports
installation of another kernel, then we might as well save the
time to reboot (which may be long on some systems) to a known-good
kernel. We already have REBOOT_ON_SUCCESS, which defaults to true,
and was underutilized. It only controlled the rebooting of the
target after all testing completed successfully. Now, if the user
sets this to false, we assume that rebooting isn't necessary at
any stage of the testing, assuming the tests are successful. The
option is now also a per-test config option, so the top-level,
default behavior may remain the same.

Signed-off-by: Andrew Jones <drjones@...hat.com>
---
 tools/testing/ktest/ktest.pl    |    8 +++++---
 tools/testing/ktest/sample.conf |    1 -
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 38c4532..719df19 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -74,6 +74,7 @@ my $reboot_script;
 my $power_cycle;
 my $reboot;
 my $reboot_on_error;
+my $reboot_on_success;
 my $poweroff_on_error;
 my $die_on_failure;
 my $powercycle_after_reboot;
@@ -1383,7 +1384,7 @@ sub success {
     doprint     "*******************************************\n";
     doprint     "*******************************************\n";
 
-    if ($i != $opt{"NUM_TESTS"} && !do_not_reboot) {
+    if ($i != $opt{"NUM_TESTS"} && !do_not_reboot && $reboot_on_success) {
 	doprint "Reboot and wait $sleep_time seconds\n";
 	reboot $sleep_time;
     }
@@ -1585,7 +1586,7 @@ sub run_bisect_test {
 
     # reboot the box to a kernel we can ssh to
     if ($type ne "build") {
-	bisect_reboot;
+	bisect_reboot if ($result == 0 || $reboot_on_success);
     }
     $in_bisect = 0;
 
@@ -2191,7 +2192,7 @@ sub patchcheck {
 
 	do_test($type) or return 0;
 
-	patchcheck_reboot;
+	patchcheck_reboot if ($reboot_on_success);
     }
     $in_patchcheck = 0;
     success $i;
@@ -2834,6 +2835,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
     $post_install = set_test_option("POST_INSTALL", $i);
     $reboot_script = set_test_option("REBOOT_SCRIPT", $i);
     $reboot_on_error = set_test_option("REBOOT_ON_ERROR", $i);
+    $reboot_on_success = set_test_option("REBOOT_ON_SUCCESS", $i);
     $poweroff_on_error = set_test_option("POWEROFF_ON_ERROR", $i);
     $die_on_failure = set_test_option("DIE_ON_FAILURE", $i);
     $power_off = set_test_option("POWER_OFF", $i);
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf
index fe7630a..36521c8 100644
--- a/tools/testing/ktest/sample.conf
+++ b/tools/testing/ktest/sample.conf
@@ -11,7 +11,6 @@
 #  LOG_FILE
 #  CLEAR_LOG
 #  POWEROFF_ON_SUCCESS
-#  REBOOT_ON_SUCCESS
 #
 # Test specific options are set after the label:
 #
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ