-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use single SSH connection for lifetime of microvm
Instead of creating new SSH connections every time we want to run a command inside the microvm, open a single ssh connection in the constructor of `SSHConnection`, and reuse it until we kill the microvm. Use the `fabric` SSH library to achieve this. Since fabric by default does not support opening its connections in specific network namespaces (e.g. ip netns exec), explicitly switch into the target network namespace before establishing the connected. Since entering network namspaces happens per-thread (instead of per-process), this is fine to do even in a highly-multithreaded pytest environment. Signed-off-by: Patrick Roy <[email protected]>
- Loading branch information
Showing
4 changed files
with
68 additions
and
95 deletions.
There are no files selected for viewing
This file contains 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 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 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 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