aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest
diff options
context:
space:
mode:
authorSatoru Takeuchi <satoru.takeuchi@gmail.com>2013-11-30 17:57:58 -0500
committerSteven Rostedt <rostedt@goodmis.org>2013-12-03 11:56:07 -0500
commit5a5d8e4844987b6d8d64d583eb33dd926973a270 (patch)
tree05f4ae258dcf6176d37dc726f7c73bffc6526f6e /tools/testing/ktest
parent5a5a1bf099d6942399ea0b34a62e5f0bc4c5c36e (diff)
ktest: Make the signal to terminate the console configurable
Currently ktest sends SIGINT to terminate the console. However, there are consoles which do not exit by this signal, for example, in my case, "virsh console <guest OS>". In such case, ktest is blocked in close_console(). It prevents this automate test. This patch adds new option CLOSE_CONSOLE_SIGNAL which mean the signal to terminate the console. Since its default value is "INT", the original behavior isn't changed. Link: http://lkml.kernel.org/r/87zjol8pl5.wl%satoru.takeuchi@gmail.com Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-xtools/testing/ktest/ktest.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 0d7fd8b51544..5dc5704d8680 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -25,6 +25,7 @@ my %default = (
25 "TEST_TYPE" => "build", 25 "TEST_TYPE" => "build",
26 "BUILD_TYPE" => "randconfig", 26 "BUILD_TYPE" => "randconfig",
27 "MAKE_CMD" => "make", 27 "MAKE_CMD" => "make",
28 "CLOSE_CONSOLE_SIGNAL" => "INT",
28 "TIMEOUT" => 120, 29 "TIMEOUT" => 120,
29 "TMP_DIR" => "/tmp/ktest/\${MACHINE}", 30 "TMP_DIR" => "/tmp/ktest/\${MACHINE}",
30 "SLEEP_TIME" => 60, # sleep time between tests 31 "SLEEP_TIME" => 60, # sleep time between tests
@@ -163,6 +164,7 @@ my $timeout;
163my $booted_timeout; 164my $booted_timeout;
164my $detect_triplefault; 165my $detect_triplefault;
165my $console; 166my $console;
167my $close_console_signal;
166my $reboot_success_line; 168my $reboot_success_line;
167my $success_line; 169my $success_line;
168my $stop_after_success; 170my $stop_after_success;
@@ -285,6 +287,7 @@ my %option_map = (
285 "TIMEOUT" => \$timeout, 287 "TIMEOUT" => \$timeout,
286 "BOOTED_TIMEOUT" => \$booted_timeout, 288 "BOOTED_TIMEOUT" => \$booted_timeout,
287 "CONSOLE" => \$console, 289 "CONSOLE" => \$console,
290 "CLOSE_CONSOLE_SIGNAL" => \$close_console_signal,
288 "DETECT_TRIPLE_FAULT" => \$detect_triplefault, 291 "DETECT_TRIPLE_FAULT" => \$detect_triplefault,
289 "SUCCESS_LINE" => \$success_line, 292 "SUCCESS_LINE" => \$success_line,
290 "REBOOT_SUCCESS_LINE" => \$reboot_success_line, 293 "REBOOT_SUCCESS_LINE" => \$reboot_success_line,
@@ -1296,7 +1299,7 @@ sub close_console {
1296 my ($fp, $pid) = @_; 1299 my ($fp, $pid) = @_;
1297 1300
1298 doprint "kill child process $pid\n"; 1301 doprint "kill child process $pid\n";
1299 kill 2, $pid; 1302 kill $close_console_signal, $pid;
1300 1303
1301 print "closing!\n"; 1304 print "closing!\n";
1302 close($fp); 1305 close($fp);