mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 19:21:35 +08:00
mavsdk_tests: don't clear logs
This commit is contained in:
@@ -176,15 +176,24 @@ class Px4Runner(Runner):
|
|||||||
def clear_rootfs(self) -> None:
|
def clear_rootfs(self) -> None:
|
||||||
rootfs_path = self.cwd
|
rootfs_path = self.cwd
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print("Deleting rootfs: {}".format(rootfs_path))
|
print("Clearing rootfs (except logs): {}".format(rootfs_path))
|
||||||
if os.path.isdir(rootfs_path):
|
for item in os.listdir(rootfs_path):
|
||||||
shutil.rmtree(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:
|
def create_rootfs(self) -> None:
|
||||||
rootfs_path = self.cwd
|
rootfs_path = self.cwd
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print("Creating rootfs: {}".format(rootfs_path))
|
print("Creating rootfs: {}".format(rootfs_path))
|
||||||
os.makedirs(rootfs_path)
|
try:
|
||||||
|
os.makedirs(rootfs_path)
|
||||||
|
except FileExistsError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class GzserverRunner(Runner):
|
class GzserverRunner(Runner):
|
||||||
|
|||||||
Reference in New Issue
Block a user