All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test-runner: clean up dbus path file properly
@ 2021-02-08 17:53 James Prestwood
  2021-02-08 17:57 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2021-02-08 17:53 UTC (permalink / raw)
  To: iwd

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

Dbus should be started as a multi-test process from the
TestContext, which leaves the dbus address file around for
the full test run. For Namespaces dbus-daemon should be
closed when the Namespace closes.
---
 tools/test-runner | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/test-runner b/tools/test-runner
index d50d3abd..965b0a57 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -474,6 +474,7 @@ class Namespace:
 	dbus_address = None
 	processes = []
 	radios = []
+	dbus_pid = None
 
 	def __init__(self, args, name, radios):
 		self.name = name
@@ -484,7 +485,7 @@ class Namespace:
 		for r in radios:
 			Process(['iw', 'phy', r.name, 'set', 'netns', 'name', name], wait=True)
 
-		self.start_dbus(multi_test=False)
+		self.dbus_pid = self.start_dbus(multi_test=False)
 
 	def reset(self):
 		self.radios = []
@@ -497,7 +498,8 @@ class Namespace:
 			print("Killing process %s" % p.name)
 			self.stop_process(p)
 
-		os.remove(self.dbus_address.split('=')[1])
+		if self.dbus_pid and not self.dbus_pid.multi_test:
+			os.remove(self.dbus_address.split('=')[1])
 
 	def __del__(self):
 		print("Removing namespace %s" % self.name)
@@ -1119,7 +1121,7 @@ def print_results(results):
 def run_auto_tests(ctx, args):
 	tests = build_test_list(args)
 
-	ctx.start_dbus()
+	ctx.start_dbus(multi_test=True)
 	ctx.start_haveged()
 
 	# Copy autotests/misc/{certs,secrets,phonesim} so any test can refer to them
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-runner: clean up dbus path file properly
  2021-02-08 17:53 [PATCH] test-runner: clean up dbus path file properly James Prestwood
@ 2021-02-08 17:57 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-02-08 17:57 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 2/8/21 11:53 AM, James Prestwood wrote:
> Dbus should be started as a multi-test process from the
> TestContext, which leaves the dbus address file around for
> the full test run. For Namespaces dbus-daemon should be
> closed when the Namespace closes.
> ---
>   tools/test-runner | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-08 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 17:53 [PATCH] test-runner: clean up dbus path file properly James Prestwood
2021-02-08 17:57 ` Denis Kenzior

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.