| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -4,9 +4,11 @@ import unittest | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import cereal.messaging as messaging | 
					 | 
					 | 
					 | 
					import cereal.messaging as messaging | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from panda import Panda | 
					 | 
					 | 
					 | 
					from panda import Panda | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					from common.gpio import gpio_set, gpio_init | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from selfdrive.test.helpers import phone_only | 
					 | 
					 | 
					 | 
					from selfdrive.test.helpers import phone_only | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from selfdrive.manager.process_config import managed_processes | 
					 | 
					 | 
					 | 
					from selfdrive.manager.process_config import managed_processes | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					from system.hardware import HARDWARE | 
					 | 
					 | 
					 | 
					from system.hardware import HARDWARE | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					from system.hardware.tici.pins import GPIO | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					class TestPandad(unittest.TestCase): | 
					 | 
					 | 
					 | 
					class TestPandad(unittest.TestCase): | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -40,6 +42,18 @@ class TestPandad(unittest.TestCase): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    managed_processes['pandad'].start() | 
					 | 
					 | 
					 | 
					    managed_processes['pandad'].start() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self._wait_for_boardd() | 
					 | 
					 | 
					 | 
					    self._wait_for_boardd() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  @phone_only | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  def test_internal_panda_reset(self): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    gpio_init(GPIO.STM_RST_N, True) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    gpio_set(GPIO.STM_RST_N, 1) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    time.sleep(0.5) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    assert all(not Panda(s).is_internal() for s in Panda.list()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    managed_processes['pandad'].start() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    self._wait_for_boardd() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    assert any(Panda(s).is_internal() for s in Panda.list()) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  #def test_out_of_date_fw(self): | 
					 | 
					 | 
					 | 
					  #def test_out_of_date_fw(self): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  #  pass | 
					 | 
					 | 
					 | 
					  #  pass | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |