-
Notifications
You must be signed in to change notification settings - Fork 344
Add sshd pester tests #789
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
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull Request Overview
Adds end-to-end Pester tests for the SSH server (sshd
) and a cleanup test for the SSH client, and exposes the sshd
service name in the test helper.
- Introduces
SSHD.Tests.ps1
with two SSHD-focused tests (LoginGraceTime expiry and virtual account spawning) - Extends
SSH.Tests.ps1
to verify that closing an SSH session cleans up child processes - Updates
OpenSSHTestHelper.psm1
to includeSshdServiceName
in the test environment
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
regress/pesterTests/SSHD.Tests.ps1 | New end-to-end tests for sshd child processes and accounts |
regress/pesterTests/SSH.Tests.ps1 | Added test verifying SSH session exit cleans up sshd PIDs |
contrib/win32/openssh/OpenSSHTestHelper.psm1 | Added SshdServiceName entry to $OpenSSHTestInfo |
Co-authored-by: Copilot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
$sshdPidsCountAfter = (Get-Process -Name sshd* | Select-Object -ExpandProperty Id).Count | ||
|
||
if ($sshProc -and !$sshProc.HasExited) { | ||
$sshProc | Stop-Process -Force |
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.
If ssh process hasn't exited, should you also fail the test? Because that means that the time out failed, right?
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.
This cleans up the ssh client process which will still be waiting on user input, even if the server side time out is successful.
PR Summary
PR Context