mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-10-30 20:51:41 +00:00 
			
		
		
		
	 56cb3429ac
			
		
	
	56cb3429ac
	
	
	
		
			
			Large SD cards (16GB+) require significant amount of time for FS formatting. Added FS mount checkpoint in example test python, timeout set to 60 sec Closes IDFCI-706
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| import re
 | |
| 
 | |
| import ttfw_idf
 | |
| from tiny_test_fw import Utility
 | |
| 
 | |
| 
 | |
| @ttfw_idf.idf_example_test(env_tag='UT_T1_SDMODE')
 | |
| def test_examples_sd_card(env, extra_data):
 | |
| 
 | |
|     dut = env.get_dut('sd_card', 'examples/storage/sd_card')
 | |
|     dut.start_app()
 | |
|     dut.expect('example: Initializing SD card', timeout=20)
 | |
|     peripheral = dut.expect(re.compile(r'example: Using (\w+) peripheral'), timeout=5)[0]
 | |
|     Utility.console_log('peripheral {} detected'.format(peripheral))
 | |
|     assert peripheral in ('SDMMC', 'SPI')
 | |
| 
 | |
|     # Provide enough time for possible SD card formatting
 | |
|     dut.expect('Filesystem mounted', timeout=60)
 | |
| 
 | |
|     # These lines are matched separately because of ASCII color codes in the output
 | |
|     name = dut.expect(re.compile(r'Name: (\w+)'), timeout=5)[0]
 | |
|     _type = dut.expect(re.compile(r'Type: (\S+)'), timeout=5)[0]
 | |
|     speed = dut.expect(re.compile(r'Speed: (\S+)'), timeout=5)[0]
 | |
|     size = dut.expect(re.compile(r'Size: (\S+)'), timeout=5)[0]
 | |
| 
 | |
|     Utility.console_log('Card {} {} {}MHz {} found'.format(name, _type, speed, size))
 | |
| 
 | |
|     dut.expect_all('Opening file',
 | |
|                    'File written',
 | |
|                    'Renaming file',
 | |
|                    'Reading file',
 | |
|                    "Read from file: 'Hello {}!".format(name),
 | |
|                    'Card unmounted',
 | |
|                    timeout=5)
 | |
| 
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     test_examples_sd_card()
 |