All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] test-runner: skip mounting duplicate folders
@ 2022-05-25 19:23 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2022-05-25 19:23 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

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
---
 tools/runner.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/runner.py b/tools/runner.py
index 90818ef1..bf28d9ad 100644
--- a/tools/runner.py
+++ b/tools/runner.py
@@ -289,7 +289,13 @@ class RunnerAbstract:
 
 	# For QEMU/UML runners
 	def _prepare_mounts(self, extra=[]):
+		mounted = []
+
 		for entry in mounts_common + extra:
+			if entry.target in mounted:
+				print("%s already mounted, skipping" % entry.target)
+				continue
+
 			try:
 				os.lstat(entry.target)
 			except:
@@ -298,6 +304,8 @@ class RunnerAbstract:
 			mount(entry.source, entry.target, entry.fstype, entry.flags,
 				entry.options)
 
+			mounted.append(entry.target)
+
 		for entry in dev_table:
 			os.symlink(entry.target, entry.linkpath)
 
-- 
2.34.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-25 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 19:23 [PATCH 3/5] test-runner: skip mounting duplicate folders James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.