-
Notifications
You must be signed in to change notification settings - Fork 75
Ssh Test and Debugging Fixups #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This reverts commit fcbfc49.
This reverts commit a3a82f7.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| _LOG.debug( | ||
| "%s: Establishing client connection to %s", | ||
| connection_id = SshClient.id_from_params(connect_params) | ||
| for i in range(3): # TODO: make the retry count configurable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and add tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and config support
| file_handler.setLevel(logging.DEBUG) | ||
| else: | ||
| file_handler.setLevel(logging.INFO) | ||
| # logging.basicConfig(level=file_handler.level, format=LOG_FMT, datefmt=DATE_FMT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixme - only apply to console logger for pytest
| # NOTE: this cache may become stale in another worker if the | ||
| # container restarts in one and the other worker doesn't notice the new port. | ||
| # Optionally check the status of the cached port before returning it. | ||
| if not check_port or self.validate_connection(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO (possibly future PR): add a test that uses an unvalidated connection.
Useful to check for SshServer error handling.
For instance:
- Connect.
- Execute an OOB (
docker exec) command that sends a SIGSTOP command to the sshd service. - Try to issue a command over SshHostService.
- Check for timeout.
- Check for reconnect.
Pull Request
Title
SSH Test and Debugging Fixups
Description
test_remote_ssh_env#1005 byssh_service.pywait_for_docker_service_healthycheck during test fixture setup to avoid a seeming race between when docker claims containers and ready (and we therefore check the dynamic port mapping) vs when they are actually ready.Type of Change
Testing
Additional Notes (optional)