def test_ios_facts_neighbors(self): set_module_args(dict(gather_subset="interfaces")) result = self.execute_module() assertCountEqual( self, result["ansible_facts"]["ansible_net_neighbors"].keys(), ["GigabitEthernet1", "GigabitEthernet3"], ) assertCountEqual( self, result["ansible_facts"]["ansible_net_neighbors"] ["GigabitEthernet1"], [ { "platform": "cisco CSR1000V", "host": "R2", "port": "GigabitEthernet2", }, { "platform": "cisco CSR1000V", "host": "R3", "port": "GigabitEthernet3", }, ], ) assertCountEqual( self, result["ansible_facts"]["ansible_net_neighbors"] ["GigabitEthernet3"], [{ "host": "Rtest", "port": "Gi1" }], )
def test_ios_facts_neighbors(self): set_module_args(dict(gather_subset='interfaces')) result = self.execute_module() assertCountEqual( self, result['ansible_facts']['ansible_net_neighbors'].keys(), ['GigabitEthernet1', 'GigabitEthernet3'] ) assertCountEqual( self, result['ansible_facts']['ansible_net_neighbors']['GigabitEthernet1'], [{'host': 'R2', 'port': 'GigabitEthernet2'}, {'host': 'R3', 'port': 'GigabitEthernet3'}] ) assertCountEqual( self, result['ansible_facts']['ansible_net_neighbors']['GigabitEthernet3'], [{'host': 'Rtest', 'port': 'Gi1'}] )
def test_qnos_facts_neighbors(self): set_module_args(dict(gather_subset='interfaces')) result = self.execute_module() assertCountEqual( self, result['ansible_facts']['ansible_net_neighbors'].keys(), ['0/1', '0/2'] ) assertCountEqual( self, result['ansible_facts']['ansible_net_neighbors']['0/1'], [{'host': 'Switch1', 'port': '0/1', 'chassis_id':'00:01:02:03:04:05'}] ) assertCountEqual( self, result['ansible_facts']['ansible_net_neighbors']['0/2'], [{'host': 'Switch2', 'port': '0/1', 'chassis_id':'00:02:02:03:04:05'}] )