Skip to content

Commit 8453474

Browse files
authored
Dropped outdated arcfour cipher (#12)
OpenSSL 7.6 removed support for arcfour. rsync which uses ssh is trying to establish connection with use of it. For newer installations this process is ending with an error to establish connection. Replaced arcfour with [email protected] to allow it to work. However, user can overwrite this by providing --cloud-rsync-cipher argument
1 parent 7870310 commit 8453474

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Authors
99
These people have contributed to `pytest-cloud`, in alphabetical order:
1010

1111
* `Andreas Pelme <[email protected]>`_
12+
* `Dariusz Smigiel <[email protected]>`_
1213
* `Loic Dachary <[email protected]>`_
1314
* `Michael Overmeyer <[email protected]>`_
1415
* `Orthographic Pedant <[email protected]>`_

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
3.1.0
5+
-----
6+
7+
- Add config option to select cipher for ssh connection (dasm)
8+
49
3.0.1
510
-----
611

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ Command-line options
8585
Optional process count limit for `rsync` processes. By default there's no limit so rsyncing will be in parallel
8686
for all test nodes.
8787

88+
* `--cloud-rsync-cipher`
89+
Optional ssh cipher selection for `rsync` processes. [email protected] by default.
90+
Default cipher is chosen to have the least possible network overhead. Network overhead is system, compilation
91+
and CPU architecture dependent, however chosen cipher is showing good results in majority of use cases.
8892

8993
Ini file options
9094
----------------

pytest_cloud/plugin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def pytest_addoption(parser):
121121
"--cloud-rsync-bandwidth-limit",
122122
help="maximum number of processes per test node", type='int', action="store",
123123
dest='cloud_rsync_bandwidth_limit', metavar="NUMBER", default=10000)
124+
parser.addoption(
125+
"--cloud-rsync-cipher",
126+
help="cipher for ssh connection used by rsync", type=str,
127+
dest="cloud_rsync_cipher", metavar="STRING", default="[email protected]")
124128
parser.addini(
125129
'cloud_develop_eggs', 'list of python package paths to install in develop mode on the remote side',
126130
type="pathlist")
@@ -216,7 +220,7 @@ def get_develop_eggs(root_dir, config):
216220

217221
def get_nodes_specs(
218222
nodes, python=None, chdir=None, virtualenv_path=None, mem_per_process=None,
219-
max_processes=None, rsync_max_processes=None, rsync_bandwidth_limit=None, config=None):
223+
max_processes=None, rsync_max_processes=None, rsync_bandwidth_limit=None, rsync_cipher=None, config=None):
220224
"""Get nodes specs.
221225
222226
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(
262266
jobs=rsync_max_processes or len(nodes),
263267
bwlimit=rsync_bandwidth_limit,
264268
bandwidth_limit=rsync_bandwidth_limit,
269+
ssh_cipher=rsync_cipher,
265270
**n_m.rsyncoptions)
266271
print('Detecting connectable test nodes...')
267272
for node in nodes:
@@ -326,6 +331,7 @@ def check_options(config):
326331
rsync_bandwidth_limit=config.option.cloud_rsync_bandwidth_limit,
327332
max_processes=config.option.cloud_max_processes,
328333
mem_per_process=mem_per_process,
334+
rsync_cipher=config.option.cloud_rsync_cipher,
329335
config=config)
330336
if node_specs:
331337
print('Scheduling with {0} parallel test sessions'.format(len(node_specs)))

pytest_cloud/rsync.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RSync(object):
3333
# pylint: disable=R0913,W0613
3434
def __init__(
3535
self, sourcedir, targetdir, verbose=False, ignores=None, includes=None, jobs=None, debug=False,
36-
bwlimit=None, **kwargs):
36+
bwlimit=None, ssh_cipher=None, **kwargs):
3737
"""Initialize new RSync instance."""
3838
self.sourcedir = str(sourcedir)
3939
self.targetdir = str(targetdir)
@@ -44,6 +44,7 @@ def __init__(
4444
self.targets = set()
4545
self.jobs = jobs
4646
self.bwlimit = bwlimit
47+
self.ssh_cipher = ssh_cipher
4748

4849
def get_ignores(self):
4950
"""Get ignores."""
@@ -86,10 +87,11 @@ def send(self, raises=True):
8687
'--inplace '
8788
'--delete-excluded '
8889
'--delete '
89-
'-e \"ssh -T -c arcfour -o Compression=no -x\" '
90+
'-e \"ssh -T -c {ssh_cipher} -o Compression=no -x\" '
9091
'. {{}}:{chdir}'.format(
9192
verbose='v' if self.verbose else '',
9293
bwlimit='--bwlimit={0} '.format(self.bwlimit) if self.bwlimit else '',
94+
ssh_cipher=self.ssh_cipher,
9395
chdir=self.targetdir,
9496
ignores=ignores_path,
9597
includes=includes_path,

0 commit comments

Comments
 (0)