Skip to content

Conversation

CarstenGrohmann
Copy link
Contributor

@CarstenGrohmann CarstenGrohmann commented Jun 28, 2023

OpenSSH multiplexing needs 3 configuration items:

  • ControlMaster
  • ControlPersist
  • ControlPath

Testinfra uses only the first two and this causes that connection multiplexing is not used:

DEBUG    testinfra:base.py:288 RUN CommandResult(command=b'ssh -o ControlMaster=auto -o ControlPersist=1200 -o ServerAliveInterval=180 -o StrictHostKeyChecking=no -o User=<reducted> -i \'~/.ssh/<reducted>\' -o ConnectTimeout=10 <reducted> \'sudo /bin/sh -c \'"\'"\'<reducted>\'"\'"\'\'', exit_status=0, stdout=b'<reducted>', stderr=None)

In comparison, Ansible uses all 3 parameters:

SSH: EXEC ssh -o ControlMaster=auto -o ControlPersist=1200 -o ServerAliveInterval=180 -o StrictHostKeyChecking=no -o StrictHostKeyChecking=no -o 'IdentityFile="<reducted>"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="<reducted>"' -o ConnectTimeout=10 -o 'ControlPath="<reducted>/.ansible/cp/%C"' <reducted>

With this change the third option to control connection sharing is introduced.

Share your thoughts, please.

OpenSSH multiplexing needs 3 configuration items:
* ControlMaster
* ControlPersist
* ControlPath

Testinfra uses only the first two and this causes that connection multiplexing is not used:

```
DEBUG    testinfra:base.py:288 RUN CommandResult(command=b'ssh -o ControlMaster=auto -o ControlPersist=1200 -o ServerAliveInterval=180 -o StrictHostKeyChecking=no -o User=<reducted> -i \'~/.ssh/<reducted>\' -o ConnectTimeout=10 <reducted> \'sudo /bin/sh -c \'"\'"\'<reducted>\'"\'"\'\'', exit_status=0, stdout=b'<reducted>', stderr=None)
```

In comparison, Ansible uses all 3 parameters:

```
SSH: EXEC ssh -o ControlMaster=auto -o ControlPersist=1200 -o ServerAliveInterval=180 -o StrictHostKeyChecking=no -o StrictHostKeyChecking=no -o 'IdentityFile="<reducted>"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="<reducted>"' -o ConnectTimeout=10 -o 'ControlPath="<reducted>/.ansible/cp/%C"' <reducted>
```

With this change the third option to control connection sharing is introduced.
@philpep philpep merged commit 177947a into pytest-dev:main Aug 24, 2023
@philpep
Copy link
Contributor

philpep commented Aug 24, 2023

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants