Closed ktbyers closed 7 years ago
^^ Those plus these below should give feature parity with nxapi.
show ip arp
show ntp peer-status
show ip interface
show mac address-table
show ipv6 interface
show bgp sessions vrf all
Here are my initial test results:
(nxos_ssh_test) ~/testing$ ./test.py
Password:
## TESTING NAPALM NXOS SSH on N7K-C7009 ##
description NAPALM NEW CONFIG
## TESTING NAPALM NXOS SSH on N9K-C9272Q ##
description NAPALM NEW CONFIG
## TESTING NAPALM NXOS SSH on N3K-C3172 ##
description NAPALM NEW CONFIG
(nxos_ssh_test) ~/testing$ cat test.py
#!/usr/bin/env python
from __future__ import print_function
from napalm_base import get_network_driver
from getpass import getpass
devices = [{'hostname': 'N7009-1', 'chassis': 'N7K-C7009', 'config': 'n7k-merge.conf'},
{'hostname': 'N9272-1', 'chassis': 'N9K-C9272Q', 'config': 'n9k-merge.conf'},
{'hostname': 'N3172-2', 'chassis': 'N3K-C3172', 'config': 'n3k-merge.conf'}]
password = getpass()
driver = get_network_driver('nxos_ssh')
optional_args = {'port': 22}
for item in devices:
print("## TESTING NAPALM NXOS SSH on {} ##".format(item['chassis']))
device = driver(hostname=item['hostname'], username='admin', password=password,
optional_args=optional_args)
device.open()
device.load_merge_candidate(filename=item['config'])
print(device.compare_config())
#device.get_users()
#device.get_ntp_servers()
#device.get_snmp_information()
#device.get_interfaces_ip()
#device.get_interfaces()
#device.get_ntp_peers()
#device.get_facts()
device.close()
(nxos_ssh_test) ~/testing$ cat n7k-merge.conf
interface Ethernet4/48
description NAPALM NEW CONFIG
(nxos_ssh_test) ~/testing$ cat n9k-merge.conf
interface Ethernet1/72
description NAPALM NEW CONFIG
switchport
switchport mode trunk
no shutdown
(nxos_ssh_test) ~/testing$ cat n3k-merge.conf
interface Ethernet1/54
description NAPALM NEW CONFIG
I think we can close this one now.
Create new virtual environment
Activate virtual environment
source nxos_ssh_test/bin/activate
Install napalm libraries
pip install -q napalm-base pip install git+https://github.com/napalm-automation/napalm-nxos@nxos_ssh
If using napalm-ansible
git clone https://github.com/napalm-automation/napalm-ansible
Edit .ansible.cfg
Test script for config operations
The following getter methods should also work:
get_users
get_ntp_servers
get_snmp_information
get_interfaces_ip
get_interfaces
get_ntp_peers
get_config
get_facts
Contributing unit test data