fakessh_test: Apply timeout decorators to rsync tests

timeoutcontext.timeout uses SIGALRM, hence it will only work on Unix
like operating systems.
pull/180/head
Alex Willmer 7 years ago
parent 3dc90b7618
commit 841c2b13a1

@ -9,6 +9,7 @@ pytest-catchlog==1.2.2
pytest==3.1.2 pytest==3.1.2
PyYAML==3.11; python_version < '2.7' PyYAML==3.11; python_version < '2.7'
PyYAML==3.12; python_version >= '2.7' PyYAML==3.12; python_version >= '2.7'
timeoutcontext==1.2.0
unittest2==1.1.0 unittest2==1.1.0
# Fix InsecurePlatformWarning while creating py26 tox environment # Fix InsecurePlatformWarning while creating py26 tox environment
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings # https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

@ -2,6 +2,7 @@
import os import os
import shutil import shutil
import timeoutcontext
import unittest2 import unittest2
import mitogen.fakessh import mitogen.fakessh
@ -10,6 +11,7 @@ import testlib
class RsyncTest(testlib.DockerMixin, unittest2.TestCase): class RsyncTest(testlib.DockerMixin, unittest2.TestCase):
@timeoutcontext.timeout(5)
def test_rsync_from_master(self): def test_rsync_from_master(self):
context = self.docker_ssh_any() context = self.docker_ssh_any()
@ -25,6 +27,7 @@ class RsyncTest(testlib.DockerMixin, unittest2.TestCase):
self.assertTrue(context.call(os.path.exists, '/tmp/data')) self.assertTrue(context.call(os.path.exists, '/tmp/data'))
self.assertTrue(context.call(os.path.exists, '/tmp/data/simple_pkg/a.py')) self.assertTrue(context.call(os.path.exists, '/tmp/data/simple_pkg/a.py'))
@timeoutcontext.timeout(5)
def test_rsync_between_direct_children(self): def test_rsync_between_direct_children(self):
# master -> SSH -> has-sudo-pubkey -> rsync(.ssh) -> master -> # master -> SSH -> has-sudo-pubkey -> rsync(.ssh) -> master ->
# has-sudo -> rsync # has-sudo -> rsync

Loading…
Cancel
Save