forked from Archive/PX4-Autopilot
mavsdk_tests: clear params between test cases
This commit is contained in:
parent
a5a577a6c4
commit
630a6f3810
|
@ -3,6 +3,7 @@
|
|||
import argparse
|
||||
import datetime
|
||||
import fnmatch
|
||||
import glob
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
|
@ -276,7 +277,7 @@ class Tester:
|
|||
|
||||
log_dir = self.get_log_dir(iteration, test['model'], key)
|
||||
if self.verbose:
|
||||
print("creating log directory: {}"
|
||||
print("Creating log directory: {}"
|
||||
.format(log_dir))
|
||||
os.makedirs(log_dir, exist_ok=True)
|
||||
|
||||
|
@ -325,6 +326,8 @@ class Tester:
|
|||
def run_test_case(self, test: Dict[str, Any],
|
||||
case: str, log_dir: str) -> bool:
|
||||
|
||||
self.clear_params()
|
||||
|
||||
self.start_runners(log_dir, test, case)
|
||||
|
||||
logfile_path = self.determine_logfile_path(log_dir, 'combined')
|
||||
|
@ -366,6 +369,15 @@ class Tester:
|
|||
print(" - {}".format(runner.get_log_filename()))
|
||||
return is_success
|
||||
|
||||
def clear_params(self):
|
||||
param_files = glob.glob(
|
||||
"build/px4_sitl_default/tmp/rootfs/eeprom/parameters_*",
|
||||
recursive=False)
|
||||
for param_file in param_files:
|
||||
if self.verbose:
|
||||
print("Deleting param file: {}".format(param_file))
|
||||
os.unlink(param_file)
|
||||
|
||||
def start_runners(self,
|
||||
log_dir: str,
|
||||
test: Dict[str, Any],
|
||||
|
|
Loading…
Reference in New Issue