From 90b695cfdf7ac3b27b1dcde5acbe9f84fc544aed Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 18 Feb 2021 12:19:33 -0800 Subject: [PATCH] test-runner: fix start_dbus and clean up config start_dbus was not returning the Process class which was expected by the caller. This resulted in the config not being cleaned up. --- tools/test-runner | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/test-runner b/tools/test-runner index c9f624d4..662931b1 100755 --- a/tools/test-runner +++ b/tools/test-runner @@ -553,7 +553,7 @@ class Namespace: self.stop_process(p) if self.dbus_pid and not self.dbus_pid.multi_test: - os.remove(self.dbus_address.split('=')[1]) + os.remove(self.dbus_cfg) def __del__(self): print("Removing namespace %s" % self.name) @@ -598,21 +598,23 @@ class Namespace: global dbus_count self.dbus_address = 'unix:path=/tmp/dbus%d' % dbus_count - dbus_cfg = '/tmp/dbus%d.conf' % dbus_count + self.dbus_cfg = '/tmp/dbus%d.conf' % dbus_count dbus_count += 1 - with open(dbus_cfg, 'w+') as f: + with open(self.dbus_cfg, 'w+') as f: f.write(dbus_config) f.write('%s\n' % self.dbus_address) f.write('\n') - p = self.start_process(['dbus-daemon', '--config-file=%s' % dbus_cfg], + p = self.start_process(['dbus-daemon', '--config-file=%s' % self.dbus_cfg], wait=False, multi_test=multi_test) p.wait_for_socket(self.dbus_address.split('=')[1], wait=5) self._bus = dbus.bus.BusConnection(address_or_type=self.dbus_address) + return p + def start_iwd(self, config_dir = '/tmp', storage_dir = '/tmp/iwd'): args = [] iwd_radios = ','.join([r.name for r in self.radios if r.use == 'iwd'])