mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
tests/fprintd: Add ability to force-kill the daemon if we're fine to hang
This commit is contained in:
@ -227,6 +227,7 @@ class FPrintdTest(dbusmock.DBusTestCase):
|
|||||||
if os.path.exists(valgrind):
|
if os.path.exists(valgrind):
|
||||||
argv.insert(2, '--suppressions=%s' % valgrind)
|
argv.insert(2, '--suppressions=%s' % valgrind)
|
||||||
self.valgrind = True
|
self.valgrind = True
|
||||||
|
self.kill_daemon = False
|
||||||
self.daemon = subprocess.Popen(argv,
|
self.daemon = subprocess.Popen(argv,
|
||||||
env=env,
|
env=env,
|
||||||
stdout=None,
|
stdout=None,
|
||||||
@ -281,9 +282,18 @@ class FPrintdTest(dbusmock.DBusTestCase):
|
|||||||
self.daemon.terminate()
|
self.daemon.terminate()
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
self.daemon.wait(timeout=get_timeout('daemon_start'))
|
|
||||||
self.assertLess(self.daemon.returncode, 128)
|
try:
|
||||||
self.assertGreaterEqual(self.daemon.returncode, 0)
|
self.daemon.wait(timeout=get_timeout('daemon_stop'))
|
||||||
|
except subprocess.TimeoutExpired as e:
|
||||||
|
if self.kill_daemon:
|
||||||
|
self.daemon.kill()
|
||||||
|
else:
|
||||||
|
raise(e)
|
||||||
|
|
||||||
|
if not self.kill_daemon:
|
||||||
|
self.assertLess(self.daemon.returncode, 128)
|
||||||
|
self.assertGreaterEqual(self.daemon.returncode, 0)
|
||||||
|
|
||||||
self.daemon = None
|
self.daemon = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user