mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-23 17:39:09 -07:00
Add platform facts in network facts modules (#51434)
* Add platform facts in network facts modules Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add nxos Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add vyos Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add iosxr Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add junos Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix pep8 Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * update unit test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix vyos_facts unittest Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix ios_facts unittest Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix iosxr unittests Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix CI failure Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * fix junos test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
5cd7bf39dd
commit
a41028244d
16 changed files with 303 additions and 180 deletions
|
@ -49,9 +49,6 @@ class TestJunosCommandModule(TestJunosModule):
|
|||
self.mock_get_config = patch('ansible.modules.network.junos.junos_facts.get_configuration')
|
||||
self.get_config = self.mock_get_config.start()
|
||||
|
||||
self.mock_conn = patch('ansible.module_utils.connection.Connection')
|
||||
self.conn = self.mock_conn.start()
|
||||
|
||||
self.mock_netconf = patch('ansible.module_utils.network.junos.junos.NetconfConnection')
|
||||
self.netconf_conn = self.mock_netconf.start()
|
||||
|
||||
|
@ -61,13 +58,20 @@ class TestJunosCommandModule(TestJunosModule):
|
|||
self.mock_netconf_rpc = patch('ansible.module_utils.network.common.netconf.NetconfConnection')
|
||||
self.netconf_rpc = self.mock_netconf_rpc.start()
|
||||
|
||||
self.mock_get_capabilities = patch('ansible.module_utils.network.junos.junos.get_capabilities')
|
||||
self.mock_get_capabilities = patch('ansible.modules.network.junos.junos_facts.get_capabilities')
|
||||
self.get_capabilities = self.mock_get_capabilities.start()
|
||||
self.get_capabilities.return_value = {'network_api': 'netconf'}
|
||||
self.get_capabilities.return_value = {
|
||||
'device_info': {
|
||||
'network_os': 'junos',
|
||||
'network_os_hostname': 'vsrx01',
|
||||
'network_os_model': 'vsrx',
|
||||
'network_os_version': '17.3R1.10'
|
||||
},
|
||||
'network_api': 'netconf'
|
||||
}
|
||||
|
||||
def tearDown(self):
|
||||
super(TestJunosCommandModule, self).tearDown()
|
||||
self.mock_conn.stop()
|
||||
self.mock_netconf.stop()
|
||||
self.mock_exec_rpc.stop()
|
||||
self.mock_netconf_rpc.stop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue