forked from machacekondra/python-rrmngmnt
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dca6c35
commit cbae844
Showing
4 changed files
with
61 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from rrmngmnt import Host, User | ||
|
||
from tests.common import FakeExecutorFactory | ||
|
||
|
||
def get_host(hostname='test-host'): | ||
return Host(hostname=hostname) | ||
|
||
|
||
def test_executor_with_proxy_command(): | ||
data = { | ||
'which systemctl': (0, '/usr/bin/systemctl', ''), | ||
} | ||
host = get_host() | ||
sock = 'my proxy command --stdio=true test-host 22' | ||
host_user = User(name="user", password="user") | ||
host.executor_user = host_user | ||
host.executor_factory = FakeExecutorFactory( | ||
cmd_to_data=data, files_content=None | ||
) | ||
host.executor_factory.sock = sock | ||
host.executor().run_cmd(['which', 'systemctl']) |