From abd16b5911abe05175529e67ad07809ab9a98845 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 29 Sep 2021 11:21:26 +0200 Subject: [PATCH] tests: Start mock polkitd in the tests And allow all us to perform all the actions. --- tests/integration-test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration-test.py b/tests/integration-test.py index ceea527..b03e6b9 100755 --- a/tests/integration-test.py +++ b/tests/integration-test.py @@ -108,6 +108,9 @@ class Tests(dbusmock.DBusTestCase): The testbed is initially empty. ''' self.testbed = UMockdev.Testbed.new() + self.polkitd, obj_polkit = self.spawn_server_template( + 'polkitd', {}, stdout=subprocess.PIPE) + obj_polkit.SetAllowed(['net.hadess.SensorProxy.claim-sensor']) self.proxy = None self.log = None @@ -117,6 +120,14 @@ class Tests(dbusmock.DBusTestCase): del self.testbed self.stop_daemon() + if self.polkitd: + try: + self.polkitd.kill() + except OSError: + pass + self.polkitd.wait() + self.polkitd = None + # on failures, print daemon log errors = [x[1] for x in self._outcome.errors if x[1]] if errors and self.log: