Browse Source

mavsdk_tests: don't clear logs

release/1.12
Julian Oes 4 years ago committed by Lorenz Meier
parent
commit
2971ce8664
  1. 17
      test/mavsdk_tests/process_helper.py

17
test/mavsdk_tests/process_helper.py

@ -176,15 +176,24 @@ class Px4Runner(Runner): @@ -176,15 +176,24 @@ class Px4Runner(Runner):
def clear_rootfs(self) -> None:
rootfs_path = self.cwd
if self.verbose:
print("Deleting rootfs: {}".format(rootfs_path))
if os.path.isdir(rootfs_path):
shutil.rmtree(rootfs_path)
print("Clearing rootfs (except logs): {}".format(rootfs_path))
for item in os.listdir(rootfs_path):
if item == 'log':
continue
path = os.path.join(rootfs_path, item)
if os.path.isfile(path) or os.path.islink(path):
os.remove(path)
else:
shutil.rmtree(path)
def create_rootfs(self) -> None:
rootfs_path = self.cwd
if self.verbose:
print("Creating rootfs: {}".format(rootfs_path))
os.makedirs(rootfs_path)
try:
os.makedirs(rootfs_path)
except FileExistsError:
pass
class GzserverRunner(Runner):

Loading…
Cancel
Save