mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-21 22:09:23 +01:00
test-runner: skip mounting duplicate folders
If the user specifies the same parent directory for several outfiles skip mounting since it already exists. For example: --monitor /outfiles/monitor.txt --result /outfiles/result.txt
This commit is contained in:
parent
1e6773d2a7
commit
87bb9a42b5
@ -289,7 +289,13 @@ class RunnerAbstract:
|
|||||||
|
|
||||||
# For QEMU/UML runners
|
# For QEMU/UML runners
|
||||||
def _prepare_mounts(self, extra=[]):
|
def _prepare_mounts(self, extra=[]):
|
||||||
|
mounted = []
|
||||||
|
|
||||||
for entry in mounts_common + extra:
|
for entry in mounts_common + extra:
|
||||||
|
if entry.target in mounted:
|
||||||
|
print("%s already mounted, skipping" % entry.target)
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.lstat(entry.target)
|
os.lstat(entry.target)
|
||||||
except:
|
except:
|
||||||
@ -298,6 +304,8 @@ class RunnerAbstract:
|
|||||||
mount(entry.source, entry.target, entry.fstype, entry.flags,
|
mount(entry.source, entry.target, entry.fstype, entry.flags,
|
||||||
entry.options)
|
entry.options)
|
||||||
|
|
||||||
|
mounted.append(entry.target)
|
||||||
|
|
||||||
for entry in dev_table:
|
for entry in dev_table:
|
||||||
os.symlink(entry.target, entry.linkpath)
|
os.symlink(entry.target, entry.linkpath)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user