diff --git a/AUTHORS.rst b/AUTHORS.rst index a76200a..b65ce46 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -9,6 +9,7 @@ Authors These people have contributed to `pytest-cloud`, in alphabetical order: * `Andreas Pelme `_ +* `Dariusz Smigiel `_ * `Loic Dachary `_ * `Michael Overmeyer `_ * `Orthographic Pedant `_ diff --git a/CHANGES.rst b/CHANGES.rst index ef5de11..fbe6e6c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changelog ========= +3.1.0 +----- + +- Add config option to select cipher for ssh connection (dasm) + 3.0.1 ----- diff --git a/README.rst b/README.rst index 1da9ad6..30dc300 100644 --- a/README.rst +++ b/README.rst @@ -85,6 +85,10 @@ Command-line options Optional process count limit for `rsync` processes. By default there's no limit so rsyncing will be in parallel for all test nodes. +* `--cloud-rsync-cipher` + Optional ssh cipher selection for `rsync` processes. aes128-gcm@openssh.com by default. + Default cipher is chosen to have the least possible network overhead. Network overhead is system, compilation + and CPU architecture dependent, however chosen cipher is showing good results in majority of use cases. Ini file options ---------------- diff --git a/pytest_cloud/plugin.py b/pytest_cloud/plugin.py index 6847327..3413df6 100644 --- a/pytest_cloud/plugin.py +++ b/pytest_cloud/plugin.py @@ -121,6 +121,10 @@ def pytest_addoption(parser): "--cloud-rsync-bandwidth-limit", help="maximum number of processes per test node", type='int', action="store", dest='cloud_rsync_bandwidth_limit', metavar="NUMBER", default=10000) + parser.addoption( + "--cloud-rsync-cipher", + help="cipher for ssh connection used by rsync", type=str, + dest="cloud_rsync_cipher", metavar="STRING", default="aes128-gcm@openssh.com") parser.addini( 'cloud_develop_eggs', 'list of python package paths to install in develop mode on the remote side', type="pathlist") @@ -216,7 +220,7 @@ def get_develop_eggs(root_dir, config): def get_nodes_specs( nodes, python=None, chdir=None, virtualenv_path=None, mem_per_process=None, - max_processes=None, rsync_max_processes=None, rsync_bandwidth_limit=None, config=None): + max_processes=None, rsync_max_processes=None, rsync_bandwidth_limit=None, rsync_cipher=None, config=None): """Get nodes specs. Get list of node names, connect to each of them, get the system information, produce the list of node specs out of @@ -262,6 +266,7 @@ def get_nodes_specs( jobs=rsync_max_processes or len(nodes), bwlimit=rsync_bandwidth_limit, bandwidth_limit=rsync_bandwidth_limit, + ssh_cipher=rsync_cipher, **n_m.rsyncoptions) print('Detecting connectable test nodes...') for node in nodes: @@ -326,6 +331,7 @@ def check_options(config): rsync_bandwidth_limit=config.option.cloud_rsync_bandwidth_limit, max_processes=config.option.cloud_max_processes, mem_per_process=mem_per_process, + rsync_cipher=config.option.cloud_rsync_cipher, config=config) if node_specs: print('Scheduling with {0} parallel test sessions'.format(len(node_specs))) diff --git a/pytest_cloud/rsync.py b/pytest_cloud/rsync.py index f9715cc..15ddec4 100644 --- a/pytest_cloud/rsync.py +++ b/pytest_cloud/rsync.py @@ -33,7 +33,7 @@ class RSync(object): # pylint: disable=R0913,W0613 def __init__( self, sourcedir, targetdir, verbose=False, ignores=None, includes=None, jobs=None, debug=False, - bwlimit=None, **kwargs): + bwlimit=None, ssh_cipher=None, **kwargs): """Initialize new RSync instance.""" self.sourcedir = str(sourcedir) self.targetdir = str(targetdir) @@ -44,6 +44,7 @@ def __init__( self.targets = set() self.jobs = jobs self.bwlimit = bwlimit + self.ssh_cipher = ssh_cipher def get_ignores(self): """Get ignores.""" @@ -86,10 +87,11 @@ def send(self, raises=True): '--inplace ' '--delete-excluded ' '--delete ' - '-e \"ssh -T -c arcfour -o Compression=no -x\" ' + '-e \"ssh -T -c {ssh_cipher} -o Compression=no -x\" ' '. {{}}:{chdir}'.format( verbose='v' if self.verbose else '', bwlimit='--bwlimit={0} '.format(self.bwlimit) if self.bwlimit else '', + ssh_cipher=self.ssh_cipher, chdir=self.targetdir, ignores=ignores_path, includes=includes_path,