-
Notifications
You must be signed in to change notification settings - Fork 6
Use ssh2 instead of std::process::Command #172
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
Open
kjughx
wants to merge
31
commits into
AxisCommunications:main
Choose a base branch
from
kjughx:rust-ssh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ed6d619
Use ssh2 instead of std::process::Command
c5811d8
Append ssh port if not already there
61d992c
Add missing G_SLICE env variable
a566f08
Use process::Command to construct shell command
ee2828c
Set G_SLICE in acap-ssh-utils instead
327dc82
Handle the exit_status of remote program
7bc38a0
Channels can't be reused so create it only when needed
c236986
Use bail! macro
38a275d
Return Vec<u8> from exec_capture_output
537e846
Make session blocking
1cbac37
Change println! to debug!
1d8fd32
Handle root/acap user differently
ede5781
Change unwrap to expect for clarity
193268f
Remove unnecessary assignment
6cb7f19
Always append port 22 to host
f832a11
Handle directories with sftp
5580324
Handle arguments to remote programs when using 'su'
6df6689
Add contexts to fallible sftp calls
67ad2e5
Fix lint
ac11ef6
Merge remote-tracking branch 'upstream/main' into rust-ssh
d1f8363
Update docstrings
1f2dd63
Remove sshpass from system requirements
5e8ff7a
Use is_ok_and instead of expect
feecdbb
Merge remote-tracking branch 'upstream/main' into rust-ssh
ecd277e
Change `as_root` to `as_package_user`
29aa98b
Handle symlinks
3020e38
Change CWD when running ACAP
7afa257
Use `with_context` instead of `context`
1757a27
Avoid unnecessary `unwrap`s
020cfb9
Pass arguments correctly + test
94ee183
Reformat
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,4 @@ apt-get install \ | |
libglib2.0-dev \ | ||
libssl-dev \ | ||
pkg-config \ | ||
python3-venv \ | ||
sshpass | ||
python3-venv |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
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.
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.
I like the idea of adding more automated tests.
However, the intention behind these tests is not only to ensure that apps are invoked as expected using the
run
andtest
commands, but also to help ensure that the way these commands invoke our program is the same as the way the ACAP system in the camera invokes our program. As such, these should all pass if the app is installed and started the "normal" way e.g. using the GUI.My thinking is roughly:
So these should give the same results (all tests passing):
cargo-acap-sdk install -- -p inspect_env --tests && cargo-acap-sdk start -p inspect_env
cargo-acap-sdk test -- -p inspect_env
That being said, as I was writing the above I realized that this is not true for tests that cannot run in parallel, which is why I added
--test-threads=1
in the first place. My best idea for how to solve this right now is to establish the convention that tests that require--test-threads=1
should beignore
d and that thetest
command also sets--ignored
. Not fantastic, but could work.What do you think?
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.
Another idea is to rewrite mutually exclusive tests as integration tests. This probably works out of the box if the crate has an ACAP manifest in the Cargo manifest directory, as all the apps do.