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>
This commit is contained in:
		
					parent
					
						
							
								5a5a1bf099
							
						
					
				
			
			
				commit
				
					
						5a5d8e4844
					
				
			
		
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -25,6 +25,7 @@ my %default = ( | ||||||
|     "TEST_TYPE"			=> "build", |     "TEST_TYPE"			=> "build", | ||||||
|     "BUILD_TYPE"		=> "randconfig", |     "BUILD_TYPE"		=> "randconfig", | ||||||
|     "MAKE_CMD"			=> "make", |     "MAKE_CMD"			=> "make", | ||||||
|  |     "CLOSE_CONSOLE_SIGNAL"	=> "INT", | ||||||
|     "TIMEOUT"			=> 120, |     "TIMEOUT"			=> 120, | ||||||
|     "TMP_DIR"			=> "/tmp/ktest/\${MACHINE}", |     "TMP_DIR"			=> "/tmp/ktest/\${MACHINE}", | ||||||
|     "SLEEP_TIME"		=> 60,	# sleep time between tests |     "SLEEP_TIME"		=> 60,	# sleep time between tests | ||||||
|  | @ -163,6 +164,7 @@ my $timeout; | ||||||
| my $booted_timeout; | my $booted_timeout; | ||||||
| my $detect_triplefault; | my $detect_triplefault; | ||||||
| my $console; | my $console; | ||||||
|  | my $close_console_signal; | ||||||
| my $reboot_success_line; | my $reboot_success_line; | ||||||
| my $success_line; | my $success_line; | ||||||
| my $stop_after_success; | my $stop_after_success; | ||||||
|  | @ -285,6 +287,7 @@ my %option_map = ( | ||||||
|     "TIMEOUT"			=> \$timeout, |     "TIMEOUT"			=> \$timeout, | ||||||
|     "BOOTED_TIMEOUT"		=> \$booted_timeout, |     "BOOTED_TIMEOUT"		=> \$booted_timeout, | ||||||
|     "CONSOLE"			=> \$console, |     "CONSOLE"			=> \$console, | ||||||
|  |     "CLOSE_CONSOLE_SIGNAL"	=> \$close_console_signal, | ||||||
|     "DETECT_TRIPLE_FAULT"	=> \$detect_triplefault, |     "DETECT_TRIPLE_FAULT"	=> \$detect_triplefault, | ||||||
|     "SUCCESS_LINE"		=> \$success_line, |     "SUCCESS_LINE"		=> \$success_line, | ||||||
|     "REBOOT_SUCCESS_LINE"	=> \$reboot_success_line, |     "REBOOT_SUCCESS_LINE"	=> \$reboot_success_line, | ||||||
|  | @ -1296,7 +1299,7 @@ sub close_console { | ||||||
|     my ($fp, $pid) = @_; |     my ($fp, $pid) = @_; | ||||||
| 
 | 
 | ||||||
|     doprint "kill child process $pid\n"; |     doprint "kill child process $pid\n"; | ||||||
|     kill 2, $pid; |     kill $close_console_signal, $pid; | ||||||
| 
 | 
 | ||||||
|     print "closing!\n"; |     print "closing!\n"; | ||||||
|     close($fp); |     close($fp); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Satoru Takeuchi
				Satoru Takeuchi