mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-07 17:51:29 -07:00
Move persistent connections to only use registered variables (#45616)
* Try to intuit proper plugins to send to ansible-connection * Move sub-plugins to init so that vars will be populated in executor * Fix connection unit tests
This commit is contained in:
parent
86c48205c4
commit
406b59aeba
10 changed files with 98 additions and 109 deletions
|
@ -41,6 +41,7 @@ from ansible.plugins.connection.ssh import Connection as SSHConnection
|
|||
from ansible.plugins.connection.docker import Connection as DockerConnection
|
||||
# from ansible.plugins.connection.winrm import Connection as WinRmConnection
|
||||
from ansible.plugins.connection.network_cli import Connection as NetworkCliConnection
|
||||
from ansible.plugins.connection.httpapi import Connection as HttpapiConnection
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
|
@ -162,11 +163,16 @@ class TestConnectionBaseClass(unittest.TestCase):
|
|||
# self.assertIsInstance(WinRmConnection(), WinRmConnection)
|
||||
|
||||
def test_network_cli_connection_module(self):
|
||||
self.play_context.network_os = 'eos'
|
||||
self.assertIsInstance(NetworkCliConnection(self.play_context, self.in_stream), NetworkCliConnection)
|
||||
|
||||
def test_netconf_connection_module(self):
|
||||
self.assertIsInstance(NetconfConnection(self.play_context, self.in_stream), NetconfConnection)
|
||||
|
||||
def test_httpapi_connection_module(self):
|
||||
self.play_context.network_os = 'eos'
|
||||
self.assertIsInstance(HttpapiConnection(self.play_context, self.in_stream), HttpapiConnection)
|
||||
|
||||
def test_check_password_prompt(self):
|
||||
local = (
|
||||
b'[sudo via ansible, key=ouzmdnewuhucvuaabtjmweasarviygqq] password: \n'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue