mirror of
https://github.com/nestriness/cdc-file-transfer.git
synced 2026-05-01 18:23:07 +03:00
[cdc_rsync] Add initial support for Windows (#51)
Adds a ServerArch class whose job it is to encapsulate differences between Windows and Linux cdc_rsync_servers. It detects the type based on a heuristic in the destination path. This is not fool proof and will probably require further work, like falling back to the other type if the detected one doesn't work. Uses the ServerArch class to determine the different commands to start the server and to deploy the server. Note that the functionality is not well tested on Windows yet, but copying plain files works.
This commit is contained in:
@@ -57,7 +57,7 @@ class ConnectionTest(test_base.CdcRsyncTest):
|
||||
res = utils.run_rsync(self.local_data_path,
|
||||
bad_host + ":" + self.remote_base_dir)
|
||||
self.assertEqual(res.returncode, RETURN_CODE_GENERIC_ERROR)
|
||||
self.assertIn('lost connection', str(res.stderr))
|
||||
self.assertIn('Failed to find available ports', str(res.stderr))
|
||||
|
||||
def test_contimeout(self):
|
||||
"""Runs rsync with --contimeout option for an invalid ip.
|
||||
|
||||
@@ -45,9 +45,9 @@ class DeploymentTest(test_base.CdcRsyncTest):
|
||||
utils.get_ssh_command_output('rm %s' % (REMOTE_FOLDER + file + '.tmp'))
|
||||
|
||||
def test_no_server(self):
|
||||
"""Checks that cdc_rsync_server is uploaded if not present on the gamelet.
|
||||
"""Checks that cdc_rsync_server is uploaded if not present remotely.
|
||||
|
||||
1) Wipes ‘/opt/developer/tools/bin/’ on the gamelet.
|
||||
1) Wipes |REMOTE_FOLDER|.
|
||||
2) Uploads a file.
|
||||
3) Verifies that cdc_rsync_server exists in that folder.
|
||||
"""
|
||||
|
||||
@@ -71,15 +71,6 @@ class UploadTest(test_base.CdcRsyncTest):
|
||||
self.assertTrue(
|
||||
utils.sha1_matches(self.local_data_path, self.remote_data_path))
|
||||
|
||||
def test_backslash_in_dest_folder(self):
|
||||
r"""Verifies uploading to \mnt\developer."""
|
||||
|
||||
filepath = os.path.join(self.local_base_dir, 'file1.txt')
|
||||
utils.create_test_file(filepath, 1)
|
||||
res = utils.run_rsync(filepath, self.remote_base_dir.replace('/', '\\'))
|
||||
self.assertTrue(utils.files_count_is(res, missing=1))
|
||||
self._assert_remote_dir_contains(['file1.txt'])
|
||||
|
||||
def test_backslash_in_source_folder(self):
|
||||
r"""Verifies uploading from /source/folder."""
|
||||
|
||||
@@ -858,7 +849,7 @@ class UploadTest(test_base.CdcRsyncTest):
|
||||
remote_exe_path = self.remote_base_dir + os.path.basename(local_exe_path)
|
||||
remote_elf_path = self.remote_base_dir + os.path.basename(local_elf_path)
|
||||
|
||||
# Copy the files to the gamelet.
|
||||
# Copy the files to the remote instance.
|
||||
res = utils.run_rsync(local_exe_path, local_elf_path, self.remote_base_dir)
|
||||
self._assert_rsync_success(res)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user