You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					27 lines
				
				652 B
			
		
		
			
		
	
	
					27 lines
				
				652 B
			| 
								 
											6 years ago
										 
									 | 
							
								#!/usr/bin/env python3
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								"""Script to fill up storage with fake data"""
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								from pathlib import Path
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 
											3 years ago
										 
									 | 
							
								from system.loggerd.config import ROOT, get_available_percent
							 | 
						||
| 
								 | 
							
								from system.loggerd.tests.loggerd_tests_common import create_random_file
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if __name__ == "__main__":
							 | 
						||
| 
								 | 
							
								  segment_idx = 0
							 | 
						||
| 
								 | 
							
								  while True:
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    seg_name = f"1970-01-01--00-00-00--{segment_idx}"
							 | 
						||
| 
								 | 
							
								    seg_path = Path(ROOT) / seg_name
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								    print(seg_path)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											2 years ago
										 
									 | 
							
								    create_random_file(seg_path / "fcamera.hevc", 36)
							 | 
						||
| 
								 | 
							
								    create_random_file(seg_path / "rlog.bz2", 2)
							 | 
						||
| 
								 
											6 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								    segment_idx += 1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    # Fill up to 99 percent
							 | 
						||
| 
								 | 
							
								    available_percent = get_available_percent()
							 | 
						||
| 
								 | 
							
								    if available_percent < 1.0:
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								      break
							 |