mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	Add test cases for check exit code when abnormal commands were performed (#2755)
* Add test case for xdsh when permission denied * Add test case for nodestat for malformed command * Add test case descriptions for nodestat_usage and xdsh_permission_denied
This commit is contained in:
		
							
								
								
									
										5
									
								
								xCAT-test/autotest/testcase/nodestat/cases1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								xCAT-test/autotest/testcase/nodestat/cases1
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
start:nodestat_usage
 | 
			
		||||
description: Test the exit code when no command line argument is passed to nodestat
 | 
			
		||||
cmd:nodestat
 | 
			
		||||
check:rc!=0
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										11
									
								
								xCAT-test/autotest/testcase/xdsh/cases1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								xCAT-test/autotest/testcase/xdsh/cases1
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
start:xdsh_permission_denied
 | 
			
		||||
description: Test the exit code when command xdsh failed
 | 
			
		||||
cmd:xdsh $$CN date
 | 
			
		||||
check:rc==0
 | 
			
		||||
cmd:mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup
 | 
			
		||||
check:rc==0
 | 
			
		||||
cmd:xdsh $$CN date
 | 
			
		||||
check:rc!=0
 | 
			
		||||
cmd:mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa
 | 
			
		||||
check:rc==0
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user