summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2023-07-04 10:25:44 +0200
committerBastien Nocera <hadess@hadess.net>2023-07-04 10:25:44 +0200
commit648abe9c274271db18496b45c83545e24993a326 (patch)
tree89f3fdd2683ff8faf28da5d55c40ba56919e1684
parenta0c7b16affb1dccc157cd9c64f32160a5270ae73 (diff)
tests: Test a client running while daemon restarts
-rwxr-xr-xsrc/linux/integration-test.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py
index 5692fd3..30a3b52 100755
--- a/src/linux/integration-test.py
+++ b/src/linux/integration-test.py
@@ -197,9 +197,9 @@ class Tests(dbusmock.DBusTestCase):
self.daemon_log = OutputChecker()
if os.getenv('VALGRIND') != None:
- daemon_path = ['valgrind', self.daemon_path, '-v']
+ daemon_path = ['valgrind', self.daemon_path, '-v', '-r']
else:
- daemon_path = [self.daemon_path, '-v']
+ daemon_path = [self.daemon_path, '-v', '-r']
self.daemon = subprocess.Popen(daemon_path,
env=env, stdout=self.daemon_log.fd,
stderr=subprocess.STDOUT)
@@ -2495,6 +2495,27 @@ class Tests(dbusmock.DBusTestCase):
self.stop_daemon()
+ def test_daemon_restart(self):
+
+ self.testbed.add_from_file(os.path.join(edir, 'tests/usb-headset.device'))
+ bat = '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.3/0003:046D:0A87.0004/power_supply/hidpp_battery_0'
+
+ upower_path = os.path.dirname(os.path.dirname(self.daemon_path)) + '/tools/upower'
+ self.start_daemon()
+ process = subprocess.Popen([upower_path, '-m'])
+
+ for i in range(10):
+ # Replace daemon
+ self.start_daemon()
+
+ self.testbed.uevent(bat, 'change')
+
+ # Check that upower is still running
+ self.assertIsNone(process.returncode)
+
+ process.terminate()
+ self.stop_daemon()
+
def test_remove(self):
'Test removing when parent ID lookup stops working'