Refactor shell management and add SFTP integration tests#417
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
==========================================
+ Coverage 63.89% 64.03% +0.14%
==========================================
Files 353 353
Lines 68359 68307 -52
==========================================
+ Hits 43675 43743 +68
+ Misses 20080 19946 -134
- Partials 4604 4618 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to SSH server handling and testing, particularly focusing on SFTP support and command execution reliability. It also removes unused shell management code from the server management module. The most significant changes are grouped as follows:
SSH Server Improvements:
sshdnow sets the working directory explicitly using the first entry inFileDirs, improving SFTP session consistency.WaitGroupinstead of async.Onceclosure, ensuring all output streams are properly closed before the session ends. This prevents premature session closure and potential race conditions. [1] [2] [3] [4] [5]Testing Enhancements:
TestSSHSftp) to verify directory creation, file upload, file stat, directory listing, and file download functionality over SFTP.TestSSHCommandsandSSHTestCommand) to validate command execution and output matching, improving test coverage for SSH interactions.Code Cleanup:
ListShell,AddShell,DelShell, and related types) fromsvrmgmt.go, simplifying the server management codebase. [1] [2]