2017-09-16 10:06:08 +00:00
|
|
|
|
2017-09-17 15:49:06 +00:00
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import unittest
|
2017-09-16 10:06:08 +00:00
|
|
|
|
|
|
|
import mitogen.fakessh
|
|
|
|
|
2017-09-17 15:49:06 +00:00
|
|
|
import testlib
|
2017-09-16 10:06:08 +00:00
|
|
|
|
|
|
|
|
2017-09-17 15:49:06 +00:00
|
|
|
class RsyncTest(testlib.DockerMixin, unittest.TestCase):
|
|
|
|
def test_rsync_from_master(self):
|
|
|
|
context = self.docker_ssh_any()
|
2017-09-21 07:36:59 +00:00
|
|
|
|
|
|
|
if context.call(os.path.exists, '/tmp/data'):
|
|
|
|
context.call(shutil.rmtree, '/tmp/data')
|
|
|
|
|
|
|
|
return_code = mitogen.fakessh.run(context, self.router, [
|
2017-09-17 15:49:06 +00:00
|
|
|
'rsync', '--progress', '-vvva',
|
|
|
|
testlib.data_path('.'), 'target:/tmp/data'
|
|
|
|
])
|
2017-09-21 07:36:59 +00:00
|
|
|
|
|
|
|
assert return_code == 0
|
2017-09-17 15:49:06 +00:00
|
|
|
assert context.call(os.path.exists, '/tmp/data')
|
|
|
|
assert context.call(os.path.exists, '/tmp/data/simple_pkg/a.py')
|
2017-09-16 10:06:08 +00:00
|
|
|
|