diff options
Diffstat (limited to 'oslo_rootwrap/tests/test_functional.py')
-rw-r--r-- | oslo_rootwrap/tests/test_functional.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/oslo_rootwrap/tests/test_functional.py b/oslo_rootwrap/tests/test_functional.py index 83825a5..e61c247 100644 --- a/oslo_rootwrap/tests/test_functional.py +++ b/oslo_rootwrap/tests/test_functional.py @@ -21,6 +21,7 @@ import pwd import signal import sys import threading +import time try: import eventlet @@ -50,6 +51,7 @@ class _FunctionalBase(object): with open(self.config_file, 'w') as f: f.write("""[DEFAULT] filters_path=%s +daemon_timeout=10 exec_dirs=/bin""" % (filters_dir,)) with open(filters_file, 'w') as f: f.write("""[Filters] @@ -200,6 +202,15 @@ class RootwrapDaemonTest(_FunctionalBase, testtools.TestCase): # Expect client to successfully restart daemon and run simple request self.test_run_once() + def test_daemon_timeout(self): + # Let the client start a daemon + self.execute(['echo']) + # Make daemon timeout + with mock.patch.object(self.client, '_restart') as restart: + time.sleep(15) + self.execute(['echo']) + restart.assert_called_once() + def _exec_thread(self, fifo_path): try: # Run a shell script that signals calling process through FIFO and |