├── .gitignore ├── .gitlab-ci.yml ├── .gitlab └── issue_templates │ ├── BUG_REPORT.md │ ├── IMPROVEMENT_SUGGESTION.md │ ├── NEW_FEATURE.md │ ├── NEW_OS_SUPPORT.md │ ├── NEW_PROTOCOL_SUPPORT.md │ └── PROTOCOL_IMPROVEMENT.md ├── LICENSE ├── README.md ├── docs ├── arguments.md ├── configuration.md ├── contact.md ├── contribute.md ├── contributors_and_maintainers.md ├── data_models.md ├── device_used.md ├── divers.md ├── images │ ├── archi.png │ ├── cli.png │ ├── cli_print.png │ ├── cli_select.png │ ├── cli_selected.png │ ├── cli_unselect.png │ ├── devops.png │ ├── logo.png │ ├── logs.png │ ├── netests_cli.png │ ├── ping.png │ ├── tree_truth_vars.png │ ├── tree_truth_vars_leaf01.png │ └── tree_truth_vars_spine01.png ├── index.md ├── installation.md ├── inventory.md ├── license.md ├── netests_cli.md ├── protocols.md ├── protocols_arguments.md ├── release.md ├── roadmap.md ├── run.md ├── source_of_truth.md ├── troubleshooting.md ├── vendors_and_protocols.md └── youtube.md ├── mkdocs.yml ├── netests ├── __init__.py ├── base_cli.py ├── base_protocols.py ├── base_run.py ├── base_selection.py ├── comparators │ ├── __init__.py │ ├── bgp_compare.py │ ├── bgp_up_compare.py │ ├── cdp_compare.py │ ├── facts_compare.py │ ├── lldp_compare.py │ ├── log_compare.py │ ├── ospf_compare.py │ ├── ping_retrieve.py │ ├── vlan_compare.py │ └── vrf_compare.py ├── constants.py ├── converters │ ├── __init__.py │ ├── bgp │ │ ├── __init__.py │ │ ├── arista │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── cumulus │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── extreme_vsp │ │ │ └── ssh.py │ │ ├── ios │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── iosxr │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── juniper │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── napalm │ │ │ ├── __init__.py │ │ │ └── converter.py │ │ └── nxos │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ └── ssh.py │ ├── cdp │ │ ├── __init__.py │ │ ├── cumulus │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── ios │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── iosxr │ │ │ └── ssh.py │ │ ├── napalm │ │ │ └── converter.py │ │ └── nxos │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ ├── facts │ │ ├── __init__.py │ │ ├── arista │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── cumulus │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── extreme_vsp │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── ios │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── iosxr │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── juniper │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── napalm │ │ │ └── converter.py │ │ └── nxos │ │ │ ├── api.py │ │ │ └── ssh.py │ ├── lldp │ │ ├── __init__.py │ │ ├── arista │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── cumulus │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── extreme_vsp │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── ios │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── iosxr │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── juniper │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── napalm │ │ │ └── converter.py │ │ └── nxos │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ ├── ospf │ │ ├── __init__.py │ │ ├── arista │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── cumulus │ │ │ ├── api.py │ │ │ └── ssh.py │ │ ├── extreme_vsp │ │ │ └── ssh.py │ │ ├── ios │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── iosxr │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ ├── juniper │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ │ └── nxos │ │ │ ├── api.py │ │ │ └── ssh.py │ ├── ping │ │ ├── __init__.py │ │ ├── arista │ │ │ ├── api.py │ │ │ └── validator.py │ │ ├── cumulus │ │ │ └── validator.py │ │ ├── extreme_vsp │ │ │ └── validator.py │ │ ├── ios │ │ │ └── validator.py │ │ ├── iosxr │ │ │ ├── nc.py │ │ │ └── validator.py │ │ ├── juniper │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── validator.py │ │ ├── nxos │ │ │ ├── api.py │ │ │ └── validator.py │ │ ├── ping_execute.py │ │ ├── ping_get.py │ │ ├── ping_validator.py │ │ └── retrieve_ping.py │ ├── vlan │ │ ├── cumulus │ │ │ └── ssh.py │ │ └── ios │ │ │ ├── api.py │ │ │ ├── nc.py │ │ │ └── ssh.py │ └── vrf │ │ ├── __init__.py │ │ ├── arista │ │ ├── api.py │ │ ├── nc.py │ │ └── ssh.py │ │ ├── cumulus │ │ ├── api.py │ │ └── ssh.py │ │ ├── extreme_vsp │ │ └── ssh.py │ │ ├── ios │ │ ├── api.py │ │ ├── nc.py │ │ └── ssh.py │ │ ├── iosxr │ │ ├── nc.py │ │ └── ssh.py │ │ ├── juniper │ │ ├── api.py │ │ ├── nc.py │ │ ├── ssh.py │ │ └── vrf_juniper_filters.py │ │ ├── napalm │ │ └── converter.py │ │ └── nxos │ │ ├── api.py │ │ ├── nc.py │ │ ├── rc.py │ │ └── ssh.py ├── data_models │ ├── bgp.yml │ ├── cdp.yml │ ├── facts.yml │ ├── lldp.yml │ ├── netests.yml │ ├── netests_detailed.yml │ ├── ospf.yml │ ├── ping.yml │ ├── vlan.yml │ └── vrf.yml ├── exceptions │ ├── __init__.py │ ├── netests_cli_exceptions.py │ ├── netests_exceptions.py │ └── netests_iosxr_exceptions.py ├── getters │ ├── base_get.py │ ├── bgp_get.py │ ├── bgp_up_get.py │ ├── cdp_get.py │ ├── exec_get.py │ ├── facts_get.py │ ├── lldp_get.py │ ├── ospf_get.py │ ├── ping_get.py │ ├── routing_get.py │ ├── vlan_get.py │ └── vrf_get.py ├── mappings.py ├── nornir_inventory.py ├── protocols │ ├── __init__.py │ ├── _protocols.py │ ├── bgp.py │ ├── cdp.py │ ├── discovery_protocols.py │ ├── facts.py │ ├── ip.py │ ├── ipv4.py │ ├── ipv6.py │ ├── lldp.py │ ├── ospf.py │ ├── ping.py │ ├── vlan.py │ └── vrf.py ├── select_vars.py ├── templates │ ├── jinja2 │ │ ├── ping │ │ │ ├── eos_ping.j2 │ │ │ ├── extreme_vsp_ping.j2 │ │ │ ├── ios_ping.j2 │ │ │ ├── iosxr_ping.j2 │ │ │ ├── junos_ping.j2 │ │ │ ├── linux_ping.j2 │ │ │ ├── nxos_ping.j2 │ │ │ └── result │ │ │ │ ├── leaf01_ping_cmd │ │ │ │ ├── leaf02_ping_cmd │ │ │ │ ├── leaf03_ping_cmd │ │ │ │ ├── leaf04_ping_cmd │ │ │ │ ├── leaf05_ping_cmd │ │ │ │ ├── spine01_ping_cmd │ │ │ │ ├── spine02_ping_cmd │ │ │ │ └── spine03_ping_cmd │ │ └── socket │ │ │ ├── eos_socket.j2 │ │ │ ├── linux_socket.j2 │ │ │ └── result │ │ │ ├── leaf01_socket_cmd │ │ │ └── leaf03_socket_cmd │ └── textfsm │ │ ├── cisco_ios_show ip_ospf_neighbor_detail.textfsm │ │ ├── cisco_ios_show_cdp_neighbors_detail.textfsm │ │ ├── cisco_ios_show_interface.textfsm │ │ ├── cisco_ios_show_ip_bgp_summary.textfsm │ │ ├── cisco_ios_show_ip_int_brief.textfsm │ │ ├── cisco_ios_show_ip_interface.textfsm │ │ ├── cisco_ios_show_ip_interface_brief.textfsm │ │ ├── cisco_ios_show_ip_ospf.textfsm │ │ ├── cisco_ios_show_ip_ospf_interface_brief.textfsm │ │ ├── cisco_ios_show_ip_ospf_neighbor.textfsm │ │ ├── cisco_ios_show_ip_ospf_neighbor_detail.textfsm │ │ ├── cisco_ios_show_ip_route_static.textfsm │ │ ├── cisco_ios_show_ip_vrf_detail.textfsm │ │ ├── cisco_ios_show_ipv6_interface_brief.textfsm │ │ ├── cisco_ios_show_lldp_neighbors_detail.textfsm │ │ ├── cisco_ios_show_snmp.textfsm │ │ ├── cisco_ios_show_version.textfsm │ │ ├── cisco_ios_show_vlan.textfsm │ │ ├── cisco_xr_show_bgp.textfsm │ │ ├── cisco_xr_show_bgp_neighbors.textfsm │ │ ├── cisco_xr_show_cdp_neighbors_detail.textfsm │ │ ├── cisco_xr_show_ip_interface_brief.textfsm │ │ ├── cisco_xr_show_lldp_neighbors.textfsm │ │ ├── cisco_xr_show_version.textfsm │ │ ├── cisco_xr_show_vrf_all_detail.textfsm │ │ ├── cumulus_net_show_bgp_vrf.textfsm │ │ ├── cumulus_net_show_vrf.textfsm │ │ ├── cumulus_net_show_vrf_list.textfsm │ │ ├── extreme_vsp_show_interfaces_gigabitethernet.textfsm │ │ ├── extreme_vsp_show_ip_bgp_summary.textfsm │ │ ├── extreme_vsp_show_ip_interface.textfsm │ │ ├── extreme_vsp_show_ip_ospf.textfsm │ │ ├── extreme_vsp_show_ip_ospf_interface.textfsm │ │ ├── extreme_vsp_show_ip_ospf_neighbor.textfsm │ │ ├── extreme_vsp_show_ip_route_static.textfsm │ │ ├── extreme_vsp_show_ip_vrf.textfsm │ │ ├── extreme_vsp_show_lldp_neighbor.textfsm │ │ ├── extreme_vsp_show_snmp_server_host.textfsm │ │ ├── extreme_vsp_show_sys_dns.textfsm │ │ ├── extreme_vsp_show_tech.textfsm │ │ └── extrme_vsp_show_int_gi_name.textfsm ├── tools │ ├── cli.py │ ├── file.py │ ├── http.py │ ├── nc.py │ ├── std.py │ └── verify.py ├── welcome.py └── workers │ ├── arista_api.py │ ├── arista_nc.py │ ├── arista_ssh.py │ ├── cumulus_api.py │ ├── cumulus_nc.py │ ├── cumulus_ssh.py │ ├── device.py │ ├── device_api.py │ ├── device_nc.py │ ├── device_ssh.py │ ├── extreme_vsp_api.py │ ├── extreme_vsp_nc.py │ ├── extreme_vsp_ssh.py │ ├── ios_api.py │ ├── ios_nc.py │ ├── ios_ssh.py │ ├── iosxr_api.py │ ├── iosxr_nc.py │ ├── iosxr_ssh.py │ ├── juniper_api.py │ ├── juniper_nc.py │ ├── juniper_ssh.py │ ├── napalm_any.py │ ├── nxos_api.py │ ├── nxos_nc.py │ └── nxos_ssh.py ├── poetry.lock ├── pylama.ini ├── pyproject.toml └── tests ├── features ├── bgp_tests.feature ├── cdp_tests.feature ├── data_models_tests.feature ├── environment.py ├── facts_tests.feature ├── ipv4_6_class_tests.feature ├── lldp_tests.feature ├── ospf_tests.feature ├── ping_tests.feature ├── src │ ├── bgp_tests.yml │ ├── cdp_tests.yml │ ├── facts_tests.yml │ ├── ipv4_tests.yml │ ├── ipv6_tests.yml │ ├── lldp_tests.yml │ ├── mlag_tests.yml │ ├── mtu_tests.yml │ ├── mtu_tests_validate.yml │ ├── ospf_tests.yml │ ├── outputs │ │ ├── bgp │ │ │ ├── arista │ │ │ │ ├── api │ │ │ │ │ └── arista_api_get_bgp.json │ │ │ │ └── ssh │ │ │ │ │ ├── arista_show_ip_bgp_summary_default.json │ │ │ │ │ ├── arista_show_ip_bgp_summary_many_peers.json │ │ │ │ │ └── arista_show_ip_bgp_summary_one_peer.json │ │ │ ├── cumulus │ │ │ │ ├── api │ │ │ │ │ ├── cumulus_api_get_vrf_default.json │ │ │ │ │ └── cumulus_api_get_vrf_xyz.json │ │ │ │ └── ssh │ │ │ │ │ └── cumulus_ssh_get_vrf.json │ │ │ ├── extreme_vsp │ │ │ │ └── ssh │ │ │ │ │ ├── extreme_vsp_show_ip_bgp_summary.txt │ │ │ │ │ └── extreme_vsp_show_ip_bgp_summary_vrf.txt │ │ │ ├── ios │ │ │ │ ├── api │ │ │ │ │ └── ios_api_get_bgp.json │ │ │ │ ├── netconf │ │ │ │ │ ├── ios_nc_get_bgp.json │ │ │ │ │ └── ios_nc_get_bgp.xml │ │ │ │ └── ssh │ │ │ │ │ ├── ios_ssh_get_bgp.txt │ │ │ │ │ ├── ios_ssh_get_bgp_vrf.txt │ │ │ │ │ └── ios_ssh_get_bgp_vrf_2.txt │ │ │ ├── iosxr │ │ │ │ ├── netconf │ │ │ │ │ ├── iosxr_nc_get_bgp_no_config.xml │ │ │ │ │ └── iosxr_nc_get_bgp_one_vrf.xml │ │ │ │ └── ssh │ │ │ │ │ ├── iosxr_cli_get_bgp_peers.txt │ │ │ │ │ ├── iosxr_cli_get_bgp_peers_vrf.txt │ │ │ │ │ ├── iosxr_cli_get_bgp_rid.txt │ │ │ │ │ └── iosxr_cli_get_bgp_rid_vrf.txt │ │ │ ├── juniper │ │ │ │ ├── api │ │ │ │ │ ├── juniper_api_get_bgp_peers.xml │ │ │ │ │ ├── juniper_api_get_bgp_peers_vrf.xml │ │ │ │ │ ├── juniper_api_get_bgp_rid.xml │ │ │ │ │ └── juniper_api_get_bgp_rid_vrf.xml │ │ │ │ ├── netconf │ │ │ │ │ ├── juniper_nc_get_bgp_peers.xml │ │ │ │ │ ├── juniper_nc_get_bgp_peers_vrf.xml │ │ │ │ │ ├── juniper_nc_get_bgp_rid.xml │ │ │ │ │ └── juniper_nc_get_bgp_rid_vrf.xml │ │ │ │ └── ssh │ │ │ │ │ ├── juniper_cli_get_bgp_peers.json │ │ │ │ │ ├── juniper_cli_get_bgp_peers_vrf.json │ │ │ │ │ ├── juniper_cli_get_bgp_rid.json │ │ │ │ │ └── juniper_cli_get_bgp_rid_vrf.json │ │ │ ├── napalm │ │ │ │ └── napalm_get_bgp.json │ │ │ └── nxos │ │ │ │ ├── api │ │ │ │ ├── nxos_api_get_bgp_default.json │ │ │ │ ├── nxos_api_get_bgp_vrf_customer.json │ │ │ │ └── nxos_api_get_bgp_vrf_mgmt.json │ │ │ │ └── ssh │ │ │ │ ├── nxos_show_bgp_session_vrf_customer.json │ │ │ │ ├── nxos_show_bgp_session_vrf_default.json │ │ │ │ └── nxos_show_bgp_session_vrf_mgmt.json │ │ ├── cdp │ │ │ ├── cumulus │ │ │ │ ├── api │ │ │ │ │ └── cumulus_api_get_cdp.json │ │ │ │ └── ssh │ │ │ │ │ └── cumulus_net_show_lldp.json │ │ │ ├── ios │ │ │ │ └── ssh │ │ │ │ │ └── ios_show_cdp_neighbors_detail.txt │ │ │ ├── iosxr │ │ │ │ └── ssh │ │ │ │ │ └── cisco_iosxr_show_cdp_neighbors_detail.txt │ │ │ └── nxos │ │ │ │ ├── api │ │ │ │ ├── nxos_api_get_cdp_neighbors.json │ │ │ │ └── nxos_api_get_cdp_neighbors_only_one.json │ │ │ │ └── ssh │ │ │ │ ├── nxos_show_cdp_neighbors.json │ │ │ │ └── nxos_show_cdp_neighbors_only_one.json │ │ ├── facts │ │ │ ├── arista │ │ │ │ ├── api │ │ │ │ │ └── arista_api_get_facts.json │ │ │ │ └── ssh │ │ │ │ │ ├── arista_cli_show_hostname.json │ │ │ │ │ ├── arista_cli_show_interface_status.json │ │ │ │ │ └── arista_cli_show_version.json │ │ │ ├── cumulus │ │ │ │ ├── api │ │ │ │ │ ├── cumulus_api_show_interface_all.json │ │ │ │ │ └── cumulus_api_show_system.json │ │ │ │ └── ssh │ │ │ │ │ ├── cumulus_net_show_interface_all.json │ │ │ │ │ └── cumulus_net_show_system.json │ │ │ ├── extreme_vsp │ │ │ │ ├── api │ │ │ │ │ ├── extreme_vsp_api_openconfig_interfaces.json │ │ │ │ │ └── extreme_vsp_api_openconfig_system.json │ │ │ │ └── ssh │ │ │ │ │ ├── extreme_vsp_show_interfaces_gigabitethernet_name.txt │ │ │ │ │ ├── extreme_vsp_show_sys_dns.txt │ │ │ │ │ └── extreme_vsp_show_tech.txt │ │ │ ├── ios │ │ │ │ ├── api │ │ │ │ │ ├── cisco_ios_api_get_facts_16.8.json │ │ │ │ │ └── cisco_ios_api_get_facts_16.9.json │ │ │ │ ├── netconf │ │ │ │ │ └── cisco_ios_nc_get_facts.xml │ │ │ │ └── ssh │ │ │ │ │ ├── cisco_ios_ip_interface_brief.txt │ │ │ │ │ └── cisco_ios_show_version.txt │ │ │ ├── iosxr │ │ │ │ └── ssh │ │ │ │ │ ├── cisco_iosxr_show_ip_interface_brief.txt │ │ │ │ │ └── cisco_iosxr_show_version.txt │ │ │ ├── juniper │ │ │ │ ├── api │ │ │ │ │ ├── juniper_api_get_chassis_inventory_detail.xml │ │ │ │ │ ├── juniper_api_get_interface_information_terse.xml │ │ │ │ │ ├── juniper_api_get_software_information.xml │ │ │ │ │ └── juniper_api_get_system_memory_information.xml │ │ │ │ ├── netconf │ │ │ │ │ ├── juniper_nc_get_facts.json │ │ │ │ │ └── juniper_nc_get_interfaces_terse.xml │ │ │ │ └── ssh │ │ │ │ │ ├── juniper_show_conf_system.json │ │ │ │ │ ├── juniper_show_hardware_detail.json │ │ │ │ │ ├── juniper_show_interfaces_terse.json │ │ │ │ │ ├── juniper_show_system_memory.json │ │ │ │ │ └── juniper_show_version.json │ │ │ ├── napalm │ │ │ │ └── nxos_get_facts.json │ │ │ └── nxos │ │ │ │ ├── api │ │ │ │ ├── nxos_api_get_domain.json │ │ │ │ ├── nxos_api_get_facts.json │ │ │ │ └── nxos_api_get_interfaces.json │ │ │ │ └── ssh │ │ │ │ ├── nxos_show_hostname.json │ │ │ │ ├── nxos_show_interfaces.json │ │ │ │ └── nxos_show_version.json │ │ ├── lldp │ │ │ ├── arista │ │ │ │ ├── api │ │ │ │ │ └── arista_api_show_lldp_neighbors.json │ │ │ │ └── ssh │ │ │ │ │ └── arista_cli_show_lldp_neighbors.json │ │ │ ├── cumulus │ │ │ │ ├── api │ │ │ │ │ └── cumulus_api_show_lldp.json │ │ │ │ └── ssh │ │ │ │ │ └── cumulus_net_show_lldp.json │ │ │ ├── extreme_vsp │ │ │ │ ├── api │ │ │ │ │ └── extreme_vsp_api_get_lldp_neighbors.json │ │ │ │ └── ssh │ │ │ │ │ └── extreme_vsp_show_lldp_neighbors.txt │ │ │ ├── ios │ │ │ │ └── ssh │ │ │ │ │ └── ios_show_lldp_neighbors.txt │ │ │ ├── iosxr │ │ │ │ └── ssh │ │ │ │ │ └── cisco_iosxr_show_lldp_neighbors.txt │ │ │ ├── juniper │ │ │ │ ├── api │ │ │ │ │ └── juniper_api_get_lldp_neighbors.json │ │ │ │ ├── netconf │ │ │ │ │ └── juniper_nc_get_lldp_neighbors.xml │ │ │ │ └── ssh │ │ │ │ │ └── juniper_show_lldp_neighbors.json │ │ │ ├── napalm │ │ │ │ └── napalm_get_lldp.json │ │ │ └── nxos │ │ │ │ ├── api │ │ │ │ ├── nxos_api_get_lldp_neighbors.json │ │ │ │ └── nxos_api_get_lldp_neighbors_only_one.json │ │ │ │ └── ssh │ │ │ │ ├── nxos_show_lldp_neighbors.json │ │ │ │ └── nxos_show_lldp_neighbors_only_one.json │ │ ├── ospf │ │ │ ├── arista │ │ │ │ ├── api │ │ │ │ │ ├── arista_ospf_neighbors.json │ │ │ │ │ ├── arista_ospf_neighbors_vrf_netests.json │ │ │ │ │ ├── arista_ospf_neighbors_vrf_wejob.json │ │ │ │ │ ├── arista_ospf_rid.json │ │ │ │ │ ├── arista_ospf_rid_vrf_netests.json │ │ │ │ │ └── arista_ospf_rid_vrf_wejob.json │ │ │ │ └── ssh │ │ │ │ │ ├── arista_ospf_neighbors.json │ │ │ │ │ ├── arista_ospf_neighbors_vrf_netests.json │ │ │ │ │ ├── arista_ospf_neighbors_vrf_wejob.json │ │ │ │ │ ├── arista_ospf_rid.json │ │ │ │ │ ├── arista_ospf_rid_vrf_netests.json │ │ │ │ │ └── arista_ospf_rid_vrf_wejob.json │ │ │ ├── cumulus │ │ │ │ └── ssh │ │ │ │ │ ├── cumulus_ospf_neighbors.json │ │ │ │ │ ├── cumulus_ospf_neighbors_vrf_mgmt.json │ │ │ │ │ ├── cumulus_ospf_neighbors_vrf_netests.json │ │ │ │ │ ├── cumulus_ospf_no_running.txt │ │ │ │ │ ├── cumulus_ospf_rid.json │ │ │ │ │ ├── cumulus_ospf_rid_vrf_mgmt.json │ │ │ │ │ └── cumulus_ospf_rid_vrf_netests.json │ │ │ ├── extreme_vsp │ │ │ │ └── ssh │ │ │ │ │ ├── extreme_vsp_ospf_interface.txt │ │ │ │ │ ├── extreme_vsp_ospf_interface_vrf_mgmt.txt │ │ │ │ │ ├── extreme_vsp_ospf_interface_vrf_netests.txt │ │ │ │ │ ├── extreme_vsp_ospf_neighbors.txt │ │ │ │ │ ├── extreme_vsp_ospf_neighbors_vrf_mgmt.txt │ │ │ │ │ ├── extreme_vsp_ospf_neighbors_vrf_netests.txt │ │ │ │ │ ├── extreme_vsp_ospf_rid.txt │ │ │ │ │ ├── extreme_vsp_ospf_rid_vrf_mgmt.txt │ │ │ │ │ └── extreme_vsp_ospf_rid_vrf_netests.txt │ │ │ ├── ios │ │ │ │ └── ssh │ │ │ │ │ ├── show_ip_ospf.txt │ │ │ │ │ ├── show_ip_ospf_interface_brief.txt │ │ │ │ │ └── show_ip_ospf_neighbors.txt │ │ │ ├── juniper │ │ │ │ ├── api │ │ │ │ │ ├── juniper_ospf_neighbors.xml │ │ │ │ │ ├── juniper_ospf_neighbors_vrf_mgmt.xml │ │ │ │ │ ├── juniper_ospf_rid.xml │ │ │ │ │ └── juniper_ospf_rid_vrf_mgmt.xml │ │ │ │ ├── netconf │ │ │ │ │ ├── juniper_ospf_neighbors.xml │ │ │ │ │ ├── juniper_ospf_neighbors_vrf_mgmt.xml │ │ │ │ │ ├── juniper_ospf_rid.xml │ │ │ │ │ └── juniper_ospf_rid_vrf_mgmt.xml │ │ │ │ └── ssh │ │ │ │ │ ├── juniper_ospf_neighbors.json │ │ │ │ │ ├── juniper_ospf_neighbors_vrf_mgmt.json │ │ │ │ │ ├── juniper_ospf_rid.json │ │ │ │ │ └── juniper_ospf_rid_vrf_mgmt.json │ │ │ └── nxos │ │ │ │ ├── api │ │ │ │ ├── nxos_ospf_neighbors.json │ │ │ │ ├── nxos_ospf_neighbors_vrf_netests.json │ │ │ │ ├── nxos_ospf_rid.json │ │ │ │ └── nxos_ospf_rid_vrf_netests.json │ │ │ │ ├── nxos_no_ospf.txt │ │ │ │ └── ssh │ │ │ │ ├── nxos_ospf_neighbors.json │ │ │ │ ├── nxos_ospf_neighbors_vrf_netests.json │ │ │ │ ├── nxos_ospf_rid.json │ │ │ │ └── nxos_ospf_rid_vrf_netests.json │ │ ├── ping │ │ │ ├── arista │ │ │ │ ├── api │ │ │ │ │ ├── arista_ping_no_route.json │ │ │ │ │ ├── arista_ping_unreachable.json │ │ │ │ │ ├── arista_ping_works.json │ │ │ │ │ ├── arista_ping_wrong_ip.json │ │ │ │ │ └── arista_ping_wrong_vrf.json │ │ │ │ └── ssh │ │ │ │ │ ├── arista_ping_no_route.txt │ │ │ │ │ ├── arista_ping_unreachable.txt │ │ │ │ │ ├── arista_ping_works.txt │ │ │ │ │ ├── arista_ping_wrong_ip.txt │ │ │ │ │ └── arista_ping_wrong_vrf.txt │ │ │ ├── extreme_vsp │ │ │ │ └── ssh │ │ │ │ │ ├── extreme_vsp_ping_no_route.txt │ │ │ │ │ ├── extreme_vsp_ping_unreachable.txt │ │ │ │ │ ├── extreme_vsp_ping_works.txt │ │ │ │ │ ├── extreme_vsp_ping_wrong_ip.txt │ │ │ │ │ └── extreme_vsp_ping_wrong_vrf.txt │ │ │ ├── ios │ │ │ │ └── ssh │ │ │ │ │ ├── ios_ping_no_route.txt │ │ │ │ │ ├── ios_ping_no_vrf_configured.txt │ │ │ │ │ ├── ios_ping_unreachable.txt │ │ │ │ │ ├── ios_ping_vrf_no_ip_src.txt │ │ │ │ │ ├── ios_ping_works.txt │ │ │ │ │ ├── ios_ping_wrong_ip.txt │ │ │ │ │ └── ios_ping_wrong_vrf.txt │ │ │ ├── iosxr │ │ │ │ ├── netconf │ │ │ │ │ ├── iosxr_ping_no_route.json │ │ │ │ │ ├── iosxr_ping_unreachable.json │ │ │ │ │ ├── iosxr_ping_works.json │ │ │ │ │ ├── iosxr_ping_wrong_ip.json │ │ │ │ │ └── iosxr_ping_wrong_vrf.json │ │ │ │ └── ssh │ │ │ │ │ ├── iosxr_ping_no_route.txt │ │ │ │ │ ├── iosxr_ping_unreachable.txt │ │ │ │ │ ├── iosxr_ping_works.txt │ │ │ │ │ ├── iosxr_ping_wrong_ip.txt │ │ │ │ │ └── iosxr_ping_wrong_vrf.txt │ │ │ ├── juniper │ │ │ │ ├── api │ │ │ │ │ ├── juniper_ping_no_route.json │ │ │ │ │ ├── juniper_ping_no_src_ip.json │ │ │ │ │ ├── juniper_ping_unreachable.json │ │ │ │ │ ├── juniper_ping_works.json │ │ │ │ │ ├── juniper_ping_wrong_ip.json │ │ │ │ │ └── juniper_ping_wrong_vrf.json │ │ │ │ ├── netconf │ │ │ │ │ ├── juniper_ping_no_route.json │ │ │ │ │ ├── juniper_ping_no_src_ip.json │ │ │ │ │ ├── juniper_ping_unreachable.json │ │ │ │ │ ├── juniper_ping_works.json │ │ │ │ │ ├── juniper_ping_wrong_ip.json │ │ │ │ │ └── juniper_ping_wrong_vrf.json │ │ │ │ └── ssh │ │ │ │ │ ├── juniper_ping_no_route.txt │ │ │ │ │ ├── juniper_ping_no_src_ip.txt │ │ │ │ │ ├── juniper_ping_unreachable.txt │ │ │ │ │ ├── juniper_ping_works.txt │ │ │ │ │ ├── juniper_ping_wrong_ip.txt │ │ │ │ │ └── juniper_ping_wrong_vrf.txt │ │ │ └── nxos │ │ │ │ ├── api │ │ │ │ ├── nxos_ping_no_route.json │ │ │ │ ├── nxos_ping_unreachable.json │ │ │ │ ├── nxos_ping_works.json │ │ │ │ ├── nxos_ping_wrong_ip.json │ │ │ │ └── nxos_ping_wrong_vrf.json │ │ │ │ └── ssh │ │ │ │ ├── nxos_ping_no_route.txt │ │ │ │ ├── nxos_ping_unreachable.txt │ │ │ │ ├── nxos_ping_works.txt │ │ │ │ ├── nxos_ping_wrong_ip.txt │ │ │ │ └── nxos_ping_wrong_vrf.txt │ │ ├── vlan │ │ │ └── cumulus │ │ │ │ └── ssh │ │ │ │ ├── cumulus_ssh_net_show_interface_all.json │ │ │ │ └── cumulus_ssh_net_show_interface_all_no_ip.json │ │ └── vrf │ │ │ ├── arista │ │ │ ├── api │ │ │ │ ├── arista_api_get_vrf_many_vrf.json │ │ │ │ ├── arista_api_get_vrf_no_config.json │ │ │ │ └── arista_api_get_vrf_one_vrf.json │ │ │ ├── netconf │ │ │ │ ├── arista_nc_get_vrf_many_vrf.json │ │ │ │ ├── arista_nc_get_vrf_no_config.json │ │ │ │ └── arista_nc_get_vrf_one_vrf.json │ │ │ └── ssh │ │ │ │ ├── arista_cli_get_vrf_many_vrf.json │ │ │ │ ├── arista_cli_get_vrf_no_config.json │ │ │ │ └── arista_cli_get_vrf_one_vrf.json │ │ │ ├── cumulus │ │ │ ├── api │ │ │ │ └── cumulus_http_show_vrf.txt │ │ │ └── ssh │ │ │ │ └── cumulus_net_show_vrf.txt │ │ │ ├── extreme_vsp │ │ │ └── ssh │ │ │ │ └── extreme_vsp_show_ip_vrf.txt │ │ │ ├── ios │ │ │ ├── api │ │ │ │ ├── cisco_ios_api_get_vrf.xml │ │ │ │ ├── cisco_ios_api_get_vrf_many.xml │ │ │ │ ├── cisco_ios_api_get_vrf_no_config.xml │ │ │ │ └── cisco_ios_api_get_vrf_only_one.xml │ │ │ ├── netconf │ │ │ │ ├── cisco_ios_nc_get_vrf.xml │ │ │ │ ├── cisco_ios_nc_get_vrf_many.xml │ │ │ │ ├── cisco_ios_nc_get_vrf_no_config.xml │ │ │ │ └── cisco_ios_nc_get_vrf_only_one.xml │ │ │ └── ssh │ │ │ │ ├── cisco_ios_show_ip_vrf_detail.txt │ │ │ │ ├── cisco_ios_ssh_get_vrf_many.txt │ │ │ │ ├── cisco_ios_ssh_get_vrf_no_config.txt │ │ │ │ └── cisco_ios_ssh_get_vrf_only_one.txt │ │ │ ├── iosxr │ │ │ ├── netconf │ │ │ │ ├── cisco_iosxr_nc_get_bgp.xml │ │ │ │ ├── cisco_iosxr_nc_get_bgp2.xml │ │ │ │ ├── cisco_iosxr_nc_get_bgp_no_config.xml │ │ │ │ ├── cisco_iosxr_nc_get_bgp_one_vrf.xml │ │ │ │ ├── cisco_iosxr_nc_get_vrf.xml │ │ │ │ ├── cisco_iosxr_nc_get_vrf2.xml │ │ │ │ ├── cisco_iosxr_nc_get_vrf_no_config.xml │ │ │ │ └── cisco_iosxr_nc_get_vrf_one_vrf.xml │ │ │ └── ssh │ │ │ │ ├── cisco_iosxr_show_vrf_all_detail.txt │ │ │ │ ├── cisco_iosxr_show_vrf_all_detail_no_config.txt │ │ │ │ └── cisco_iosxr_show_vrf_all_detail_one_vrf.txt │ │ │ ├── juniper │ │ │ ├── api │ │ │ │ └── juniper_api_get_vrf.xml │ │ │ ├── netconf │ │ │ │ └── get_instance_information_details.xml │ │ │ └── ssh │ │ │ │ └── juniper_show_route_instance_detail.json │ │ │ ├── napalm │ │ │ └── napalm_get_vrf.json │ │ │ └── nxos │ │ │ ├── api │ │ │ └── cisco_nxos_api_get_vrf.xml │ │ │ ├── netconf │ │ │ └── cisco_nxos_nc_get_vrf.xml │ │ │ └── ssh │ │ │ └── cisco_nxos_show_vrf_all_detail.json │ ├── static_tests.yml │ ├── vlan_tests.yml │ └── vrf_tests.yml ├── steps │ ├── bgp_tests.py │ ├── cdp_tests.py │ ├── data_models_tests.py │ ├── facts_tests.py │ ├── ipv4_6_class_tests.py │ ├── lldp_tests.py │ ├── ospf_tests.py │ ├── ping_tests.py │ ├── validate_netests_inventory.py │ ├── vlan_class_tests.py │ ├── vlan_tests.py │ └── vrf_tests.py ├── validate_netests_inventory.feature ├── vlan_class_tests.feature ├── vlan_tests.feature └── vrf_tests.feature ├── inventory ├── ansible │ ├── group_vars │ │ ├── all.yml │ │ ├── leaf.yml │ │ └── spine.yml │ ├── host_vars │ │ ├── leaf01.yml │ │ ├── leaf02.yml │ │ ├── leaf03.yml │ │ ├── leaf04.yml │ │ ├── leaf05.yml │ │ ├── spine01.yml │ │ ├── spine02.yml │ │ ├── spine03.yml │ │ └── spine04.yml │ ├── hosts │ └── hosts_virtual ├── bad │ └── ansible │ │ ├── host_vars │ │ ├── leaf01.yml │ │ ├── leaf02.yml │ │ ├── leaf03.yml │ │ ├── leaf04.yml │ │ ├── leaf05.yml │ │ ├── spine01.yml │ │ ├── spine02.yml │ │ ├── spine03.yml │ │ └── spine04.yml │ │ ├── hosts │ │ ├── hosts_bad_connexion │ │ ├── hosts_bad_connexion_platform │ │ ├── hosts_bad_platform │ │ ├── hosts_bad_port │ │ └── hosts_bad_secure_api ├── netbox │ └── netbox.yml └── nornir │ ├── std │ ├── defaults.yml │ ├── groups.yml │ └── hosts.yml │ └── virt │ ├── defaults.yml │ ├── groups.yml │ └── hosts.yml ├── run_behave.sh ├── run_syntax.sh └── run_tests.sh /.gitignore: -------------------------------------------------------------------------------- 1 | truth_vars/* 2 | reports/* 3 | netbox/* 4 | inventory/* 5 | images/* 6 | nornir/nornir.log 7 | .DS_Store 8 | bin/* 9 | lib/* 10 | include/* 11 | data/* 12 | pyvenv.cfg 13 | pip-selfcheck.json 14 | .idea 15 | __pycache__/ 16 | *.pyc 17 | **/bck.* 18 | req.txt 19 | **log.* 20 | netests.egg-info 21 | netests.log 22 | dist/ 23 | backup/ 24 | **.graffle 25 | dylan-hamel-mbp.pem 26 | movies/* 27 | secure/* -------------------------------------------------------------------------------- /.gitlab/issue_templates/IMPROVEMENT_SUGGESTION.md: -------------------------------------------------------------------------------- 1 | # Improvement suggestion 2 | 3 | Template to send us an idea of improvement. 4 | 5 | Please have a look on our roadmap before. 6 | 7 | => https://www.netests.io/roadmap/ 8 | 9 | 10 | 11 | ## Mode 12 | 13 | - [ ] Standard Mode 14 | - [ ] CLI Mode 15 | 16 | 17 | 18 | ## Description -------------------------------------------------------------------------------- /.gitlab/issue_templates/NEW_FEATURE.md: -------------------------------------------------------------------------------- 1 | # New Feature 2 | 3 | ```Shell 4 | Check that a request has not already been made for this feature. 5 | => https://gitlab.com/DylanHamel/netests/-/issues 6 | 7 | * If the requests exists add a "Thumbs up" 8 | 9 | ``` 10 | 11 | 12 | 13 | ## Mode 14 | 15 | - [ ] Standard Mode 16 | - [ ] CLI Mode 17 | 18 | 19 | 20 | ## Vendor - OS 21 | 22 | | Vendors Name | OS Name | Can we virtualize this OS ? | 23 | | -------------- | -------------- | --------------------------- | 24 | | <--TO_WRITE--> | <--TO_WRITE--> | <--TO_WRITE--> | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/NEW_OS_SUPPORT.md: -------------------------------------------------------------------------------- 1 | # New OS support request 2 | 3 | ```Shell 4 | Check that a request has not already been made for this OS. 5 | => https://gitlab.com/DylanHamel/netests/-/issues 6 | 7 | * If the requests exists add a "Thumbs up" 8 | 9 | ``` 10 | 11 | 12 | 13 | ## Netests CLI or Netests Standard 14 | 15 | Please Choose one of them. 16 | 17 | 18 | 19 | ## Description 20 | 21 | Description of your feature with a sumulate example. 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/NEW_PROTOCOL_SUPPORT.md: -------------------------------------------------------------------------------- 1 | # New Protocol Support 2 | 3 | ```Shell 4 | Check that a request has not already been made for this protocol. 5 | => https://gitlab.com/DylanHamel/netests/-/issues 6 | 7 | * If the requests exists add a "Thumbs up" 8 | 9 | ``` 10 | 11 | 12 | 13 | ## Protocol 14 | 15 | * 16 | 17 | 18 | 19 | ## Description 20 | 21 | What would you like to get and compare ? 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/PROTOCOL_IMPROVEMENT.md: -------------------------------------------------------------------------------- 1 | # Protocol Improvement 2 | 3 | Template to send us an idea of improvement for a protocol 4 | 5 | Please have a look on our roadmap before. 6 | 7 | => https://www.netests.io/roadmap/ 8 | 9 | 10 | 11 | ## Protoco 12 | 13 | - [ ] BGP 14 | - [ ] CDP 15 | - [ ] Facts 16 | - [ ] LLDP 17 | - [ ] OSPF 18 | - [ ] PING 19 | - [ ] VRF 20 | - [ ] ALL 21 | 22 | 23 | 24 | ## Description -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Dylan Hamel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/contact.md: -------------------------------------------------------------------------------- 1 | Netests.io Team 2 | -------------------------------------------------------------------------------- /docs/contributors_and_maintainers.md: -------------------------------------------------------------------------------- 1 | Thank you for using Netests.io 2 | 3 | 4 | ## Maintainers 5 | 6 | Dylan Hamel - [Linkedin](https://www.linkedin.com/in/dylan-hamel/) - 7 | 8 | Mentor Reka - [Linkedin](https://www.linkedin.com/in/mentor-reka/) - reka.mentor@gmail.com 9 | 10 | 11 | ## Contributors 12 | 13 | > Feel free to open a Pull Request on Gitlab 14 | -------------------------------------------------------------------------------- /docs/divers.md: -------------------------------------------------------------------------------- 1 | ## TextFSM templates 2 | 3 | Some templates have be retreieved on : 4 | 5 | **https://github.com/networktocode/ntc-templates/tree/master/templates** 6 | 7 | 8 | ## Alternative to NAPALM ?? 9 | 10 | The answer is definitely NO !! 11 | 12 | NAPALM has many many more functions about configuration management. 13 | 14 | Netests only gets data from devices convert in object and compares to your source of truth. 15 | 16 | Moreover, Nestests uses NAPALM. 17 | 18 | To have more informations about all posibilities offered by NAPALM have look on the following links : 19 | 20 | https://github.com/napalm-automation 21 | 22 | https://napalm.readthedocs.io/en/latest/ 23 | 24 | -------------------------------------------------------------------------------- /docs/images/archi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/archi.png -------------------------------------------------------------------------------- /docs/images/cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/cli.png -------------------------------------------------------------------------------- /docs/images/cli_print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/cli_print.png -------------------------------------------------------------------------------- /docs/images/cli_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/cli_select.png -------------------------------------------------------------------------------- /docs/images/cli_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/cli_selected.png -------------------------------------------------------------------------------- /docs/images/cli_unselect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/cli_unselect.png -------------------------------------------------------------------------------- /docs/images/devops.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/devops.png -------------------------------------------------------------------------------- /docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/logo.png -------------------------------------------------------------------------------- /docs/images/logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/logs.png -------------------------------------------------------------------------------- /docs/images/netests_cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/netests_cli.png -------------------------------------------------------------------------------- /docs/images/ping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/ping.png -------------------------------------------------------------------------------- /docs/images/tree_truth_vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/tree_truth_vars.png -------------------------------------------------------------------------------- /docs/images/tree_truth_vars_leaf01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/tree_truth_vars_leaf01.png -------------------------------------------------------------------------------- /docs/images/tree_truth_vars_spine01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/docs/images/tree_truth_vars_spine01.png -------------------------------------------------------------------------------- /docs/installation.md: -------------------------------------------------------------------------------- 1 | Netests.io is available via `pip` 2 | 3 | ## Installation 4 | 5 | ```shell 6 | pip install netests 7 | ``` 8 | 9 | 10 | 11 | ## Virtual Environment 12 | 13 | It is possible (not an obligation) to use a python virtual environnement. 14 | 15 | ```shell 16 | mkdir netests-demo 17 | cd netests-demo 18 | 19 | python3 -m venv . 20 | pip install --upgrade pip 21 | 22 | pip install netests 23 | ``` 24 | 25 | 26 | 27 | ## Youtube 28 | 29 | In the following video we show you how to setup Netests.io. 30 | 31 | It's too easy :thinking: 32 | 33 | https://www.youtube.com/watch?v=ymfFMnGkBAY 34 | 35 | -------------------------------------------------------------------------------- /docs/license.md: -------------------------------------------------------------------------------- 1 | ## License 2 | 3 | ``` 4 | MIT License 5 | 6 | Copyright (c) 2020 Dylan Hamel 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /docs/release.md: -------------------------------------------------------------------------------- 1 | Netests.io releases informations 2 | 3 | ## Version 0.3.0 4 | 5 | * Add VLAN structure and tests. 6 | 7 | It's now possible to implement VLAN test for all devices - (only Cumulus SSH is implemeted yet). 8 | 9 | * Add VLAN tests 10 | 11 | * Add `pydantic` and `typing` to VLAN class 12 | 13 | ## Version 0.2.0 14 | 15 | Add possibility to modify compare function. 16 | 17 | ## Version 0.1.0 18 | 19 | First version 20 | 21 | #### Supported vendors 22 | 23 | * Arista Networks 24 | * Cumulus Networks 25 | * Extreme Networks VSP (VOSS) 26 | * Cisco IOS-XE 27 | * Cisco IOS-XR 28 | * Juniper Networks 29 | * Cisco NX-OS 30 | 31 | #### Supported protocols 32 | 33 | * BGP 34 | * CDP 35 | * Facts 36 | * LLDP 37 | * OSPF 38 | * PING 39 | * VRF 40 | 41 | #### Supported inventories 42 | 43 | * Nornir 44 | * Ansible -------------------------------------------------------------------------------- /docs/troubleshooting.md: -------------------------------------------------------------------------------- 1 | To troubleshoot unexpected behavior, Netests.io will automatically create a logs file. 2 | 3 | It is created where Netests.io is run. 4 | 5 | ```shell 6 | more ./netests.logs 7 | ``` 8 | 9 | For each Netests.io, a banner is printed into the log file. 10 | 11 | ```shell 12 | ****************************************************** 13 | * * 14 | * New Netests.io RUN * 15 | * * 16 | ****************************************************** 17 | ``` 18 | 19 | Here is an example of the beginning of the log file 20 | 21 | ![./images/logs.png](./images/logs.png) 22 | 23 | 24 | 25 | 26 | 27 | ## Issues 28 | 29 | If you have a issue with Netests.io, please open an issue on Gitlab : 30 | 31 | https://gitlab.com/DylanHamel/netests 32 | 33 | Join logs file to help us to understand and fix the problem. 34 | 35 | Thank you in advance for your help :pray: 36 | 37 | -------------------------------------------------------------------------------- /docs/youtube.md: -------------------------------------------------------------------------------- 1 | Example of using Netests.io 2 | 3 | 4 | 5 | ## Standard mode 6 | 7 | https://www.youtube.com/watch?v=ymfFMnGkBAY 8 | 9 | 10 | 11 | ## CLI mode 12 | 13 | https://www.youtube.com/watch?v=_WStUkQLWEU&t=7s -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Netests.io 2 | theme: 3 | name: material 4 | language: en 5 | palette: 6 | primary: purple 7 | accent: purple 8 | font: 9 | text: Ubuntu 10 | code: Ubuntu Mono 11 | 12 | markdown_extensions: 13 | - pymdownx.arithmatex 14 | - pymdownx.betterem: 15 | smart_enable: all 16 | - pymdownx.caret 17 | - pymdownx.critic 18 | - pymdownx.details 19 | - pymdownx.emoji 20 | - pymdownx.inlinehilite 21 | - pymdownx.magiclink 22 | - pymdownx.mark 23 | - pymdownx.smartsymbols 24 | - pymdownx.superfences 25 | - pymdownx.tasklist: 26 | custom_checkbox: true 27 | - pymdownx.tabbed 28 | - pymdownx.tilde 29 | 30 | nav: 31 | - index.md 32 | - vendors_and_protocols.md 33 | - protocols.md 34 | - protocols_arguments.md 35 | - installation.md 36 | - configuration.md 37 | - run.md 38 | - arguments.md 39 | - inventory.md 40 | - source_of_truth.md 41 | - data_models.md 42 | - netests_cli.md 43 | - troubleshooting.md 44 | - device_used.md 45 | - roadmap.md 46 | - license.md 47 | - divers.md 48 | - youtube.md 49 | - contact.md 50 | - contributors_and_maintainers.md 51 | - release.md 52 | 53 | -------------------------------------------------------------------------------- /netests/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import logging 5 | 6 | 7 | log = logging.getLogger(__name__) 8 | file_handler = logging.FileHandler('netests.log') 9 | formatter = logging.Formatter( 10 | fmt=( 11 | "[%(asctime)s.%(msecs)03d][%(levelname)s]" 12 | "[%(module)s][%(funcName)s:] %(message)s" 13 | ), 14 | datefmt='%Y-%m-%d %H:%M:%S' 15 | ) 16 | file_handler.setFormatter(formatter) 17 | log.addHandler(file_handler) 18 | log.setLevel(logging.DEBUG) 19 | 20 | log.debug( 21 | "\n" 22 | "******************************************************\n" + 23 | "* *\n" + 24 | "* New Netests.io RUN *\n" + 25 | "* *\n" + 26 | "******************************************************\n" 27 | ) 28 | -------------------------------------------------------------------------------- /netests/base_selection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import PLATFORM_SUPPORTED, CONNEXION_MODE 5 | 6 | from netests.exceptions.netests_exceptions import ( 7 | NetestsDeviceNotCompatibleWithNapalm 8 | ) 9 | 10 | 11 | HEADER = "[netests - base_selection]" 12 | 13 | 14 | def base_selection(platform: str, 15 | connection_mode: str, 16 | functions_mapping: dict 17 | ): 18 | return functions_mapping.get(platform).get(connection_mode) 19 | 20 | 21 | def device_not_compatible_with_napalm(task): 22 | raise NetestsDeviceNotCompatibleWithNapalm( 23 | f"Device {task.host.platform} is not compatible with NAPALM...." 24 | ) 25 | 26 | 27 | def host_vars_ok(hostname: str, platform: str, connection_mode: str) -> bool: 28 | if ( 29 | platform in PLATFORM_SUPPORTED and 30 | connection_mode in CONNEXION_MODE 31 | ): 32 | return True 33 | else: 34 | print( 35 | f"{HEADER} ({hostname}) Connexion type not allowed \n" 36 | f"{HEADER} Connexion must be one of the followings: \n" 37 | f"{HEADER} {CONNEXION_MODE}" 38 | ) 39 | return False 40 | -------------------------------------------------------------------------------- /netests/comparators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/comparators/__init__.py -------------------------------------------------------------------------------- /netests/comparators/bgp_up_compare.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from nornir.core.task import Task 5 | from netests import log 6 | from netests.protocols.bgp import BGP 7 | from netests.constants import ( 8 | BGP_SESSIONS_HOST_KEY, 9 | BGP_ALL_BGP_UP_KEY, 10 | BGP_STATE_BRIEF_DOWN 11 | ) 12 | 13 | 14 | def _compare_transit_bgp_up(task, options={}): 15 | task.host[BGP_ALL_BGP_UP_KEY] = _compare_bgp_up( 16 | host_keys=task.host.keys(), 17 | hostname=task.host.name, 18 | groups=task.host.groups, 19 | bgp_host_data=task.host.get(BGP_SESSIONS_HOST_KEY, None), 20 | test=False, 21 | options=options, 22 | task=task 23 | ) 24 | 25 | return task.host[BGP_ALL_BGP_UP_KEY] 26 | 27 | 28 | def _compare_bgp_up( 29 | host_keys, 30 | hostname, 31 | groups, 32 | bgp_host_data: BGP, 33 | test=False, 34 | options={}, 35 | task=Task 36 | ): 37 | log.debug( 38 | "BGP_SESSIONS_HOST_KEY in host_keys=" 39 | f"{BGP_SESSIONS_HOST_KEY in host_keys}\n" 40 | ) 41 | result = True 42 | if BGP_SESSIONS_HOST_KEY in host_keys: 43 | for vrf in bgp_host_data.bgp_sessions_vrf_lst.bgp_sessions_vrf: 44 | for i in vrf.bgp_sessions.bgp_sessions: 45 | if i.state_brief == BGP_STATE_BRIEF_DOWN: 46 | result = False 47 | 48 | return result 49 | -------------------------------------------------------------------------------- /netests/comparators/log_compare.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests import log 5 | 6 | 7 | def log_compare(verity, host_data, hostname, groups): 8 | log.debug( 9 | "\n" 10 | f"COMPARE RESTULT for {hostname} / groups={groups}\n" 11 | "----------------------------\n" 12 | "Object from YAML file :\n" 13 | f"{verity}" 14 | "----------------------------\n" 15 | "Object from Running configuration :\n" 16 | f"{host_data}" 17 | "----------------------------\n" 18 | ) 19 | 20 | 21 | def log_no_yaml_data(prot, key, key_string, hostname, groups): 22 | log.debug( 23 | "\n" 24 | f"COMPARE FUNCTION WAS NOT EXECUTED FOR PROTOCOL={prot} - {hostname}\n" 25 | f"This function is not executed for two potential reasons :\n" 26 | f" 1) No data found in a YAML file for host {hostname} / {groups}.\n" 27 | f" Please be sure that data is defined for this host / protocol\n\n" 28 | f" 2) No data is stored with the key {key} - {key_string}.\n" 29 | f" Please check netests.log file to check why no data is stored\n" 30 | ) 31 | -------------------------------------------------------------------------------- /netests/converters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/arista/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/arista/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/ios/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/ios/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/iosxr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/iosxr/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/iosxr/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.bgp import BGP 5 | 6 | 7 | def _iosxr_bgp_api_converter(hostname: str, cmd_outputs: list) -> BGP: 8 | print("_iosxr_bgp_api_converter") 9 | -------------------------------------------------------------------------------- /netests/converters/bgp/juniper/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/juniper/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/napalm/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/napalm/__init__.py -------------------------------------------------------------------------------- /netests/converters/bgp/nxos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/bgp/nxos/__init__.py -------------------------------------------------------------------------------- /netests/converters/cdp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/cdp/__init__.py -------------------------------------------------------------------------------- /netests/converters/cdp/ios/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.protocols.cdp import ListCDP 6 | 7 | 8 | def _ios_cdp_api_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> ListCDP: 13 | 14 | if not isinstance(cmd_output, dict): 15 | if isinstance(cmd_output, bytes): 16 | if cmd_output.decode() != "": 17 | cmd_output = json.loads(cmd_output) 18 | else: 19 | cmd_output = json.loads(cmd_output) 20 | 21 | cdp_neighbors_lst = ListCDP( 22 | cdp_neighbors_lst=list() 23 | ) 24 | 25 | return cdp_neighbors_lst 26 | -------------------------------------------------------------------------------- /netests/converters/cdp/ios/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.tools.nc import format_xml_output 5 | from netests.protocols.cdp import ListCDP 6 | 7 | 8 | def _ios_cdp_nc_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> ListCDP: 13 | 14 | cmd_output = format_xml_output(cmd_output) 15 | 16 | cdp_neighbors_lst = ListCDP( 17 | cdp_neighbors_lst=list() 18 | ) 19 | 20 | if ( 21 | 'data' in cmd_output.keys() and 22 | 'cdp-neighbor-details' in cmd_output.get('data').keys() 23 | ): 24 | pass 25 | 26 | return cdp_neighbors_lst 27 | -------------------------------------------------------------------------------- /netests/converters/cdp/iosxr/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import NOT_SET 5 | from netests.tools.cli import parse_textfsm 6 | from netests.protocols.cdp import CDP, ListCDP 7 | from netests.mappings import mapping_sys_capabilities 8 | 9 | 10 | def _iosxr_cdp_ssh_converter( 11 | hostname: str, 12 | cmd_output, 13 | options={} 14 | ) -> ListCDP: 15 | 16 | cmd_output = parse_textfsm( 17 | content=cmd_output, 18 | template_file="cisco_xr_show_cdp_neighbors_detail.textfsm" 19 | ) 20 | 21 | cdp_neighbors_lst = ListCDP( 22 | cdp_neighbors_lst=list() 23 | ) 24 | 25 | for n in cmd_output: 26 | capabilities = list() 27 | for c in n[7].split(" "): 28 | if mapping_sys_capabilities(c) != NOT_SET: 29 | capabilities.append( 30 | mapping_sys_capabilities(c) 31 | ) 32 | 33 | cdp_neighbors_lst.cdp_neighbors_lst.append( 34 | CDP( 35 | local_name=hostname, 36 | local_port=n[5], 37 | neighbor_mgmt_ip=n[2], 38 | neighbor_name=n[0], 39 | neighbor_port=n[4], 40 | neighbor_os=n[6], 41 | neighbor_type=capabilities, 42 | options=options 43 | ) 44 | ) 45 | 46 | return cdp_neighbors_lst 47 | -------------------------------------------------------------------------------- /netests/converters/cdp/napalm/converter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.cdp import ListCDP 5 | 6 | 7 | def _napalm_cdp_converter( 8 | hostname: str(), 9 | cmd_output: dict, 10 | options={} 11 | ) -> ListCDP: 12 | pass 13 | -------------------------------------------------------------------------------- /netests/converters/cdp/nxos/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.protocols.cdp import ListCDP 6 | 7 | 8 | def _nxos_cdp_nc_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> ListCDP: 13 | 14 | cdp_neighbors_lst = ListCDP( 15 | cdp_neighbors_lst=list() 16 | ) 17 | 18 | if not isinstance(cmd_output, dict): 19 | cmd_output = json.loads(cmd_output) 20 | 21 | return cdp_neighbors_lst 22 | -------------------------------------------------------------------------------- /netests/converters/facts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/facts/__init__.py -------------------------------------------------------------------------------- /netests/converters/facts/arista/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.facts import Facts 5 | 6 | 7 | def _arista_facts_nc_converter( 8 | hostname: str(), 9 | cmd_output, 10 | options={} 11 | ) -> Facts: 12 | pass 13 | -------------------------------------------------------------------------------- /netests/converters/facts/iosxr/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.facts import Facts 5 | from netests.constants import NOT_SET 6 | 7 | 8 | def _iosxr_facts_nc_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> Facts: 13 | 14 | hostname = NOT_SET 15 | domain = NOT_SET 16 | version = NOT_SET 17 | serial = NOT_SET 18 | model = NOT_SET 19 | interfaces_lst = list() 20 | 21 | return Facts( 22 | hostname=hostname, 23 | domain=domain, 24 | version=version, 25 | build=NOT_SET, 26 | serial=serial, 27 | base_mac=NOT_SET, 28 | memory=NOT_SET, 29 | vendor="Cisco", 30 | model=model, 31 | interfaces_lst=interfaces_lst, 32 | options=options 33 | ) 34 | -------------------------------------------------------------------------------- /netests/converters/facts/juniper/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.facts import Facts 5 | from netests.tools.nc import format_xml_output 6 | from netests.constants import NOT_SET, FACTS_INT_DICT_KEY, FACTS_SYS_DICT_KEY 7 | 8 | 9 | def _juniper_facts_nc_converter( 10 | hostname: str(), 11 | cmd_output, 12 | options={} 13 | ) -> Facts: 14 | 15 | interfaces_lst = list() 16 | for i in format_xml_output( 17 | cmd_output.get(FACTS_INT_DICT_KEY) 18 | ).get('interface-information').get('physical-interface'): 19 | interfaces_lst.append(i.get('name')) 20 | 21 | return Facts( 22 | hostname=cmd_output.get(FACTS_SYS_DICT_KEY).get('hostname', NOT_SET), 23 | domain=cmd_output.get(FACTS_SYS_DICT_KEY).get('domain', NOT_SET), 24 | build=NOT_SET, 25 | version=cmd_output.get(FACTS_SYS_DICT_KEY).get('version', NOT_SET), 26 | serial=cmd_output.get(FACTS_SYS_DICT_KEY).get('serialnumber', NOT_SET), 27 | base_mac=NOT_SET, 28 | memory=NOT_SET, 29 | vendor="Juniper", 30 | model=cmd_output.get(FACTS_SYS_DICT_KEY).get('model', NOT_SET).upper(), 31 | interfaces_lst=interfaces_lst, 32 | options=options 33 | ) 34 | -------------------------------------------------------------------------------- /netests/converters/lldp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/lldp/__init__.py -------------------------------------------------------------------------------- /netests/converters/lldp/ios/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.lldp import ListLLDP 5 | 6 | 7 | def _ios_lldp_api_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> ListLLDP: 12 | 13 | print(cmd_output) 14 | 15 | lldp_neighbors_lst = ListLLDP( 16 | lldp_neighbors_lst=list() 17 | ) 18 | 19 | return lldp_neighbors_lst 20 | -------------------------------------------------------------------------------- /netests/converters/lldp/ios/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.tools.nc import format_xml_output 5 | from netests.protocols.lldp import ListLLDP 6 | 7 | 8 | def _ios_lldp_nc_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> ListLLDP: 13 | 14 | cmd_output = format_xml_output(cmd_output) 15 | 16 | print(cmd_output) 17 | 18 | lldp_neighbors_lst = ListLLDP( 19 | lldp_neighbors_lst=list() 20 | ) 21 | 22 | if ( 23 | 'data' in cmd_output.keys() and 24 | 'lldp-entries' in cmd_output.get('data').keys() 25 | ): 26 | pass 27 | 28 | return lldp_neighbors_lst 29 | -------------------------------------------------------------------------------- /netests/converters/lldp/iosxr/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.tools.nc import format_xml_output 5 | from netests.protocols.lldp import ListLLDP 6 | 7 | 8 | def _iosxr_lldp_nc_converter( 9 | hostname: str, 10 | cmd_output: dict, 11 | options={} 12 | ) -> ListLLDP: 13 | 14 | lldp_neighbors_lst = ListLLDP( 15 | lldp_neighbors_lst=list() 16 | ) 17 | 18 | cmd_output = format_xml_output(cmd_output) 19 | 20 | return lldp_neighbors_lst 21 | -------------------------------------------------------------------------------- /netests/converters/lldp/iosxr/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import NOT_SET 5 | from netests.tools.cli import parse_textfsm 6 | from netests.protocols.lldp import LLDP, ListLLDP 7 | from netests.mappings import mapping_sys_capabilities 8 | 9 | 10 | def _iosxr_lldp_ssh_converter( 11 | hostname: str, 12 | cmd_output, 13 | options={} 14 | ) -> ListLLDP: 15 | 16 | cmd_output = parse_textfsm( 17 | content=cmd_output, 18 | template_file="cisco_xr_show_lldp_neighbors.textfsm" 19 | ) 20 | 21 | lldp_neighbors_lst = ListLLDP( 22 | lldp_neighbors_lst=list() 23 | ) 24 | 25 | for nei in cmd_output: 26 | capabilities = list() 27 | for c in nei[3]: 28 | if c.isdigit(): 29 | capabilities.append( 30 | mapping_sys_capabilities(c) 31 | ) 32 | 33 | lldp_neighbors_lst.lldp_neighbors_lst.append( 34 | LLDP( 35 | local_name=hostname, 36 | local_port=nei[1] if nei[1] != '' else NOT_SET, 37 | neighbor_mgmt_ip=NOT_SET, 38 | neighbor_name=nei[0] if nei[0] != '' else NOT_SET, 39 | neighbor_port=nei[2] if nei[2] != '' else NOT_SET, 40 | neighbor_os=NOT_SET, 41 | neighbor_type=capabilities, 42 | options=options 43 | ) 44 | ) 45 | 46 | return lldp_neighbors_lst 47 | -------------------------------------------------------------------------------- /netests/converters/lldp/napalm/converter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.constants import NOT_SET as NSET 6 | from netests.protocols.lldp import LLDP, ListLLDP 7 | 8 | 9 | def _napalm_lldp_converter( 10 | hostname: str(), 11 | cmd_output: json, 12 | options={} 13 | ) -> ListLLDP: 14 | 15 | lldp_neighbors_lst = ListLLDP( 16 | lldp_neighbors_lst=list() 17 | ) 18 | 19 | if not isinstance(cmd_output, dict): 20 | cmd_output = json.loads(cmd_output) 21 | 22 | if 'get_lldp_neighbors_detail' in cmd_output.keys(): 23 | for i, f in cmd_output.get('get_lldp_neighbors_detail').items(): 24 | for n in f: 25 | lldp_neighbors_lst.lldp_neighbors_lst.append( 26 | LLDP( 27 | local_name=hostname, 28 | local_port=i, 29 | neighbor_mgmt_ip=NSET, 30 | neighbor_name=n.get("remote_system_name", NSET), 31 | neighbor_port=n.get("remote_port"), 32 | neighbor_os=n.get("remote_system_description", NSET), 33 | neighbor_type=n.get("remote_system_capab", NSET), 34 | options=options 35 | ) 36 | ) 37 | 38 | return lldp_neighbors_lst 39 | -------------------------------------------------------------------------------- /netests/converters/lldp/nxos/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.protocols.lldp import ListLLDP 6 | 7 | 8 | def _nxos_lldp_nc_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> ListLLDP: 13 | 14 | lldp_neighbors_lst = ListLLDP( 15 | lldp_neighbors_lst=list() 16 | ) 17 | 18 | if not isinstance(cmd_output, dict): 19 | cmd_output = json.loads(cmd_output) 20 | 21 | return lldp_neighbors_lst 22 | -------------------------------------------------------------------------------- /netests/converters/ospf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/ospf/__init__.py -------------------------------------------------------------------------------- /netests/converters/ospf/arista/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.ospf import ListOSPFSessionsVRF, OSPF 5 | 6 | 7 | def _arista_ospf_nc_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> OSPF: 12 | 13 | ospf_vrf_lst = ListOSPFSessionsVRF( 14 | ospf_sessions_vrf_lst=list() 15 | ) 16 | 17 | return OSPF( 18 | hostname=hostname, 19 | ospf_sessions_vrf_lst=ospf_vrf_lst 20 | ) 21 | -------------------------------------------------------------------------------- /netests/converters/ospf/ios/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.ospf import OSPF, ListOSPFSessionsVRF 5 | 6 | 7 | def _ios_ospf_api_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> OSPF: 12 | 13 | return OSPF( 14 | hostname=hostname, 15 | ospf_sessions_vrf_lst=ListOSPFSessionsVRF( 16 | ospf_sessions_vrf_lst=list() 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /netests/converters/ospf/ios/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.ospf import ListOSPFSessionsVRF, OSPF 5 | 6 | 7 | def _ios_ospf_nc_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> OSPF: 12 | 13 | return OSPF( 14 | hostname=hostname, 15 | ospf_sessions_vrf_lst=ListOSPFSessionsVRF( 16 | ospf_sessions_vrf_lst=list() 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /netests/converters/ospf/iosxr/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.ospf import ListOSPFSessionsVRF, OSPF 5 | 6 | 7 | def _iosxr_ospf_nc_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> OSPF: 12 | 13 | ospf_vrf_lst = ListOSPFSessionsVRF( 14 | ospf_sessions_vrf_lst=list() 15 | ) 16 | 17 | return OSPF( 18 | hostname=hostname, 19 | ospf_sessions_vrf_lst=ospf_vrf_lst 20 | ) 21 | -------------------------------------------------------------------------------- /netests/converters/ospf/iosxr/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.ospf import ListOSPFSessionsVRF, OSPF 5 | 6 | 7 | def _iosxr_ospf_ssh_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> OSPF: 12 | 13 | ospf_vrf_lst = ListOSPFSessionsVRF( 14 | ospf_sessions_vrf_lst=list() 15 | ) 16 | 17 | return OSPF( 18 | hostname=hostname, 19 | ospf_sessions_vrf_lst=ospf_vrf_lst 20 | ) 21 | -------------------------------------------------------------------------------- /netests/converters/ping/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/ping/__init__.py -------------------------------------------------------------------------------- /netests/converters/ping/arista/validator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def arista_generic_ping_validator(output: str, must_works: bool) -> bool: 6 | if ( 7 | must_works is True and 8 | ( 9 | "Network is unreachable" in output or 10 | "failure in name resolution" in output or 11 | "100% packet loss" in output or 12 | "0 received" in output or 13 | "Invalid input - VRF" in output 14 | ) 15 | ): 16 | return False 17 | 18 | if ( 19 | must_works is False and 20 | ( 21 | "rtt min/avg/max/mdev" in output or 22 | "1 received" in output or 23 | # DONT REMOVE THE SPACE BEFORE THE '0' !!! 24 | " 0% packet loss" in output 25 | ) 26 | ): 27 | return False 28 | 29 | return True 30 | 31 | 32 | def arista_api_ping_validator(output: str, must_works: bool) -> bool: 33 | return arista_generic_ping_validator(output, must_works) 34 | 35 | 36 | def arista_netconf_ping_validator(output: str, must_works: bool) -> bool: 37 | return False 38 | 39 | 40 | def arista_ssh_ping_validator(output: str, must_works: bool) -> bool: 41 | return arista_generic_ping_validator(output, must_works) 42 | -------------------------------------------------------------------------------- /netests/converters/ping/cumulus/validator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def cumulus_api_ping_validator(output: str, must_works: bool) -> bool: 6 | pass 7 | 8 | 9 | def cumulus_netconf_ping_validator(output: str, must_works: bool) -> bool: 10 | pass 11 | 12 | 13 | def cumulus_ssh_ping_validator(output: str, must_works: bool) -> bool: 14 | pass 15 | -------------------------------------------------------------------------------- /netests/converters/ping/extreme_vsp/validator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def extreme_vsp_api_ping_validator(output: str, must_works: bool) -> bool: 6 | return False 7 | 8 | 9 | def extreme_vsp_netconf_ping_validator(output: str, must_works: bool) -> bool: 10 | return False 11 | 12 | 13 | def extreme_vsp_ssh_ping_validator(output: str, must_works: bool) -> bool: 14 | if ( 15 | must_works is True and 16 | ( 17 | "The VRF Name entered does not correspond" in output or 18 | "no answer from" in output or 19 | "Invalid host name format or IP address" in output 20 | ) 21 | ): 22 | return False 23 | 24 | if ( 25 | must_works is False and 26 | ( 27 | "is alive" in output 28 | ) 29 | ): 30 | return False 31 | 32 | return True 33 | -------------------------------------------------------------------------------- /netests/converters/ping/ios/validator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def ios_api_ping_validator(output: str, must_works: bool) -> bool: 6 | return False 7 | 8 | 9 | def ios_netconf_ping_validator(output: str, must_works: bool) -> bool: 10 | return False 11 | 12 | 13 | def ios_ssh_ping_validator(output: str, must_works: bool) -> bool: 14 | if ( 15 | must_works is True and 16 | ( 17 | "Unrecognized host or address" in output or 18 | "Success rate is 0 percent" in output or 19 | "Invalid input detected at" in output or 20 | "Unable to find vrf" in output or 21 | "does not have a usable source address" in output 22 | ) 23 | ): 24 | return False 25 | 26 | if ( 27 | must_works is False and 28 | ( 29 | "Success rate is 100 percent" in output or 30 | "round-trip min/avg/max" in output 31 | ) 32 | ): 33 | return False 34 | 35 | return True 36 | -------------------------------------------------------------------------------- /netests/converters/ping/nxos/validator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def nxos_generic_ping_validator(output: str, must_works: bool) -> bool: 6 | if ( 7 | must_works is True and 8 | ( 9 | "address is not permitted" in output or 10 | "No route to host" in output or 11 | "100.00% packet loss" in output or 12 | "0 packets received" in output or 13 | "ping: bad context" in output or 14 | "Invalid host/interface" in output 15 | ) 16 | ): 17 | return False 18 | 19 | if ( 20 | must_works is False and 21 | ( 22 | "1 packets received" in output or 23 | # DONT REMOVE THE SPACE BEFORE THE '0' !!! 24 | " 0.00% packet loss" in output or 25 | "round-trip min/avg/max" in output 26 | ) 27 | ): 28 | return False 29 | 30 | return True 31 | 32 | 33 | def nxos_api_ping_validator(output: str, must_works: bool) -> bool: 34 | return nxos_generic_ping_validator(output, must_works) 35 | 36 | 37 | def nxos_netconf_ping_validator(output: str, must_works: bool) -> bool: 38 | return False 39 | 40 | 41 | def nxos_ssh_ping_validator(output: str, must_works: bool) -> bool: 42 | return nxos_generic_ping_validator(output, must_works) 43 | -------------------------------------------------------------------------------- /netests/converters/ping/ping_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from nornir.core import Nornir 5 | from netests.converters.ping.retrieve_ping import retrieve_ping_from_yaml 6 | from netests.converters.ping.ping_generate import _generic_generate_ping_cmd 7 | 8 | 9 | HEADER = "[netests - execute_ping]" 10 | 11 | 12 | def get_ping(nr: Nornir, options={}) -> bool: 13 | devices = nr.filter() 14 | 15 | if len(devices.inventory.hosts) == 0: 16 | raise Exception(f"[{HEADER}] no device selected.") 17 | 18 | devices.run( 19 | task=retrieve_ping_from_yaml, 20 | on_failed=True, 21 | num_workers=10 22 | ) 23 | 24 | devices.run( 25 | task=_generic_generate_ping_cmd, 26 | on_failed=True, 27 | num_workers=10 28 | ) 29 | -------------------------------------------------------------------------------- /netests/converters/vlan/ios/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.vlan import ListVLAN 5 | 6 | 7 | def _ios_vlan_api_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> ListVLAN: 12 | 13 | vlan_lst = ListVLAN( 14 | vlan_lst=list() 15 | ) 16 | 17 | print(cmd_output) 18 | 19 | return vlan_lst 20 | -------------------------------------------------------------------------------- /netests/converters/vlan/ios/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.protocols.vlan import ListVLAN 5 | 6 | 7 | def _ios_vlan_nc_converter( 8 | hostname: str, 9 | cmd_output, 10 | options={} 11 | ) -> ListVLAN: 12 | 13 | vlan_lst = ListVLAN( 14 | vlan_lst=list() 15 | ) 16 | 17 | print(cmd_output) 18 | 19 | return vlan_lst 20 | -------------------------------------------------------------------------------- /netests/converters/vlan/ios/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.tools.cli import parse_textfsm 5 | from netests.protocols.vlan import ListVLAN 6 | 7 | 8 | def _ios_vlan_ssh_converter( 9 | hostname: str, 10 | cmd_output, 11 | options={} 12 | ) -> ListVLAN: 13 | 14 | vlan_lst = ListVLAN( 15 | vlan_lst=list() 16 | ) 17 | 18 | cmd_output = parse_textfsm( 19 | content=cmd_output, 20 | template_file='cisco_ios_show_vlan.textfsm' 21 | ) 22 | 23 | print(cmd_output) 24 | 25 | return vlan_lst 26 | -------------------------------------------------------------------------------- /netests/converters/vrf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/converters/vrf/__init__.py -------------------------------------------------------------------------------- /netests/converters/vrf/arista/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.constants import NOT_SET 6 | from netests.protocols.vrf import VRF, ListVRF 7 | 8 | 9 | def _arista_vrf_api_converter( 10 | hostname: str(), 11 | cmd_output, 12 | options={} 13 | ) -> ListVRF: 14 | 15 | if not isinstance(cmd_output['result'][0], dict): 16 | cmd_output = json.loads(cmd_output['result'][0]) 17 | else: 18 | cmd_output = cmd_output['result'][0] 19 | 20 | vrf_list = ListVRF(list()) 21 | for vrf_name, facts in cmd_output.get('vrfs').items(): 22 | if ( 23 | facts.get('routeDistinguisher', NOT_SET) == NOT_SET or 24 | facts.get('routeDistinguisher', NOT_SET) == '' 25 | ): 26 | rd = NOT_SET 27 | else: 28 | rd = facts.get('routeDistinguisher', NOT_SET) 29 | 30 | vrf_list.vrf_lst.append( 31 | VRF( 32 | vrf_name=vrf_name, 33 | vrf_id=NOT_SET, 34 | vrf_type=NOT_SET, 35 | l3_vni=NOT_SET, 36 | rd=rd, 37 | rt_imp=NOT_SET, 38 | rt_exp=NOT_SET, 39 | imp_targ=NOT_SET, 40 | exp_targ=NOT_SET, 41 | options=options 42 | ) 43 | ) 44 | 45 | return vrf_list 46 | -------------------------------------------------------------------------------- /netests/converters/vrf/arista/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.constants import NOT_SET 6 | from netests.protocols.vrf import VRF, ListVRF 7 | 8 | 9 | def _arista_vrf_ssh_converter( 10 | hostname: str(), 11 | cmd_output, 12 | options={} 13 | ) -> ListVRF: 14 | 15 | if not isinstance(cmd_output, dict): 16 | cmd_output = json.loads(cmd_output) 17 | 18 | vrf_list = ListVRF(list()) 19 | for vrf_name, facts in cmd_output.get('vrfs').items(): 20 | if ( 21 | facts.get('routeDistinguisher', NOT_SET) == NOT_SET or 22 | facts.get('routeDistinguisher', NOT_SET) == '' 23 | ): 24 | rd = NOT_SET 25 | else: 26 | rd = facts.get('routeDistinguisher', NOT_SET) 27 | 28 | vrf_obj = VRF( 29 | vrf_name=vrf_name, 30 | vrf_id=NOT_SET, 31 | vrf_type=NOT_SET, 32 | l3_vni=NOT_SET, 33 | rd=rd, 34 | rt_imp=NOT_SET, 35 | rt_exp=NOT_SET, 36 | imp_targ=NOT_SET, 37 | exp_targ=NOT_SET, 38 | options=options 39 | ) 40 | 41 | vrf_list.vrf_lst.append( 42 | vrf_obj 43 | ) 44 | 45 | return vrf_list 46 | -------------------------------------------------------------------------------- /netests/converters/vrf/cumulus/api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import NOT_SET 5 | from netests.tools.cli import parse_textfsm 6 | from netests.protocols.vrf import VRF, ListVRF 7 | 8 | 9 | def _cumulus_vrf_api_converter( 10 | hostname: str(), 11 | cmd_output, 12 | options={} 13 | ) -> ListVRF: 14 | 15 | cmd_output = parse_textfsm( 16 | content=cmd_output.decode(), 17 | template_file='cumulus_net_show_vrf.textfsm' 18 | ) 19 | 20 | list_vrf = ListVRF(list()) 21 | list_vrf.vrf_lst.append( 22 | VRF( 23 | vrf_name="default", 24 | vrf_id="1000", 25 | vrf_type=NOT_SET, 26 | l3_vni=NOT_SET, 27 | rd=NOT_SET, 28 | rt_imp=NOT_SET, 29 | rt_exp=NOT_SET, 30 | imp_targ=NOT_SET, 31 | exp_targ=NOT_SET, 32 | options=options 33 | ) 34 | ) 35 | 36 | for line in cmd_output: 37 | list_vrf.vrf_lst.append(VRF( 38 | vrf_name=line[0], 39 | vrf_id=line[1], 40 | vrf_type=NOT_SET, 41 | l3_vni=NOT_SET, 42 | rd=NOT_SET, 43 | rt_imp=NOT_SET, 44 | rt_exp=NOT_SET, 45 | imp_targ=NOT_SET, 46 | exp_targ=NOT_SET, 47 | options=options 48 | ) 49 | ) 50 | 51 | return list_vrf 52 | -------------------------------------------------------------------------------- /netests/converters/vrf/cumulus/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import NOT_SET 5 | from netests.tools.cli import parse_textfsm 6 | from netests.protocols.vrf import VRF, ListVRF 7 | 8 | 9 | def _cumulus_vrf_ssh_converter( 10 | hostname: str(), 11 | cmd_output, 12 | options={} 13 | ) -> ListVRF: 14 | 15 | cmd_output = parse_textfsm( 16 | content=cmd_output, 17 | template_file='cumulus_net_show_vrf.textfsm' 18 | ) 19 | 20 | vrf_list = ListVRF(list()) 21 | 22 | vrf_list.vrf_lst.append( 23 | VRF( 24 | vrf_name="default", 25 | vrf_id="1000", 26 | vrf_type=NOT_SET, 27 | l3_vni=NOT_SET, 28 | rd=NOT_SET, 29 | rt_imp=NOT_SET, 30 | rt_exp=NOT_SET, 31 | imp_targ=NOT_SET, 32 | exp_targ=NOT_SET, 33 | options=options 34 | ) 35 | ) 36 | 37 | for line in cmd_output: 38 | vrf_list.vrf_lst.append( 39 | VRF( 40 | vrf_name=line[0], 41 | vrf_id=line[1], 42 | vrf_type=NOT_SET, 43 | l3_vni=NOT_SET, 44 | rd=NOT_SET, 45 | rt_imp=NOT_SET, 46 | rt_exp=NOT_SET, 47 | imp_targ=NOT_SET, 48 | exp_targ=NOT_SET, 49 | options=options 50 | ) 51 | ) 52 | 53 | return vrf_list 54 | -------------------------------------------------------------------------------- /netests/converters/vrf/juniper/vrf_juniper_filters.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def _juniper_vrf_filter(vrf_name: str) -> bool: 6 | """ 7 | This function will remove Juniper system. VRF 8 | - "master" 9 | - "__juniper_private1__" 10 | - "__juniper_private2__" 11 | - "__juniper_private4__" 12 | - "__master.anon__" 13 | 14 | :param vrf_name: 15 | :return bool: True if the VRF must be added in the list 16 | """ 17 | return "__" not in vrf_name 18 | 19 | 20 | def _juniper_vrf_default_mapping(vrf_name: str) -> str: 21 | """ 22 | This function will convert Juniper global/default/master routing instance 23 | => master => default 24 | 25 | :param vrf_name: 26 | :return str: "default" if vrf_name = "master" else vrf_name 27 | """ 28 | 29 | if vrf_name == "master": 30 | return "default" 31 | else: 32 | return vrf_name 33 | -------------------------------------------------------------------------------- /netests/converters/vrf/napalm/converter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import NOT_SET 5 | from netests.protocols.vrf import VRF, ListVRF 6 | 7 | 8 | def _napalm_vrf_converter( 9 | hostname: str(), 10 | cmd_output: dict, 11 | options={} 12 | ) -> ListVRF: 13 | 14 | vrf_list = ListVRF(list()) 15 | 16 | for vrf in cmd_output.get('get_network_instances'): 17 | 18 | vrf_list.vrf_lst.append( 19 | VRF( 20 | vrf_name=vrf, 21 | vrf_type=cmd_output.get('get_network_instances') 22 | .get(vrf) 23 | .get('type', NOT_SET), 24 | rd=cmd_output.get('get_network_instances') 25 | .get(vrf) 26 | .get('state') 27 | .get('route_distinguisher') 28 | if cmd_output.get('get_network_instances') 29 | .get(vrf) 30 | .get('state') 31 | .get('route_distinguisher', NOT_SET) 32 | != "" else NOT_SET 33 | ) 34 | ) 35 | 36 | return vrf_list 37 | -------------------------------------------------------------------------------- /netests/converters/vrf/nxos/ssh.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from netests.constants import NOT_SET 6 | from netests.protocols.vrf import VRF, ListVRF 7 | 8 | 9 | def _nxos_vrf_ssh_converter( 10 | hostname: str(), 11 | cmd_output, 12 | options={} 13 | ) -> ListVRF: 14 | 15 | if not isinstance(cmd_output, dict): 16 | cmd_output = json.loads(cmd_output) 17 | 18 | vrf_list = ListVRF(list()) 19 | for vrf in cmd_output.get('TABLE_vrf', NOT_SET).get('ROW_vrf'): 20 | vrf_list.vrf_lst.append( 21 | VRF( 22 | vrf_name=vrf.get('vrf_name', NOT_SET), 23 | vrf_id=vrf.get('vrf_id', NOT_SET), 24 | vrf_type=NOT_SET, 25 | l3_vni=NOT_SET, 26 | rd=vrf.get('rd') if vrf.get('rd') != '0:0' else NOT_SET, 27 | rt_imp=NOT_SET, 28 | rt_exp=NOT_SET, 29 | imp_targ=NOT_SET, 30 | exp_targ=NOT_SET, 31 | options=options 32 | ) 33 | ) 34 | 35 | return vrf_list 36 | -------------------------------------------------------------------------------- /netests/data_models/bgp.yml: -------------------------------------------------------------------------------- 1 | 2 | default: 3 | as_number: 65432 4 | router_id: 10.100.20.1 5 | neighbors: {} 6 | 7 | NETESTS_VRF: 8 | as_number: 65432 9 | router_id: 10.1.20.1 10 | neighbors: 11 | - peer_hostname: NOT_SET 12 | peer_ip: 10.0.0.1 13 | prefix_received: 0 14 | remote_as: 65111 15 | session_state: Active 16 | src_hostname: leaf01 17 | state_brief: DOWN 18 | state_time: 0 19 | 20 | CUSTOMER_VRF: 21 | as_number: 65432 22 | router_id: 10.1.20.1 23 | neighbors: 24 | - peer_ip: 10.0.0.1000 25 | remote_as: 65100 26 | state_brief: DOWN 27 | -------------------------------------------------------------------------------- /netests/data_models/cdp.yml: -------------------------------------------------------------------------------- 1 | 2 | - local_name: leaf01 3 | local_port: swp1 4 | neighbor_name: leaf03.dh.local 5 | neighbor_port: Ethernet1 6 | 7 | - local_name: leaf01 8 | local_port: swp2 9 | neighbor_mgmt_ip: 172.16.194.62 10 | neighbor_name: spine02 11 | neighbor_os: VSP-8284XSQ (8.1.0.0) 12 | neighbor_port: 1/1 13 | neighbor_type: 14 | - Bridge 15 | - Router 16 | -------------------------------------------------------------------------------- /netests/data_models/facts.yml: -------------------------------------------------------------------------------- 1 | 2 | base_mac: 50:00:00:d7:ee:0b 3 | build: da8d6269-c25f-4a12-930b-c3c42c12c38a 4 | domain: dh.local 5 | hostname: leaf03 6 | interfaces_lst: 7 | - Management1 8 | - Ethernet8 9 | - Ethernet2 10 | - Ethernet3 11 | - Ethernet1 12 | - Ethernet6 13 | - Ethernet7 14 | - Ethernet4 15 | - Ethernet5 16 | memory: 2014424 17 | model: vEOS 18 | serial: UEH29DB23DH0238DH023 19 | vendor: Arista 20 | version: 4.24.0F 21 | -------------------------------------------------------------------------------- /netests/data_models/lldp.yml: -------------------------------------------------------------------------------- 1 | 2 | - local_name: leaf01 3 | local_port: swp1 4 | neighbor_name: leaf03.dh.local 5 | neighbor_port: Ethernet1 6 | 7 | - local_name: leaf01 8 | local_port: swp2 9 | neighbor_mgmt_ip: 172.16.194.62 10 | neighbor_name: spine02 11 | neighbor_os: VSP-8284XSQ (8.1.0.0) 12 | neighbor_port: 1/1 13 | neighbor_type: 14 | - Bridge 15 | - Router 16 | -------------------------------------------------------------------------------- /netests/data_models/netests.yml: -------------------------------------------------------------------------------- 1 | config: 2 | protocols: 3 | bgp: 4 | test: true 5 | 6 | bgp_up: 7 | test: true 8 | 9 | cdp: 10 | test: true 11 | 12 | facts: 13 | test: true 14 | 15 | lldp: 16 | test: true 17 | 18 | ospf: 19 | test: true 20 | 21 | ping: 22 | test: true 23 | 24 | vrf: 25 | test: true 26 | -------------------------------------------------------------------------------- /netests/data_models/ospf.yml: -------------------------------------------------------------------------------- 1 | 2 | hostname: leaf01 3 | vrfs: 4 | - areas: [] 5 | router_id: 51.51.51.51 6 | vrf_name: default 7 | 8 | - router_id: 151.151.151.151 9 | vrf_name: NETESTS_VRF 10 | areas: 11 | - area_number: 0.0.0.0 12 | neighbors: 13 | - local_interface: swp1 14 | peer_hostname: NOT_SET 15 | peer_ip: 10.1.2.2 16 | peer_rid: 53.53.53.53 17 | session_state: FULL 18 | - local_interface: swp2 19 | peer_ip: 10.1.20.2 20 | peer_rid: 62.62.62.62 21 | session_state: FULL 22 | -------------------------------------------------------------------------------- /netests/data_models/ping.yml: -------------------------------------------------------------------------------- 1 | 2 | - ip: 127.0.0.1 3 | works: true 4 | - ip: 8.8.8.8 5 | works: false 6 | - ip: 172.16.194.111 7 | works: false 8 | - ip: 172.16.194.1 9 | vrf: mgmt 10 | works: false 11 | - ip: 172.16.194.1 12 | vrf: ewfjweijfoeirjfer 13 | works: false 14 | -------------------------------------------------------------------------------- /netests/data_models/vlan.yml: -------------------------------------------------------------------------------- 1 | 2 | - id: 1 3 | name: default 4 | vrf_name: default 5 | ipv4_addresses: 6 | - ip_address: 1.1.1.1 7 | netmask: 255.0.0.0 8 | - ip_address: 10.1.1.2 9 | netmask: 255.255.255.255 10 | ipv6_addresses: 11 | - ip_address: 2001:cafe::1 12 | netmask: 64 13 | - ip_address: 2001:c0ca::1 14 | netmask: 64 15 | assigned_ports: 16 | - swp1 17 | - swp2 18 | - swp3 19 | -------------------------------------------------------------------------------- /netests/data_models/vrf.yml: -------------------------------------------------------------------------------- 1 | 2 | - exp_targ: NOT_SET 3 | imp_targ: NOT_SET 4 | l3_vni: NOT_SET 5 | rd: NOT_SET 6 | rt_exp: NOT_SET 7 | rt_imp: NOT_SET 8 | vrf_id: 1000 9 | vrf_name: default 10 | vrf_type: NOT_SET 11 | - vrf_name: NETESTS_VRF 12 | - rd: 65123:1 13 | rt_exp: 65123:100 14 | rt_imp: 65123:200 15 | vrf_id: '1002' 16 | vrf_name: mgmt 17 | -------------------------------------------------------------------------------- /netests/exceptions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/exceptions/__init__.py -------------------------------------------------------------------------------- /netests/exceptions/netests_cli_exceptions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.exceptions.netests_exceptions import NetestsException 5 | 6 | 7 | class NetestsCLINornirObjectIsNone(NetestsException): 8 | pass 9 | -------------------------------------------------------------------------------- /netests/exceptions/netests_exceptions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | class NetestsException(Exception): 6 | pass 7 | 8 | 9 | class NetestsFunctionNotImplemented(NetestsException): 10 | pass 11 | 12 | 13 | class NetestsFunctionNotPossible(NetestsException): 14 | pass 15 | 16 | 17 | class NetestsDeviceNotCompatibleWithNapalm(NetestsException): 18 | pass 19 | 20 | 21 | class NetestsHTTPStatusCodeError(NetestsException): 22 | pass 23 | 24 | 25 | class NetestsOverideTruthVarsKeyUnsupported(NetestsException): 26 | pass 27 | 28 | 29 | class NetestsErrorWithPingExecution(NetestsException): 30 | pass 31 | 32 | 33 | class NetestsPingConnectionNotPossible(NetestsException): 34 | pass 35 | -------------------------------------------------------------------------------- /netests/exceptions/netests_iosxr_exceptions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.exceptions.netests_exceptions import NetestsException 5 | 6 | 7 | class NetestsIOSXRNetconfOutputError(NetestsException): 8 | pass 9 | 10 | 11 | class NetestsIOSXRApiOutputError(NetestsException): 12 | pass 13 | 14 | 15 | class NetestsIOSXRSshOutputError(NetestsException): 16 | pass 17 | -------------------------------------------------------------------------------- /netests/getters/bgp_up_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests import log 5 | from netests.getters.bgp_get import GetterBGP 6 | from netests.comparators.bgp_up_compare import _compare_transit_bgp_up 7 | 8 | 9 | class GetterBGPUp(GetterBGP): 10 | 11 | def __init__( 12 | self, 13 | nr, 14 | options, 15 | from_cli, 16 | num_workers, 17 | verbose, 18 | print_task_output, 19 | filename, 20 | protocol, 21 | key_store, 22 | ): 23 | super().__init__( 24 | nr, 25 | options, 26 | from_cli, 27 | num_workers, 28 | verbose, 29 | print_task_output, 30 | filename, 31 | protocol, 32 | key_store, 33 | ) 34 | 35 | def compare(self): 36 | log.debug( 37 | f"CALL _compare_transit_bgp_up num_workers={self.num_workers}" 38 | ) 39 | data = self.devices.run( 40 | task=_compare_transit_bgp_up, 41 | on_failed=True, 42 | num_workers=self.num_workers 43 | ) 44 | self._compare_result(data) 45 | -------------------------------------------------------------------------------- /netests/getters/routing_get.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.constants import VRF_DATA_KEY 5 | from netests.getters.vrf_get import GetterVRF 6 | from netests.getters.base_get import GetterBase 7 | 8 | 9 | class GetterRouting(GetterBase): 10 | 11 | def __init__( 12 | self, 13 | nr, 14 | options, 15 | from_cli, 16 | num_workers, 17 | verbose, 18 | print_task_output, 19 | filename, 20 | protocol, 21 | key_store, 22 | ): 23 | super().__init__( 24 | nr, 25 | options, 26 | from_cli, 27 | num_workers, 28 | verbose, 29 | print_task_output, 30 | filename, 31 | protocol, 32 | key_store, 33 | ) 34 | 35 | def run(self): 36 | self.get_vrf() 37 | self.devices.run( 38 | task=self.generic_get, 39 | on_failed=True, 40 | num_workers=self.num_workers 41 | ) 42 | self.print_result() 43 | 44 | def get_vrf(self): 45 | GetterVRF( 46 | nr=self.nr, 47 | options={}, 48 | from_cli=False, 49 | num_workers=self.num_workers, 50 | verbose=self.verbose, 51 | print_task_output=False, 52 | filename="vrf.yml", 53 | protocol="vrf", 54 | key_store=VRF_DATA_KEY, 55 | ).run() 56 | -------------------------------------------------------------------------------- /netests/protocols/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/netests/protocols/__init__.py -------------------------------------------------------------------------------- /netests/protocols/_protocols.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from typing import Dict, Optional 5 | from pydantic import BaseModel 6 | from abc import ABC, abstractmethod 7 | import pprint 8 | PP = pprint.PrettyPrinter(indent=4) 9 | 10 | 11 | class NetestsProtocol(ABC, BaseModel): 12 | options: Optional[Dict[str, Dict[str, bool]]] = {} 13 | 14 | @abstractmethod 15 | def to_json(self): 16 | pass 17 | 18 | def print_json(self): 19 | PP.pprint(self.to_json()) 20 | -------------------------------------------------------------------------------- /netests/protocols/ipv6.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import ipaddress 5 | from typing import List 6 | from ipaddress import IPv6Address 7 | from netests.constants import NOT_SET 8 | from netests.protocols.ip import IPAddress 9 | 10 | 11 | class IPV6(IPAddress): 12 | ip_address: ipaddress.IPv6Address = NOT_SET 13 | 14 | @classmethod 15 | def deserialize( 16 | cls, 17 | ip_address=NOT_SET, 18 | netmask=NOT_SET 19 | ) -> "IPV6": 20 | try: 21 | IPv6Address(ip_address) 22 | return { 23 | "ip_address": ip_address, 24 | "netmask": netmask 25 | } 26 | except Exception: 27 | return { 28 | "ip_address": IPv6Address(), 29 | "netmask": NOT_SET 30 | } 31 | 32 | 33 | class IPV6Interface(IPV6): 34 | ipv6_addresses: List[IPV6] 35 | 36 | def to_json(self): 37 | ret = list() 38 | if self.ipv6_addresses is not None: 39 | for i in self.ipv6_addresses: 40 | if i is not None: 41 | ret.append(i.to_json()) 42 | return ret 43 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/eos_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | ping vrf {{ ip_to_ping['vrf'] }} {{ ip_to_ping['ip_address'] }} repeat 1 ! 6 | {% else %} 7 | ping vrf {{ ip_to_ping['vrf'] }} {{ ip_to_ping['ip_address'] }} repeat 1 8 | {% endif %} 9 | {% else %} 10 | {% if ip_to_ping['works'] == false %} 11 | ping {{ ip_to_ping['ip_address'] }} repeat 1 ! 12 | {% else %} 13 | ping {{ ip_to_ping['ip_address'] }} repeat 1 14 | {% endif %} 15 | {% endif %} 16 | {% endif %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/extreme_vsp_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | ping {{ ip_to_ping['ip_address'] }} count 1 -t 1 vrf {% if ip_to_ping['vrf'] == "mgmt" %}MgmtRouter{% else %}{{ ip_to_ping['vrf'] }}{% endif %} ! 6 | {% else %} 7 | ping {{ ip_to_ping['ip_address'] }} count 1 -t 1 vrf {% if ip_to_ping['vrf'] == "mgmt" %}MgmtRouter{% else %}{{ ip_to_ping['vrf'] }}{% endif %} 8 | {% endif %} 9 | {% else %} 10 | {% if ip_to_ping['works'] == false %} 11 | ping {{ ip_to_ping['ip_address'] }} count 1 -t 1 ! 12 | {% else %} 13 | ping {{ ip_to_ping['ip_address'] }} count 1 -t 1 14 | {% endif %} 15 | {% endif %} 16 | {% endif %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/ios_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | ping vrf {{ ip_to_ping['vrf'] }} {{ ip_to_ping['ip_address'] }} repeat 1 timeout 2 ! 6 | {% else %} 7 | ping vrf {{ ip_to_ping['vrf'] }} {{ ip_to_ping['ip_address'] }} repeat 1 timeout 2 8 | {% endif %} 9 | {% else %} 10 | {% if ip_to_ping['works'] == false %} 11 | ping {{ ip_to_ping['ip_address'] }} repeat 1 timeout 2 ! 12 | {% else %} 13 | ping {{ ip_to_ping['ip_address'] }} repeat 1 timeout 2 14 | {% endif %} 15 | {% endif %} 16 | {% endif %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/iosxr_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 vrf {{ ip_to_ping['vrf'] }} ! 6 | {% else %} 7 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 vrf {{ ip_to_ping['vrf'] }} 8 | {% endif %} 9 | {% else %} 10 | {% if ip_to_ping['works'] == false %} 11 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 ! 12 | {% else %} 13 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 14 | {% endif %} 15 | {% endif %} 16 | {% endif %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/junos_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | ping routing-instance {% if ip_to_ping['vrf'] == "mgmt" %}mgmt_junos{% else %}{{ ip_to_ping['vrf'] }}{% endif %} {{ ip_to_ping['ip_address'] }} count 1 wait 1 ! 6 | {% else %} 7 | ping routing-instance {% if ip_to_ping['vrf'] == "mgmt" %}mgmt_junos{% else %}{{ ip_to_ping['vrf'] }}{% endif %} {{ ip_to_ping['ip_address'] }} count 1 wait 1 8 | {% endif %} 9 | {% else %} 10 | {% if ip_to_ping['works'] == false %} 11 | ping {{ ip_to_ping['ip_address'] }} count 1 wait 1 ! 12 | {% else %} 13 | ping {{ ip_to_ping['ip_address'] }} count 1 wait 1 14 | {% endif %} 15 | {% endif %} 16 | {% endif %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/linux_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | if ping -W 1 -c 1 {{ ip_to_ping['ip_address'] }} {% if ip_to_ping['vrf'] != "default" %}-I {{ ip_to_ping['vrf'] }} {% endif %} ; then exit 1 ; else ping 0 -c 1 ; fi 6 | {% else %} 7 | ping -W 1 -c 1 {{ ip_to_ping['ip_address'] }} {% if ip_to_ping['vrf'] != "default" %} -I {{ ip_to_ping['vrf'] }} {% endif %} 8 | 9 | {% endif %} 10 | {% else %} 11 | {% if ip_to_ping['works'] == false %} 12 | if ping -W 1 -c 1 {{ ip_to_ping['ip_address'] }} ; then exit 1 ; else ping 0 -c 1 ; fi 13 | {% else %} 14 | ping -W 1 -c 1 {{ ip_to_ping['ip_address'] }} 15 | {% endif %} 16 | {% endif %} 17 | {% endif %} 18 | {% endfor %} 19 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/nxos_ping.j2: -------------------------------------------------------------------------------- 1 | {% for ip_to_ping in host["ping_data"].ping_lst %} 2 | {% if ip_to_ping['ip_address'] is defined %} 3 | {% if ip_to_ping['vrf'] is defined and ip_to_ping['vrf'] != "default" %} 4 | {% if ip_to_ping['works'] == false %} 5 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 vrf {% if ip_to_ping['vrf'] == "mgmt" %}management{% else %}{{ ip_to_ping['vrf'] }}{% endif %} ! 6 | {% else %} 7 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 vrf {% if ip_to_ping['vrf'] == "mgmt" %}management{% else %}{{ ip_to_ping['vrf'] }}{% endif %} 8 | {% endif %} 9 | {% else %} 10 | {% if ip_to_ping['works'] == false %} 11 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 ! 12 | {% else %} 13 | ping {{ ip_to_ping['ip_address'] }} timeout 2 count 1 14 | {% endif %} 15 | {% endif %} 16 | {% endif %} 17 | {% endfor %} 18 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/leaf01_ping_cmd: -------------------------------------------------------------------------------- 1 | if ping -W 1 -c 1 8.8.8.8 ; then exit 1 ; else ping 0 -c 1 ; fi 2 | ping -W 1 -c 1 172.16.194.1 -I mgmt 3 | if ping -W 1 -c 1 3.3.3.3 -I management ; then exit 1 ; else ping 0 -c 1 ; fi 4 | if ping -W 1 -c 1 123.45.67.89 -I blablabla ; then exit 1 ; else ping 0 -c 1 ; fi 5 | if ping -W 1 -c 1 3.3.3.3 ; then exit 1 ; else ping 0 -c 1 ; fi 6 | if ping -W 1 -c 1 333.1.1.1 ; then exit 1 ; else ping 0 -c 1 ; fi 7 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/leaf02_ping_cmd: -------------------------------------------------------------------------------- 1 | ping 17.1.1.1 timeout 2 count 1 2 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/leaf03_ping_cmd: -------------------------------------------------------------------------------- 1 | ping 127.0.0.1 repeat 1 2 | ping 8.8.8.8 repeat 1 ! 3 | ping 172.16.194.111 repeat 1 ! 4 | ping vrf mgmt 172.16.194.1 repeat 1 ! 5 | ping vrf ewfjweijfoeirjfer 172.16.194.1 repeat 1 ! 6 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/leaf04_ping_cmd: -------------------------------------------------------------------------------- 1 | ping 100.123.1.0 count 1 wait 1 2 | ping 100.123.1.88 count 1 wait 1 ! 3 | ping routing-instance edkwedlwewjdnw 100.123.1.0 count 1 wait 1 ! 4 | ping 100.123.1.11110 count 1 wait 1 ! 5 | ping routing-instance TEST 9.9.99.88 count 1 wait 1 ! 6 | ping routing-instance NO_INTERFACE 1.1.1.1 count 1 wait 1 ! 7 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/leaf05_ping_cmd: -------------------------------------------------------------------------------- 1 | ping 10.10.20.48 repeat 1 timeout 2 2 | ping 1.1.1.1 repeat 1 timeout 2 ! 3 | ping vrf management 2.2.2.2 repeat 1 timeout 2 ! 4 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/spine01_ping_cmd: -------------------------------------------------------------------------------- 1 | if ping -c 1 8.8.8.8 ; then exit 1 ; else ping 0 -c 1 ; fi 2 | if ping -c 1 9.9.9.9 ; then exit 1 ; else ping 0 -c 1 ; fi 3 | ping -c 1 10.0.5.101 -I mgmt 4 | ping -c 1 10.1.3.2 5 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/spine02_ping_cmd: -------------------------------------------------------------------------------- 1 | ping 172.16.194.1 count 1 -t 1 vrf MgmtRouter 2 | ping 172.16.194.62 count 1 -t 1 vrf MgmtRouter 3 | ping 172.16.194.7 count 1 -t 1 vrf MgmtRouter ! 4 | ping 8.8.8.8 count 1 -t 1 ! 5 | ping 9.9.9.9 count 1 -t 1 ! 6 | -------------------------------------------------------------------------------- /netests/templates/jinja2/ping/result/spine03_ping_cmd: -------------------------------------------------------------------------------- 1 | ping 1.1.1.1 timeout 2 count 1 vrf diwehdowhweiuh ! 2 | ping 33.33.33.33 timeout 2 count 1 ! 3 | ping 1.1.1.20 timeout 2 count 1 4 | ping 1223.1.1.1 timeout 2 count 1 ! 5 | ping 222.2.2.2 timeout 2 count 1 vrf TEST ! 6 | -------------------------------------------------------------------------------- /netests/templates/jinja2/socket/result/leaf01_socket_cmd: -------------------------------------------------------------------------------- 1 | #jinja2: lstrip_blocks: True 2 | nc -w 1 -I default 192.168.254.1 443 3 | nc -w 1 -I default 192.168.254.12 80 4 | -------------------------------------------------------------------------------- /netests/templates/jinja2/socket/result/leaf03_socket_cmd: -------------------------------------------------------------------------------- 1 | bash nc -w 1 -i 2s 8.8.8.8 80 ! 2 | bash nc -w 1 -i 2s 10.1.3.1 22 3 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show ip_ospf_neighbor_detail.textfsm: -------------------------------------------------------------------------------- 1 | Value OSPF_INSTANCE (\d+|\w+) 2 | Value ROUTER_ID (\d+.\d+.\d+.\d+) 3 | 4 | Start 5 | ^\s+Routing Process\s+\"ospf\s+${OSPF_INSTANCE}\"\s+with\s+ID\s+${ROUTER_ID} -> Record 6 | 7 | end 8 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_cdp_neighbors_detail.textfsm: -------------------------------------------------------------------------------- 1 | Value Required DESTINATION_HOST (\S+) 2 | Value MANAGEMENT_IP (\d+\.\d+\.\d+\.\d+|\w+\.\w+\.\w+) 3 | Value PLATFORM (.*) 4 | Value REMOTE_PORT (.*) 5 | Value LOCAL_PORT (.*) 6 | Value SOFTWARE_VERSION (.*$) 7 | Value CAPABILITIES (\S+) 8 | 9 | Start 10 | ^Device ID: ${DESTINATION_HOST} 11 | ^Entry address\(es\)\s*:\s* -> ParseIP 12 | ^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES} 13 | ^Interface: ${LOCAL_PORT}, Port ID \(outgoing port\): ${REMOTE_PORT} 14 | ^Version : -> GetVersion 15 | # Capture time-stamp if vty line has command time-stamping turned on 16 | ^Load\s+for\s+ 17 | ^Time\s+source\s+is 18 | 19 | ParseIP 20 | ^.*IP address: ${MANAGEMENT_IP} -> Start 21 | ^Platform\s*:\s*${PLATFORM}\s*,\s*Capabilities\s*:\s*${CAPABILITIES} -> Start 22 | ^.* -> Start 23 | 24 | GetVersion 25 | ^${SOFTWARE_VERSION} -> Record Start -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_bgp_summary.textfsm: -------------------------------------------------------------------------------- 1 | Value Filldown,Required ROUTER_ID ([0-9a-f:\.]+) 2 | Value Filldown LOCAL_AS (\d+) 3 | Value BGP_NEIGH (\d+?\.\d+?\.\d+?\.\d+?) 4 | Value NEIGH_AS (\d+) 5 | Value UP_DOWN (\S+?) 6 | Value STATE_PFXRCD (\S+?\s+\S+?|\S+?) 7 | 8 | Start 9 | ^BGP\s+router\s+identifier\s+${ROUTER_ID},\s+local\s+AS\s+number\s+${LOCAL_AS}\s*$$ 10 | ^${BGP_NEIGH}\s+\S+\s+${NEIGH_AS}(\s+\d+?){5}\s+${UP_DOWN}\s+${STATE_PFXRCD}\s*$$ -> Record 11 | # Capture time-stamp if vty line has command time-stamping turned on 12 | ^Load\s+for\s+ 13 | ^Time\s+source\s+is 14 | 15 | EOF -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_int_brief.textfsm: -------------------------------------------------------------------------------- 1 | Value INTF (\S+) 2 | Value IPADDR (\S+) 3 | Value STATUS (up|down|administratively down) 4 | Value PROTO (up|down) 5 | 6 | Start 7 | ^${INTF}\s+${IPADDR}\s+\w+\s+\w+\s+${STATUS}\s+${PROTO} -> Record 8 | # Capture time-stamp if vty line has command time-stamping turned on 9 | ^Load\s+for\s+ 10 | ^Time\s+source\s+is -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_interface_brief.textfsm: -------------------------------------------------------------------------------- 1 | Value INTF (\S+) 2 | Value IPADDR (\S+) 3 | Value STATUS (up|down|administratively down) 4 | Value PROTO (up|down) 5 | 6 | Start 7 | ^${INTF}\s+${IPADDR}\s+\w+\s+\w+\s+${STATUS}\s+${PROTO} -> Record 8 | # Capture time-stamp if vty line has command time-stamping turned on 9 | ^Load\s+for\s+ 10 | ^Time\s+source\s+is -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_ospf.textfsm: -------------------------------------------------------------------------------- 1 | Value OSPF_INSTANCE (\d+|\w+) 2 | Value ROUTER_ID (\d+.\d+.\d+.\d+) 3 | Value VRF_NAME (\S+) 4 | 5 | Start 6 | ^\s+Routing Process\s+\"ospf\s+${OSPF_INSTANCE}\"\s+with\s+ID\s+${ROUTER_ID} 7 | ^\s+Connected\s+to\s+MPLS\s+VPN\s+Superbackbone,\s+VRF\s+${VRF_NAME} 8 | ^\s+Cisco NSF -> Record 9 | 10 | end 11 | 12 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_ospf_interface_brief.textfsm: -------------------------------------------------------------------------------- 1 | Value INTERFACE (\S+) 2 | Value PID (\d+) 3 | Value AREA (\d+\.\d+\.\d+\.\d+|\d+) 4 | Value IP_ADDRESS_MASK (\d+\.\d+\.\d+\.\d+/\d+) 5 | Value COST (\d+) 6 | Value STATE (\S+) 7 | Value NEIGHBORS_FC (\d+\/\d+) 8 | 9 | Start 10 | ^${INTERFACE}\s+${PID}\s+${AREA}\s+${IP_ADDRESS_MASK}\s+${COST}\s+${STATE}\s+${NEIGHBORS_FC} -> Record 11 | # Capture time-stamp if vty line has command time-stamping turned on 12 | ^Load\s+for\s+ 13 | ^Time\s+source\s+is -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_ospf_neighbor.textfsm: -------------------------------------------------------------------------------- 1 | Value NEIGHBOR_ID (\d+.\d+.\d+.\d+) 2 | Value PRIORITY (\d+) 3 | Value STATE (\S+\/\s+\-|\S+) 4 | Value DEAD_TIME (\d+:\d+:\d+) 5 | Value ADDRESS (\d+.\d+.\d+.\d+) 6 | Value INTERFACE (\S+) 7 | 8 | Start 9 | ^${NEIGHBOR_ID}\s+${PRIORITY}\s+${STATE}\s+${DEAD_TIME}\s+${ADDRESS}\s+${INTERFACE} -> Record 10 | # Capture time-stamp if vty line has command time-stamping turned on 11 | ^Load\s+for\s+ 12 | ^Time\s+source\s+is 13 | 14 | End -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_ospf_neighbor_detail.textfsm: -------------------------------------------------------------------------------- 1 | Value PEER_RID (\d+.\d+.\d+.\d+) 2 | Value LOCAL_INT_IP (\d+.\d+.\d+.\d+) 3 | Value AREA_ID (\d+.\d+.\d+.\d+|\d+) 4 | Value LOCAL_INT (\S+) 5 | Value STATE (\w+) 6 | Value DR_IP (\d+.\d+.\d+.\d+) 7 | Value BDR_IP (\d+.\d+.\d+.\d+) 8 | Value UP_TIME (\S+) 9 | 10 | 11 | Start 12 | ^\s+Neighbor\s+${PEER_RID},\s+interface\s+address\s+${LOCAL_INT_IP} 13 | ^\s+In\s+the\s+area\s+${AREA_ID}\s+via\s+interface\s+${LOCAL_INT} 14 | ^\s+Neighbor\s+priority\s+is\s+\d+,\s+State\s+is\s+${STATE},\s+\d+\s+state\s+changes 15 | ^\s+DR\s+is\s+${DR_IP}\s+BDR\s+is\s+${BDR_IP} 16 | ^\s+Neighbor\s+is\s+up\s+for\s+${UP_TIME} -> Record 17 | 18 | End -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_route_static.textfsm: -------------------------------------------------------------------------------- 1 | Value SUBNET (\d+.\d+.\d+.\d+) 2 | Value AD (\d+) 3 | Value METRIC (\d+) 4 | Value CIDR_MASK (\d+) 5 | Value NEXT_HOP (\S+) 6 | 7 | Start 8 | ^S\s+${SUBNET}\/${CIDR_MASK}\s+\[${AD}\/${METRIC}\]\s+via\s+${NEXT_HOP} -> Record 9 | ^S\s+${SUBNET}\/${CIDR_MASK}\s+is\s+directly\s+connected,\s+${NEXT_HOP} -> Record 10 | 11 | Done -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ip_vrf_detail.textfsm: -------------------------------------------------------------------------------- 1 | Value VRF_NAME ([a-zA-Z_\-0-9]+) 2 | Value VRF_ID (\d+) 3 | Value RD ((|[a-zA-Z_\:\-0-9]+)) 4 | Value VPN_ID ((|[a-zA-Z_\:\-0-9]+)) 5 | Value DESCR ((|[a-zA-Z_\:\-0-9]+)) 6 | Value RT_IMPORT ([a-zA-Z_\-0-9:]+) 7 | Value RT_EXPORT ([a-zA-Z_\-0-9:]+) 8 | 9 | Start 10 | ^VRF\s+${VRF_NAME}\s+\(VRF\s+Id\s+\=\s+${VRF_ID}\)\;\s+\w+\s+RD\s+${RD}\;\s+\w+\s+VPNID\s+${VPN_ID} 11 | ^\s+Description:\s+${DESCR} 12 | ^\s+Import\s+VPN\s+route-target\s+communities:RT:${RT_IMPORT} 13 | ^\s+Export\s+VPN\s+route-target\s+communities:RT:${RT_EXPORT} 14 | ^Address\s+family\s+ipv4\s+multicast -> Record 15 | 16 | Done 17 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_ipv6_interface_brief.textfsm: -------------------------------------------------------------------------------- 1 | Value INTF (\S+) 2 | Value List IPADDR (\S+) 3 | Value ADMIN (\S+|\S+\s\S+) 4 | Value PROTOCOL (\S+|\S+\s\S+) 5 | 6 | 7 | Start 8 | ^${INTF}\s+\[${ADMIN}/${PROTOCOL}\] -> Interfaces 9 | # Capture time-stamp if vty line has command time-stamping turned on 10 | ^Load\s+for\s+ 11 | ^Time\s+source\s+is 12 | 13 | Interfaces 14 | ^(\S+)\s+\[(\S+|\S+\s\S+)/(\S+|\S+\s\S+)\] -> Continue.Record 15 | ^${INTF}\s+\[${ADMIN}/${PROTOCOL}\] 16 | ^\s+${IPADDR} 17 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_ios_show_snmp.textfsm: -------------------------------------------------------------------------------- 1 | Value SNMP_SERVER (\d+.\d+.\d+.\d+) 2 | Value SNMP_SERVER_PORT (\d+) 3 | 4 | Start 5 | ^\s+Logging\s+to\s+${SNMP_SERVER}.${SNMP_SERVER_PORT} -> Record 6 | 7 | Done -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_bgp.textfsm: -------------------------------------------------------------------------------- 1 | Value Filldown ROUTER_ID (\S+) 2 | Value Filldown LOCAL_AS (\d+) 3 | 4 | Start 5 | ^BGP\s+router\s+identifier\s+${ROUTER_ID},\s+local\s+AS\s+number\s+${LOCAL_AS}\s*$$ 6 | 7 | End -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_bgp_neighbors.textfsm: -------------------------------------------------------------------------------- 1 | Value BGP_PEER (\d+\.\d+\.\d+\.\d+) 2 | Value VRF_NAME (\S+) 3 | Value REMOTE_AS (\S+) 4 | Value LOCAL_AS (\S+) 5 | Value STATE (\w+) 6 | 7 | 8 | Start 9 | ^BGP\s+neighbor\s+is\s+${BGP_PEER},\s+vrf\s+${VRF_NAME} 10 | ^\s+Remote\s+AS\s+${REMOTE_AS},\s+local\s+AS\s+${LOCAL_AS},\s+internal\s+link 11 | ^\s+BGP\s+[Ss]tate\s+=\s+${STATE} 12 | 13 | End -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_cdp_neighbors_detail.textfsm: -------------------------------------------------------------------------------- 1 | Value Required DEST_HOST (\S+) 2 | Value SYSNAME (.*) 3 | Value MGMT_IP (.*) 4 | Value PLATFORM (.*) 5 | Value REMOTE_PORT (.*) 6 | Value LOCAL_PORT (.*) 7 | Value VERSION (.*) 8 | Value CAPABILITIES (.*) 9 | 10 | Start 11 | ^Device ID: ${DEST_HOST} 12 | ^SysName : ${SYSNAME} 13 | ^Entry address\(es\): -> GetIP 14 | ^Platform: ${PLATFORM}, Capabilities: ${CAPABILITIES} 15 | ^Interface: ${LOCAL_PORT} 16 | ^Port ID \(outgoing port\): ${REMOTE_PORT} 17 | ^Version : -> GetVersion 18 | 19 | GetIP 20 | ^.*IP.+address: ${MGMT_IP} -> Start 21 | 22 | GetVersion 23 | ^${VERSION} -> Record Start -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_ip_interface_brief.textfsm: -------------------------------------------------------------------------------- 1 | Value INTF (.+?) 2 | Value IPADDR (\S+) 3 | Value STATUS (Up|Down|Shutdown) 4 | Value PROTO (Up|Down) 5 | Value VRF (\S+) 6 | 7 | Start 8 | ^${INTF}\s+${IPADDR}\s+${STATUS}\s+${PROTO}\s+${VRF} -> Record -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_lldp_neighbors.textfsm: -------------------------------------------------------------------------------- 1 | Value Required NEIGHBOR (\S+) 2 | Value Required LOCAL_INTERFACE (\S+) 3 | Value Required NEIGHBOR_INTERFACE (\S+) 4 | Value CAPABILITIES (\S+) 5 | 6 | Start 7 | ^Device.*ID -> LLDP 8 | 9 | LLDP 10 | ^${NEIGHBOR}\s+${LOCAL_INTERFACE}\s+\d+\s+${CAPABILITIES}\s+${NEIGHBOR_INTERFACE}$$ -> Record 11 | ^${NEIGHBOR} 12 | ^\s+${LOCAL_INTERFACE}\s+\d+\s+(.*?)\s+${NEIGHBOR_INTERFACE} -> Record 13 | ^Total entries 14 | ^\s+$$ 15 | ^$$ 16 | ^.* -> Error "LINE NOT FOUND" -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_version.textfsm: -------------------------------------------------------------------------------- 1 | Value VERSION (\S[^\[]+) 2 | Value UPTIME (.+?) 3 | Value LOCATION (\S+) 4 | Value HARDWARE (.+) 5 | Value BUILD_HOST (\S+) 6 | 7 | Start 8 | ^Cisco.+Software.+Version\s+${VERSION} 9 | ^Build\s+Information: -> Build_Info 10 | ^.+uptime\s+is\s+${UPTIME}\s*$$ 11 | ^(?:\s*[Cc]isco\s+)?${HARDWARE}\s\(.*\) processor 12 | ^\S{3}\s+\S{3}\s+\d{1,2}\s+\d+:\d+:\d+ 13 | ^Copyright 14 | ^ROM: 15 | ^[Ss]ystem\s+[Ii]mage 16 | ^\d+\s+processor 17 | ^\d+\s+.*(?:[Ee]th|[Gg]ig[Ee]|[Ss][Oo][Nn][Ee][Tt]|[Ww][Aa][Nn][Pp][Hh][Yy]) 18 | ^\d+\w\s+bytes 19 | ^Boot\s+device 20 | ^Package\s+active 21 | ^hfr-doc -> CRS 22 | ^\s*$$ 23 | ^. -> Error 24 | 25 | # A VARIATION OF THE OUTPUT, EX. NCS PLATFORM 26 | Build_Info 27 | ^\s+Built\sBy.+ 28 | ^\s+Built\sOn.+ 29 | ^\s+Buil[dt]\sHost\s+:\s+${BUILD_HOST} 30 | ^\s+Workspace\s+:\s\S+ 31 | ^\s+Version\s+: 32 | ^\s+Location\s+:\s${LOCATION} 33 | ^\s*$$ -> Start 34 | ^.* -> Error 35 | 36 | CRS 37 | ^. -------------------------------------------------------------------------------- /netests/templates/textfsm/cisco_xr_show_vrf_all_detail.textfsm: -------------------------------------------------------------------------------- 1 | Value VRF_NAME ([a-zA-Z_\-0-9]+) 2 | Value RD ((not set|[a-zA-Z_\:\-0-9]+)) 3 | Value VPN_ID ((not set|[a-zA-Z_\:\-0-9]+)) 4 | Value VRF_MODE ([a-zA-Z_\-0-9]+) 5 | Value DESCR ((not set|[a-zA-Z_\:\-0-9]+)) 6 | Value RT_IMPORT ([a-zA-Z_\-0-9:]+) 7 | Value RT_EXPORT ([a-zA-Z_\-0-9:]+) 8 | 9 | Start 10 | ^VRF\s+${VRF_NAME};\s+RD\s+${RD};\s+VPN\s+ID\s+${VPN_ID} 11 | ^VRF\s+mode:\s+${VRF_MODE} 12 | ^Description\s+${DESCR} 13 | ^\s+Import\s+VPN\s+route-target\s+communities:RT:${RT_IMPORT} 14 | ^\s+Export\s+VPN\s+route-target\s+communities:RT:${RT_EXPORT} 15 | ^Address\s+family\s+IPV6\s+Unicast -> Record 16 | 17 | Done 18 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cumulus_net_show_bgp_vrf.textfsm: -------------------------------------------------------------------------------- 1 | Value VRF_NAME (\S+) 2 | Value VRF_ID (\d+) 3 | 4 | Start 5 | ^(\w+|\s\w+)\s+${VRF_ID}\s+\d+.\d+.\d+.\d+\s+\d+\s+\d+\s+${VRF_NAME} -> Record 6 | 7 | Done 8 | -------------------------------------------------------------------------------- /netests/templates/textfsm/cumulus_net_show_vrf.textfsm: -------------------------------------------------------------------------------- 1 | Value Required VRF_NAME (\S+) 2 | Value Required VRF_ID (\d+) 3 | 4 | Start 5 | ^VRF: ${VRF_NAME} 6 | ^[-]+ 7 | ^${VRF_NAME}\s+${VRF_ID} -> Record 8 | 9 | End -------------------------------------------------------------------------------- /netests/templates/textfsm/cumulus_net_show_vrf_list.textfsm: -------------------------------------------------------------------------------- 1 | Value Filldown,Required VRF_NAME (\S+) 2 | Value List VLANS_ID (\S+) 3 | 4 | Start 5 | ^VRF: ${VRF_NAME} 6 | ^[-]+ 7 | ^${VLANS_ID}@ -> Record 8 | ^[\n\r] -> Record 9 | 10 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_interfaces_gigabitethernet.textfsm: -------------------------------------------------------------------------------- 1 | Value PORT (\d+|\d+/\d+|mgmt) 2 | Value INDEX (\d+) 3 | Value DESCRIPTION (\w+) 4 | Value LINK_TRAP (true|false) 5 | Value PORT_LOCK (true|false) 6 | Value MTU (\d+) 7 | Value MAC_ADDR (([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})) 8 | Value ADMIN_STATUS (up|down) 9 | Value OPERATE (up|down) 10 | 11 | Start 12 | ^=+ 13 | ^\s+Port Interface\s 14 | ^=+ 15 | ^PORT\s+LINK\s+PORT\s+PHYSICAL\s+STATUS\s+ 16 | ^NUM\s+INDEX\s+DESCRIPTION\s+TRAP\s+LOCK\s+MTU\s+ADDRESS\s+ADMIN\s+OPERATE\s+ 17 | ^-+ 18 | ^${PORT}\s+${INDEX}\s+${DESCRIPTION}\s+${LINK_TRAP}\s+\s+${PORT_LOCK}\s+${MTU}\s+${MAC_ADDR}\s+${ADMIN_STATUS}\s+${OPERATE} -> Record 19 | ^=+ 20 | 21 | Done 22 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_bgp_summary.textfsm: -------------------------------------------------------------------------------- 1 | Value Filldown,Required BGP_VERSION (\d+) 2 | Value Filldown,Required LOCAL_AS (\d+|\d+.\d+.\d+.\d+) 3 | Value Filldown,Required ROUTER_ID (\d+.\d+.\d+.\d+) 4 | Value PEER_IP (\d+.\d+.\d+.\d+) 5 | Value REMOTE_AS (\d+|\d+.\d+.\d+.\d+) 6 | Value PEER_STATE (\w+) 7 | Value HOLDDOWN (\d+) 8 | Value KEEPALIVE (\d+) 9 | Value HLDCFG (\d+) 10 | Value KPCFG (\d+) 11 | Value WGHT (\d+) 12 | Value CONRTY (\d+) 13 | Value ADVINT (\d+) 14 | Value DAYS_UP (\d+) 15 | Value HOUR_UP (\d+) 16 | Value MIN_UP (\d+) 17 | Value SEC_UP (\d+) 18 | 19 | Start 20 | ^=+ 21 | ^\s+BGP\s+Summary 22 | ^=+ 23 | ^\s+BGP\s+version\s+-\s+${BGP_VERSION} 24 | ^\s+local-as\s+-\s+${LOCAL_AS} 25 | ^\s+Identifier\s+-\s+${ROUTER_ID} 26 | ^${PEER_IP}\s+${REMOTE_AS}\s+${PEER_STATE}\s+${HOLDDOWN}\s+${KEEPALIVE}\s+${HLDCFG}\s+${KPCFG}\s+${WGHT}\s+${CONRTY}\s+${ADVINT}\s+${DAYS_UP}\s+day\(s\),\s+${HOUR_UP}:${MIN_UP}:${SEC_UP} -> Record 27 | 28 | Done -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_interface.textfsm: -------------------------------------------------------------------------------- 1 | Value INTERFACE (^\w+\d+/\d|^\w+) 2 | Value IP_ADDRESS (\d+.\d+.\d+.\d+) 3 | Value NETMAKS (\d+.\d+.\d+.\d+) 4 | Value BCASTADDR (\w+) 5 | Value MTU (\d+) 6 | Value VLAN_ID (\d+|--) 7 | Value BROUTER (true|false) 8 | Value IPSEC (disable|enable) 9 | 10 | Start 11 | ^=+ 12 | ^[\s]+IP Interface - GlobalRouter 13 | ^=+ 14 | ^INTERFACE+[\s]+IP 15 | ^[\s]+ADDRESS 16 | ^-+ 17 | ^${INTERFACE}\s+${IP_ADDRESS}\s+${NETMAKS}\s+${BCASTADDR}\s+${MTU}\s+${VLAN_ID}\s+${BROUTER}\s+${IPSEC} -> Record 18 | ^All 19 | ^-+ 20 | 21 | Done 22 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_ospf.textfsm: -------------------------------------------------------------------------------- 1 | Value ROUTER_ID (\d+.\d+.\d+.\d+) 2 | Value OSPF_ENABLE (\w+) 3 | Value VERSION (\d+) 4 | Value MET_ETHERNET (\d+) 5 | Value MET_FASTETHERNET (\d+) 6 | Value MET_GIGETHERNET (\d+) 7 | Value MET_TENGIGETHERNET (\d+) 8 | Value MET_FORTYGIGETHERNET (\d+) 9 | Value MET_VLAN (\d+) 10 | 11 | Start 12 | ^=+ 13 | ^\s+OSPF General 14 | ^=+ 15 | ^\s+RouterId:\s+${ROUTER_ID} 16 | ^\s+AdminStat:\s+${OSPF_ENABLE} 17 | ^\s+VersionNumber:\s+${VERSION} 18 | ^\s+ethernet\s+-\s+${MET_ETHERNET} 19 | ^\s+fast-ethernet\s+-\s+${MET_FASTETHERNET} 20 | ^\s+gig-ethernet\s+-\s+${MET_GIGETHERNET} 21 | ^\s+ten-gig-ethernet\s+-\s+${MET_TENGIGETHERNET} 22 | ^\s+forty-gig-ethernet\s+-\s+${MET_FORTYGIGETHERNET} 23 | ^\s+vlan\s+-\s+${MET_VLAN} 24 | 25 | Done 26 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_ospf_interface.textfsm: -------------------------------------------------------------------------------- 1 | Value INTERFACE (\d+.\d+.\d+.\d+) 2 | Value AREA_ID (\d+.\d+.\d+.\d+|d+) 3 | Value ADM (en|dis) 4 | Value IFST (DR|BDR|DR_O|Down) 5 | Value METRIC (\d+) 6 | Value PRIORITY (\d+) 7 | Value DR (\d+.\d+.\d+.\d+) 8 | Value BDR (\d+.\d+.\d+.\d+) 9 | Value TYPE (\w+) 10 | Value AUTH_TYPE (\w+) 11 | Value MTU_IGNORE (en|dis) 12 | 13 | Start 14 | ^${INTERFACE}\s+${AREA_ID}\s+${ADM}\s+${IFST}\s+${METRIC}\s+${PRIORITY}\s+${DR}\s+${TYPE}\s+${AUTH_TYPE}\s+${MTU_IGNORE} 15 | ^\s+${BDR} -> Record 16 | 17 | Done 18 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_ospf_neighbor.textfsm: -------------------------------------------------------------------------------- 1 | Value INTERFACE (\d+.\d+.\d+.\d+) 2 | Value NEIGHBOR_RID (\d+.\d+.\d+.\d+) 3 | Value NEIGHBOR_IP (\d+.\d+.\d+.\d+) 4 | Value PRIORITY (\d+) 5 | Value STATE (\w+) 6 | Value RTXQLEN (\d+) 7 | Value PERM (\w+) 8 | Value TTL (\d+) 9 | 10 | Start 11 | ^=+ 12 | ^\s+OSPF Neighbors 13 | ^=+ 14 | ^INTERFACE\s+NBRROUTERID\s+NBRIPADDR\s+PRIO\s+STATE\s+RTXQLEN\s+PERM\s+TTL 15 | ^-+ 16 | ^${INTERFACE}\s+${NEIGHBOR_RID}\s+${NEIGHBOR_IP}\s+${PRIORITY}\s+${STATE}\s+${RTXQLEN}\s+${PERM}\s+${TTL} -> Record 17 | ^Total ospf neighbors: 18 | 19 | Done 20 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_route_static.textfsm: -------------------------------------------------------------------------------- 1 | Value PREFIX (\d+.\d+.\d+.\d+) 2 | Value NETMASK (\d+.\d+.\d+.\d+) 3 | Value NEXTHOP (\d+.\d+.\d+.\d+) 4 | Value NEXTHOP_VRF (\S+) 5 | Value COST (\d+) 6 | Value PREF (\d+) 7 | Value LCLNHOP (TRUE|FALSE) 8 | Value STATUS (ACTIVE|INACTV) 9 | Value ENABLE (TRUE|FALSE) 10 | 11 | Start 12 | ^=+ 13 | ^\s+IP Static Route - GlobalRouter 14 | ^=+ 15 | ^DEST\s+MASK\s+NEXT\s+NH-VRF\s+COST\s+PREF\s+LCLNHOP\s+STATUS\s+ENABLE 16 | ^-+ 17 | ^${PREFIX}\s+${NETMASK}\s+${NEXTHOP}\s+${NEXTHOP_VRF}\s+${COST}\s+${PREF}\s+${LCLNHOP}\s+${STATUS}\s+${ENABLE} -> Record 18 | 19 | Done -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_ip_vrf.textfsm: -------------------------------------------------------------------------------- 1 | Value VRF_NAME (([a-zA-Z0-9_.,/-]*)) 2 | Value VRF_ID (\d+) 3 | Value VLAN_COUNT (\d+) 4 | Value ARP_COUNT (\d+) 5 | Value OSPF (TRUE|FALSE) 6 | Value RIP (TRUE|FALSE) 7 | Value BGP (TRUE|FALSE) 8 | Value PIM (TRUE|FALSE) 9 | Value NBRV6_COUNT (\d+) 10 | Value OSPFV3 (TRUE|FALSE) 11 | Value PIM6 (TRUE|FALSE) 12 | 13 | Start 14 | ^${VRF_NAME}\s+${VRF_ID}\s+${VLAN_COUNT}\s+${ARP_COUNT}\s+${RIP}\s+${OSPF}\s+${BGP}\s+${PIM}\s+${NBRV6_COUNT}\s+${OSPFV3}\s+${PIM6} -> Record 15 | 16 | Done 17 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_lldp_neighbor.textfsm: -------------------------------------------------------------------------------- 1 | Value LOCAL_PORT (\d+\/\d+|\w+) 2 | Value MAC_ADDR (([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})) 3 | Value NEIGHBOR_PORT ([^\r\n]+) 4 | Value NEIGHBOR_NAME (\S+) 5 | Value NEIGHBOR_TYPE (\w+) 6 | Value NEIGHBOR_DESCR ([^\r\n]+) 7 | Value NEIGHBOR_OS ([^\r\n]+) 8 | Value NEIGHBOR_MGMT_IP (\d+.\d+.\d+.\d+) 9 | 10 | Start 11 | ^Port:\s+${LOCAL_PORT}\s+Index 12 | ^\s+ChassisId:\s+MAC Address\s+${MAC_ADDR} 13 | ^\s+PortId\s+:\s+IfName\s+${NEIGHBOR_PORT} 14 | ^\s+SysName\s+:\s+${NEIGHBOR_NAME} 15 | ^\s+SysCap\s+:\s+${NEIGHBOR_TYPE} 16 | ^\s+PortDescr:\s+${NEIGHBOR_PORT} 17 | ^\s+SysDescr\s+:\s+${NEIGHBOR_OS} 18 | ^\s+Address\s+:\s+${NEIGHBOR_MGMT_IP} -> Record 19 | 20 | Done 21 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_snmp_server_host.textfsm: -------------------------------------------------------------------------------- 1 | Value SNMP_HOST (\d+.\d+.\d+.\d+) 2 | 3 | Start 4 | ^\w+\s+ipv[46]\s+${SNMP_HOST}: -> Record 5 | 6 | Done -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_sys_dns.textfsm: -------------------------------------------------------------------------------- 1 | Value DOMAIN ([^ \r\n]+) 2 | 3 | Start 4 | ^\s+DNS Default Domain Name :\s+${DOMAIN} 5 | 6 | Done 7 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extreme_vsp_show_tech.textfsm: -------------------------------------------------------------------------------- 1 | Value VERSION ([^ ()]+) 2 | Value HOSTNAME (\S+) 3 | Value MODEL (\w+) 4 | Value VENDOR (\w+\s+\w+) 5 | Value SERIAL (\w+) 6 | Value BASE_MAC (\w+:\w+:\w+:\w+:\w+:\w+) 7 | 8 | Start 9 | ^\s+SysDescr\s+:\s+\S+\s+\(${VERSION}\) 10 | ^\s+SysName\s+:\s+${HOSTNAME} 11 | ^\s+Chassis\s+:\s+${MODEL} 12 | ^\s+BrandName\s+:\s+${VENDOR} 13 | ^\s+Serial#\s+:\s+${SERIAL} 14 | ^\s+BaseMacAddr\s+:\s+${BASE_MAC} 15 | 16 | Done 17 | -------------------------------------------------------------------------------- /netests/templates/textfsm/extrme_vsp_show_int_gi_name.textfsm: -------------------------------------------------------------------------------- 1 | Value PORT_NUMBER (\d+\/\d+) 2 | 3 | Start 4 | ^${PORT_NUMBER} -> Record 5 | 6 | Done -------------------------------------------------------------------------------- /netests/tools/cli.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import textfsm 5 | from netests.constants import TEXTFSM_PATH 6 | 7 | 8 | def parse_textfsm(content, template_file) -> list: 9 | template = open( 10 | f"{TEXTFSM_PATH}{template_file}") 11 | results_template = textfsm.TextFSM(template) 12 | return results_template.ParseText(content) 13 | -------------------------------------------------------------------------------- /netests/tools/nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | import lxml 6 | import xmltodict 7 | from xml.etree import ElementTree 8 | 9 | 10 | def format_xml_output(output) -> dict: 11 | if output is None: 12 | return {} 13 | elif isinstance(output, dict): 14 | return output 15 | elif isinstance(output, lxml.etree._Element): 16 | output = json.dumps( 17 | xmltodict.parse( 18 | ElementTree.tostring(output) 19 | ) 20 | ) 21 | elif isinstance(output, str): 22 | output = json.dumps(xmltodict.parse(output)) 23 | 24 | elif isinstance(output, bytes): 25 | output = json.dumps(xmltodict.parse(str(output, 'utf-8'))) 26 | 27 | return json.loads(output) 28 | 29 | 30 | def bytes_to_json(output) -> dict: 31 | print(type(output)) 32 | if isinstance(output, bytes): 33 | print(type(output)) 34 | print(type(json.loads(output))) 35 | return json.loads(output) 36 | -------------------------------------------------------------------------------- /netests/workers/cumulus_nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.workers.device_nc import DeviceNC 5 | from netests.exceptions.netests_exceptions import NetestsFunctionNotPossible 6 | 7 | 8 | class CumulusNC(DeviceNC): 9 | 10 | def __init__( 11 | self, 12 | task, 13 | commands, 14 | vrf_loop, 15 | converter, 16 | key_store, 17 | options={}, 18 | ): 19 | raise NetestsFunctionNotPossible( 20 | "Cumulus - Netconf - Not Possible" 21 | ) 22 | -------------------------------------------------------------------------------- /netests/workers/device_api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | from abc import ABC, abstractmethod 6 | from netests.workers.device import Device 7 | from netests.exceptions.netests_exceptions import NetestsHTTPStatusCodeError 8 | 9 | 10 | class DeviceAPI(Device, ABC): 11 | 12 | def __init__( 13 | self, 14 | task, 15 | commands, 16 | vrf_loop, 17 | converter, 18 | key_store, 19 | options={} 20 | ): 21 | super().__init__( 22 | task, 23 | commands, 24 | vrf_loop, 25 | converter, 26 | key_store, 27 | options 28 | ) 29 | 30 | @abstractmethod 31 | def exec_call(self, task, command, vrf): 32 | pass 33 | 34 | def check_status_code(self, status_code): 35 | if status_code != 200: 36 | raise NetestsHTTPStatusCodeError() 37 | 38 | def payload_to_json(self, payload): 39 | return json.dumps(payload) 40 | 41 | def use_https(self, secure_api): 42 | return "https" if secure_api else "http" 43 | -------------------------------------------------------------------------------- /netests/workers/extreme_vsp_nc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.workers.device_nc import DeviceNC 5 | from netests.exceptions.netests_exceptions import NetestsFunctionNotPossible 6 | 7 | 8 | class ExtremeVSPNC(DeviceNC): 9 | 10 | def __init__( 11 | self, 12 | task, 13 | commands, 14 | vrf_loop, 15 | converter, 16 | key_store, 17 | options={}, 18 | ): 19 | raise NetestsFunctionNotPossible( 20 | "Extreme_VSP - Netconf - Not Possible" 21 | ) 22 | -------------------------------------------------------------------------------- /netests/workers/iosxr_api.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from netests.workers.device_api import DeviceAPI 5 | from netests.exceptions.netests_exceptions import NetestsFunctionNotPossible 6 | 7 | 8 | class IosxrAPI(DeviceAPI): 9 | 10 | def __init__( 11 | self, 12 | task, 13 | commands, 14 | vrf_loop, 15 | converter, 16 | key_store, 17 | options={}, 18 | ): 19 | raise NetestsFunctionNotPossible( 20 | "Cisco IOS-XR - API - Not Possible" 21 | ) 22 | -------------------------------------------------------------------------------- /pylama.ini: -------------------------------------------------------------------------------- 1 | [pylama] 2 | format = pylint 3 | linters = pep8,pyflakes,mccabe,pycodestyle 4 | ignore = C901,E131 -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "netests" 3 | version = "0.3.0" 4 | description = "Test your Network" 5 | authors = ["Dylan Hamel "] 6 | maintainers = ["Netests Team "] 7 | repository = "https://gitlab.com/DylanHamel/netests" 8 | license = "MIT" 9 | readme = "README.md" 10 | keywords = ["Netests", "Testing", "Network", "Automation"] 11 | 12 | [tool.poetry.dependencies] 13 | netmiko = "^2.4.2" 14 | python = "^3.6" 15 | nornir = "^2.4.0" 16 | click = "^7.1.2" 17 | pylint = "^2.5.2" 18 | ipaddress = "^1.0.23" 19 | termcolor = "^1.1.0" 20 | xmltodict = "^0.12.0" 21 | typing = "^3.7.4" 22 | pydantic = "^1.5.1" 23 | 24 | [tool.poetry.dev-dependencies] 25 | behave = "^1.2.6" 26 | pylama = "^7.7.1" 27 | mkdocs = "^1.1.2" 28 | 29 | [tool.poetry.scripts] 30 | netests = 'netests.welcome:main' 31 | 32 | [build-system] 33 | requires = ["poetry>=0.12"] 34 | build-backend = "poetry.masonry.api" 35 | -------------------------------------------------------------------------------- /tests/features/environment.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | def after_step(context, step): 6 | if 'own_skipped' in context.scenario.tags: 7 | context.test_not_implemented.append(step.name) 8 | context.scenario.tags.remove('own_skipped') 9 | -------------------------------------------------------------------------------- /tests/features/ipv4_6_class_tests.feature: -------------------------------------------------------------------------------- 1 | Feature: Test protocols IPAddress, IPV4 and IPV6 2 | # Description 3 | Scenario: 4 | Given I create a IPAddress object named o0000 5 | And I create a IPV4 object named o0001 6 | And I create a wrong IPV4 object named o0002 7 | And I create a IPV4Interface named o0003 8 | And I create a wrong IPV4Interface named o0004 9 | And I create a IPAddress object named o0010 10 | And I create a IPV6 object named o0011 11 | And I create a wrong IPV6 object named o0012 12 | Then I can print IPAddress object o0000 13 | And I can print IPAddress object o0000 in JSON format 14 | And I can print IPV4 object o0001 15 | And I can print IPV4 object o0001 in JSON format 16 | And I can print IPV4 object o0003 in JSON format 17 | And I can print IPV6 object o0011 18 | And I can print IPV6 object o0011 in JSON format 19 | And IPAddress object o0000 is equal to IPV4 object o0001 -------------------------------------------------------------------------------- /tests/features/src/ipv6_tests.yml: -------------------------------------------------------------------------------- 1 | leaf01: 2 | - interface_name: swp1 3 | ipv6_address: 2001:a:b:c::1001/64 4 | - interface_name: vlan1000-v1 5 | ipv6_address: 2001:1000:1000:1000::ffff/64 6 | - interface_name: vlan1000 7 | ipv6_address: 2001:1000:1000:1000::1/64 8 | 9 | # ---------------------------------------------------------------------------------------------------------------------- 10 | leaf03: 11 | - interface_name: Ethernet1 12 | ipv6_address: 2001:cafe:c0ca:103::2/64 13 | - interface_name: Ethernet2 14 | ipv6_address: 2001:cafe:c0ca:203::2/64 -------------------------------------------------------------------------------- /tests/features/src/mlag_tests.yml: -------------------------------------------------------------------------------- 1 | leaf01: 2 | sys_mac: "44:38:39:ff:01:02" 3 | local_id: "50:00:00:03:00:06" 4 | peer_id: "50:00:00:04:00:06" 5 | peer_int: peerlink.4094 6 | peer_ip: 169.254.1.2 7 | peer_alive: True 8 | peer_role: secondary 9 | local_role: primary 10 | peer_priority: 32768 11 | local_priority: 100 12 | vxlan_anycast_ip: 10.100.100.12 13 | -------------------------------------------------------------------------------- /tests/features/src/mtu_tests.yml: -------------------------------------------------------------------------------- 1 | spine01: 2 | global_mtu: 1500 3 | interfaces: 4 | Gi0/0: 2000 5 | Gi0/1: 2200 6 | Gi0/2: 2400 7 | Gi0/3: 2600 -------------------------------------------------------------------------------- /tests/features/src/mtu_tests_validate.yml: -------------------------------------------------------------------------------- 1 | leaf05: 2 | global_mtu: 1500 3 | interfaces: 4 | lo0: 1514 -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/arista/ssh/arista_show_ip_bgp_summary_default.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": {} 3 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/arista/ssh/arista_show_ip_bgp_summary_one_peer.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": { 3 | "CUSTOMER_WEJOB": { 4 | "routerId": "1.2.3.4", 5 | "peers": { 6 | "100.100.100.100": { 7 | "prefixInBest": 0, 8 | "msgSent": 0, 9 | "inMsgQueue": 0, 10 | "underMaintenance": false, 11 | "peerStateIdleReason": "NoInterface", 12 | "prefixReceived": 0, 13 | "upDownTime": 1588518931.254333, 14 | "version": 4, 15 | "msgReceived": 0, 16 | "prefixAccepted": 0, 17 | "peerState": "Idle", 18 | "outMsgQueue": 0, 19 | "prefixInBestEcmp": 0, 20 | "asn": "100" 21 | } 22 | }, 23 | "vrf": "CUSTOMER_WEJOB", 24 | "asn": "1111" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/cumulus/api/cumulus_api_get_vrf_default.json: -------------------------------------------------------------------------------- 1 | { 2 | "ipv4 unicast": { 3 | "as": 65101, 4 | "bestPath": { 5 | "multiPathRelax": "false" 6 | }, 7 | "dynamicPeers": 0, 8 | "peerCount": 1, 9 | "peerMemory": 19736, 10 | "peers": { 11 | "10.1.1.2": { 12 | "idType": "ipv4", 13 | "inq": 0, 14 | "msgRcvd": 0, 15 | "msgSent": 0, 16 | "outq": 0, 17 | "peerUptime": "never", 18 | "peerUptimeMsec": 0, 19 | "prefixReceivedCount": 0, 20 | "remoteAs": 65102, 21 | "state": "Connect", 22 | "tableVersion": 0, 23 | "version": 4 24 | } 25 | }, 26 | "ribCount": 0, 27 | "ribMemory": 0, 28 | "routerId": "1.1.1.1", 29 | "tableVersion": 0, 30 | "totalPeers": 1, 31 | "vrfId": 0, 32 | "vrfName": "default" 33 | }, 34 | "ipv6 unicast": {}, 35 | "l2vpn evpn": {} 36 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/ios/ssh/ios_ssh_get_bgp.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/tests/features/src/outputs/bgp/ios/ssh/ios_ssh_get_bgp.txt -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/ios/ssh/ios_ssh_get_bgp_vrf.txt: -------------------------------------------------------------------------------- 1 | For address family: IPv4 Unicast 2 | 3 | 4 | For address family: VPNv4 Unicast 5 | BGP router identifier 33.33.33.33, local AS number 33333 6 | BGP table version is 1, main routing table version 1 7 | 8 | Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 9 | 33.3.3.3 4 3 0 0 1 0 0 never Idle 10 | 33.33.33.33 4 3 0 0 1 0 0 never Idle 11 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/ios/ssh/ios_ssh_get_bgp_vrf_2.txt: -------------------------------------------------------------------------------- 1 | For address family: IPv4 Unicast 2 | 3 | 4 | For address family: VPNv4 Unicast 5 | BGP router identifier 33.33.33.33, local AS number 33333 6 | BGP table version is 1, main routing table version 1 7 | 8 | Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 9 | 15.15.15.15 4 15 0 0 1 0 0 never Idle 10 | 11 | For address family: IPv4 Flowspec -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/iosxr/netconf/iosxr_nc_get_bgp_no_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/iosxr/ssh/iosxr_cli_get_bgp_peers.txt: -------------------------------------------------------------------------------- 1 | 2 | Sat May 2 19:06:55.647 UTC -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/iosxr/ssh/iosxr_cli_get_bgp_rid.txt: -------------------------------------------------------------------------------- 1 | Sat May 2 19:06:56.481 UTC 2 | BGP router identifier 1.1.1.1, local AS number 1515 3 | BGP generic scan interval 60 secs 4 | Non-stop routing is enabled 5 | BGP table state: Active 6 | Table ID: 0xe0000000 RD version: 2 7 | BGP main routing table version 2 8 | BGP NSR Initial initsync version 2 (Reached) 9 | BGP NSR/ISSU Sync-Group versions 0/0 10 | BGP scan interval 60 secs 11 | 12 | BGP is operating in STANDALONE mode. 13 | 14 | 15 | Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer 16 | Speaker 2 2 2 2 2 0 -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/iosxr/ssh/iosxr_cli_get_bgp_rid_vrf.txt: -------------------------------------------------------------------------------- 1 | Sat May 2 19:06:56.481 UTC 2 | BGP router identifier 2.2.2.2, local AS number 1515 3 | BGP generic scan interval 60 secs 4 | Non-stop routing is enabled 5 | BGP table state: Active 6 | Table ID: 0xe0000000 RD version: 2 7 | BGP main routing table version 2 8 | BGP NSR Initial initsync version 2 (Reached) 9 | BGP NSR/ISSU Sync-Group versions 0/0 10 | BGP scan interval 60 secs 11 | 12 | BGP is operating in STANDALONE mode. 13 | 14 | 15 | Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer 16 | Speaker 2 2 2 2 2 0 -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/api/juniper_api_get_bgp_peers.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/api/juniper_api_get_bgp_rid.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | master 5 | 100.123.1.0 6 | forwarding 7 | Active 8 | 9 | inet.0 10 | 3 11 | 3 12 | 0 13 | 0 14 | 15 | 16 | inet6.0 17 | 1 18 | 1 19 | 0 20 | 0 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/api/juniper_api_get_bgp_rid_vrf.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | CUSTOMER_AWS 5 | 9.9.9.9 6 | non-forwarding 7 | Active 8 | 9 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/netconf/juniper_nc_get_bgp_peers.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/netconf/juniper_nc_get_bgp_rid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | master 4 | 100.123.1.0 5 | forwarding 6 | Active 7 | 8 | inet.0 9 | 3 10 | 3 11 | 0 12 | 0 13 | 14 | 15 | inet6.0 16 | 1 17 | 1 18 | 0 19 | 0 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/netconf/juniper_nc_get_bgp_rid_vrf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CUSTOMER_AWS 4 | 9.9.9.9 5 | non-forwarding 6 | Active 7 | 8 | -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/ssh/juniper_cli_get_bgp_peers.json: -------------------------------------------------------------------------------- 1 | { 2 | "bgp-information": [ 3 | { 4 | "attributes": { 5 | "xmlns": "http://xml.juniper.net/junos/19.4R0/junos-routing" 6 | } 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/juniper/ssh/juniper_cli_get_bgp_rid_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "instance-information": [ 3 | { 4 | "attributes": { 5 | "xmlns": "http://xml.juniper.net/junos/19.4R0/junos-routing", 6 | "junos:style": "detail" 7 | }, 8 | "instance-core": [ 9 | { 10 | "instance-name": [ 11 | { 12 | "data": "CUSTOMER_AWS" 13 | } 14 | ], 15 | "router-id": [ 16 | { 17 | "data": "9.9.9.9" 18 | } 19 | ], 20 | "instance-type": [ 21 | { 22 | "data": "non-forwarding" 23 | } 24 | ], 25 | "instance-state": [ 26 | { 27 | "data": "Active" 28 | } 29 | ] 30 | } 31 | ] 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/nxos/api/nxos_api_get_bgp_vrf_mgmt.json: -------------------------------------------------------------------------------- 1 | { 2 | "ins_api": { 3 | "outputs": { 4 | "output": { 5 | "clierror": {}, 6 | "code": "400", 7 | "input": "show bgp sessions vrf management", 8 | "msg": "CLI execution error" 9 | } 10 | }, 11 | "sid": "eoc", 12 | "type": "cli_show", 13 | "version": "1.0" 14 | } 15 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/nxos/ssh/nxos_show_bgp_session_vrf_default.json: -------------------------------------------------------------------------------- 1 | { 2 | "totalpeers": "3", 3 | "totalestablishedpeers": "0", 4 | "localas": "65535", 5 | "TABLE_vrf": { 6 | "ROW_vrf": { 7 | "vrf-name-out": "default", 8 | "local-as": "65535", 9 | "vrfpeers": "1", 10 | "vrfestablishedpeers": "0", 11 | "router-id": "172.16.0.1", 12 | "TABLE_neighbor": { 13 | "ROW_neighbor": { 14 | "neighbor-id": "172.16.0.2", 15 | "connectionsdropped": "0", 16 | "remoteas": "65535", 17 | "lastflap": "PT5H8M5S", 18 | "state": "Idle", 19 | "localport": "0", 20 | "remoteport": "0", 21 | "notificationssent": "0", 22 | "notificationsreceived": "0" 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/bgp/nxos/ssh/nxos_show_bgp_session_vrf_mgmt.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/features/src/outputs/cdp/ios/ssh/ios_show_cdp_neighbors_detail.txt: -------------------------------------------------------------------------------- 1 | ------------------------- 2 | Device ID: cumulus 3 | Entry address(es): 4 | IP address: 172.16.194.2 5 | Platform: Linux, Capabilities: Router 6 | Interface: GigabitEthernet0/2, Port ID (outgoing port): swp4 7 | Holdtime : 108 sec 8 | 9 | Version : 10 | Cumulus Linux version 3.7.5 11 | 12 | advertisement version: 2 13 | 14 | ------------------------- 15 | Device ID: ios 16 | Entry address(es): 17 | Platform: cisco IOS XRv Series, Capabilities: Router 18 | Interface: GigabitEthernet0/1, Port ID (outgoing port): GigabitEthernet0/0/0/3 19 | Holdtime : 170 sec 20 | 21 | Version : 22 | Cisco IOS XR Software, Version 6.1.3[Default] 23 | Copyright (c) 2017 by Cisco Systems, Inc. 24 | 25 | advertisement version: 1 26 | 27 | 28 | Total cdp entries displayed : 2 -------------------------------------------------------------------------------- /tests/features/src/outputs/cdp/nxos/api/nxos_api_get_cdp_neighbors_only_one.json: -------------------------------------------------------------------------------- 1 | { 2 | "ins_api": { 3 | "outputs": { 4 | "output": { 5 | "body": { 6 | "TABLE_cdp_neighbor_detail_info": { 7 | "ROW_cdp_neighbor_detail_info": { 8 | "capability": "router", 9 | "device_id": "cumulus", 10 | "ifindex": 83886080, 11 | "intf_id": "mgmt0", 12 | "mtu": 0, 13 | "num_mgmtaddr": 0, 14 | "numaddr": 1, 15 | "platform_id": "Linux", 16 | "port_id": "eth0", 17 | "ttl": 95, 18 | "v4addr": "100.96.0.14", 19 | "version": "Cumulus Linux version 3.7.9", 20 | "version_no": "v2" 21 | } 22 | } 23 | }, 24 | "code": "200", 25 | "input": "show cdp neighbors detail", 26 | "msg": "Success" 27 | } 28 | }, 29 | "sid": "eoc", 30 | "type": "cli_show", 31 | "version": "1.0" 32 | } 33 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/cdp/nxos/ssh/nxos_show_cdp_neighbors_only_one.json: -------------------------------------------------------------------------------- 1 | { 2 | "TABLE_cdp_neighbor_detail_info": { 3 | "ROW_cdp_neighbor_detail_info": { 4 | "ifindex": "83886080", 5 | "device_id": "cumulus", 6 | "numaddr": "1", 7 | "v4addr": "100.96.0.14", 8 | "platform_id": "Linux", 9 | "capability": "router", 10 | "intf_id": "mgmt0", 11 | "port_id": "eth0", 12 | "ttl": "114", 13 | "version": "Cumulus Linux version 3.7.9", 14 | "version_no": "v2", 15 | "mtu": "0", 16 | "num_mgmtaddr": "0" 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/arista/ssh/arista_cli_show_hostname.json: -------------------------------------------------------------------------------- 1 | { 2 | "fqdn": "leaf03.dh.local", 3 | "hostname": "leaf03" 4 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/arista/ssh/arista_cli_show_version.json: -------------------------------------------------------------------------------- 1 | { 2 | "memTotal": 2014424, 3 | "uptime": 10606.55, 4 | "modelName": "vEOS", 5 | "internalVersion": "4.24.0F-16270098.4240F", 6 | "mfgName": "", 7 | "serialNumber": "", 8 | "systemMacAddress": "50:00:00:d7:ee:0b", 9 | "bootupTimestamp": 1588500274.0, 10 | "memFree": 1174160, 11 | "version": "4.24.0F", 12 | "configMacAddress": "00:00:00:00:00:00", 13 | "isIntlVersion": false, 14 | "internalBuildId": "da8d6269-c25f-4a12-930b-c3c42c12c38a", 15 | "hardwareRevision": "", 16 | "hwMacAddress": "00:00:00:00:00:00", 17 | "architecture": "i686" 18 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/extreme_vsp/ssh/extreme_vsp_show_sys_dns.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Fri Apr 17 01:27:06 2020 UTC 3 | ************************************************************************************ 4 | DNS Default Domain Name : dh.local 5 | 6 | No DNS server configured -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/ios/ssh/cisco_ios_ip_interface_brief.txt: -------------------------------------------------------------------------------- 1 | Interface IP-Address OK? Method Status Protocol 2 | GigabitEthernet1 10.10.20.48 YES NVRAM up up 3 | GigabitEthernet2 unassigned YES NVRAM administratively down down 4 | GigabitEthernet3 unassigned YES NVRAM administratively down down -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/iosxr/ssh/cisco_iosxr_show_ip_interface_brief.txt: -------------------------------------------------------------------------------- 1 | 2 | Wed Apr 22 15:52:54.733 UTC 3 | 4 | Interface IP-Address Status Protocol Vrf-Name 5 | Bundle-Ether1 unassigned Down Down default 6 | Bundle-Ether1.1234 unassigned Down Down default 7 | Bundle-Ether1.4321 unassigned Down Down default 8 | Loopback100 1.1.1.100 Up Up default 9 | Loopback200 1.1.1.200 Up Up default 10 | MgmtEth0/RP0/CPU0/0 10.10.20.175 Up Up default 11 | GigabitEthernet0/0/0/0 unassigned Up Up default 12 | GigabitEthernet0/0/0/1 1.1.1.1 Up Up default 13 | GigabitEthernet0/0/0/2 unassigned Shutdown Down default 14 | GigabitEthernet0/0/0/3 unassigned Shutdown Down default 15 | GigabitEthernet0/0/0/4 unassigned Shutdown Down default 16 | GigabitEthernet0/0/0/5 unassigned Shutdown Down default 17 | GigabitEthernet0/0/0/6 unassigned Shutdown Down default -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/iosxr/ssh/cisco_iosxr_show_version.txt: -------------------------------------------------------------------------------- 1 | Wed Apr 22 15:52:54.116 UTC 2 | Cisco IOS XR Software, Version 6.5.3 3 | Copyright (c) 2013-2019 by Cisco Systems, Inc. 4 | 5 | Build Information: 6 | Built By : ahoang 7 | Built On : Tue Mar 26 06:52:25 PDT 2019 8 | Built Host : spine03 9 | Workspace : /auto/srcarchive13/prod/6.5.3/xrv9k/ws 10 | Version : 6.5.3 11 | Location : /opt/cisco/XR/packages/ 12 | 13 | cisco IOS-XRv 9000 () processor 14 | System uptime is 1 week 2 hours 27 minutes -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/nxos/api/nxos_api_get_domain.json: -------------------------------------------------------------------------------- 1 | { 2 | "ins_api": { 3 | "outputs": { 4 | "output": { 5 | "body": { 6 | "hostname": "leaf02.dh.local" 7 | }, 8 | "code": "200", 9 | "input": "show hostname", 10 | "msg": "Success" 11 | } 12 | }, 13 | "sid": "eoc", 14 | "type": "cli_show", 15 | "version": "1.0" 16 | } 17 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/facts/nxos/ssh/nxos_show_hostname.json: -------------------------------------------------------------------------------- 1 | { 2 | "hostname": "leaf03.dh.local" 3 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/extreme_vsp/ssh/extreme_vsp_show_lldp_neighbors.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Mon May 04 01:45:44 2020 UTC 3 | ************************************************************************************ 4 | 5 | ========================================================================================== 6 | LLDP Neighbor 7 | ========================================================================================== 8 | 9 | Port: 1/2 Index : 1 10 | Protocol : LLDP 11 | ChassisId: MAC Address 50:00:00:d7:ee:0b 12 | PortId : IfName Ethernet2 13 | SysName : leaf03.dh.local 14 | SysCap : Br / Br 15 | PortDescr: 16 | SysDescr : 17 | Address : 192.168.1.199 18 | ------------------------------------------------------------------------------------------ 19 | Total Neighbors : 1 20 | ------------------------------------------------------------------------------------------ 21 | Capabilities Legend: (Supported/Enabled) 22 | B= Bridge, D= DOCSIS, O= Other, R= Repeater, 23 | S= Station, T= Telephone, W= WLAN, r= Router -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/ios/ssh/ios_show_lldp_neighbors.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------ 2 | Local Intf: Gi0/1 3 | Chassis id: 0252.bbc0.0c06 4 | Port id: Gi0/0/0/3 5 | Port Description - not advertised 6 | System Name: ios 7 | 8 | System Description: 9 | Cisco IOS XR Software, Version 6.1.3[Default] 10 | Copyright (c) 2017 by Cisco Systems, Inc., IOS XRv Series 11 | 12 | Time remaining: 102 seconds 13 | System Capabilities: R 14 | Enabled Capabilities: R 15 | Management Addresses - not advertised 16 | Auto Negotiation - not supported 17 | Physical media capabilities - not advertised 18 | Media Attachment Unit type - not advertised 19 | Vlan ID: - not advertised 20 | 21 | ------------------------------------------------ 22 | Local Intf: Gi0/2 23 | Chassis id: 5000.0001.0000 24 | Port id: swp4 25 | Port Description: swp4 26 | System Name: cumulus 27 | 28 | System Description: 29 | Cumulus Linux version 3.7.5 running on Bochs Bochs 30 | 31 | Time remaining: 97 seconds 32 | System Capabilities: B,R 33 | Enabled Capabilities: R 34 | Management Addresses: 35 | IP: 172.16.194.2 36 | IPV6: FE80::5200:FF:FE01:0 37 | Auto Negotiation - not supported 38 | Physical media capabilities - not advertised 39 | Media Attachment Unit type: 30 40 | Vlan ID: - not advertised 41 | 42 | 43 | Total entries displayed: 2 -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/iosxr/ssh/cisco_iosxr_show_lldp_neighbors.txt: -------------------------------------------------------------------------------- 1 | 2 | Wed May 6 10:09:37.371 UTC 3 | Capability codes: 4 | (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device 5 | (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other 6 | 7 | Device ID Local Intf Hold-time Capability Port ID 8 | spine02.tesuto.inter GigabitEthernet0/0/0/2 120 R Gi4 9 | 10 | Total entries displayed: 1 -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/juniper/api/juniper_api_get_lldp_neighbors.json: -------------------------------------------------------------------------------- 1 | { 2 | "lldp-neighbors-information": { 3 | "@style": "brief", 4 | "lldp-neighbor-information": [ 5 | { 6 | "lldp-local-parent-interface-name": "-", 7 | "lldp-local-port-id": "fxp0", 8 | "lldp-remote-chassis-id": "00:1e:f6:be:d5: 00", 9 | "lldp-remote-chassis-id-subtype": "Mac address", 10 | "lldp-remote-port-id": "Gi1", 11 | "lldp-remote-port-id-subtype": "Interface name", 12 | "lldp-remote-system-name": "spine02.tesuto.internal" 13 | }, 14 | { 15 | "lldp-local-parent-interface-name": "-", 16 | "lldp-local-port-id": "fxp0", 17 | "lldp-remote-chassis-id": "92: 99: 00:0e: 00: 00", 18 | "lldp-remote-chassis-id-subtype": "Mac address", 19 | "lldp-remote-port-id": "mgmt0", 20 | "lldp-remote-port-id-subtype": "Interface name", 21 | "lldp-remote-system-name": "leaf02" 22 | } 23 | ] 24 | } 25 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/juniper/netconf/juniper_nc_get_lldp_neighbors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fxp0 4 | - 5 | Mac address 6 | 00:1e:f6:be:d5:00 7 | Interface name 8 | Gi1 9 | spine02.tesuto.internal 10 | 11 | 12 | fxp0 13 | - 14 | Mac address 15 | 92:99:00:0e:00:00 16 | Interface name 17 | mgmt0 18 | leaf02 19 | 20 | -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/napalm/napalm_get_lldp.json: -------------------------------------------------------------------------------- 1 | { 2 | "get_lldp_neighbors_detail": { 3 | "GigabitEthernet0/1": [ 4 | { 5 | "parent_interface": "", 6 | "remote_chassis_id": "0252.bbc0.0c07", 7 | "remote_port": "Gi0/0/0/3", 8 | "remote_port_description": "", 9 | "remote_system_capab": [ 10 | "router" 11 | ], 12 | "remote_system_description": "Cisco IOS XR Software, Version 6.1.3[Default]", 13 | "remote_system_enable_capab": ["router"], 14 | "remote_system_name": "ios" 15 | } 16 | ], 17 | "GigabitEthernet0/2": [ 18 | { 19 | "parent_interface": "", 20 | "remote_chassis_id": "5000.0001.0000", 21 | "remote_port": "swp4", 22 | "remote_port_description": "swp4", 23 | "remote_system_capab": [ 24 | "bridge", 25 | "router" 26 | ], 27 | "remote_system_description": "Cumulus Linux version 3.7.5 running on Bochs Bochs", 28 | "remote_system_enable_capab": ["router"], 29 | "remote_system_name": "cumulus" 30 | } 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/lldp/nxos/ssh/nxos_show_lldp_neighbors_only_one.json: -------------------------------------------------------------------------------- 1 | { 2 | "neigh_hdr": "neigh_hdr", 3 | "TABLE_nbor_detail": { 4 | "ROW_nbor_detail": { 5 | "chassis_type": "Mac Address", 6 | "chassis_id": "001e.f6be.d500", 7 | "port_type": "Interface Name", 8 | "port_id": "Gi1", 9 | "l_port_id": "mgmt0", 10 | "port_desc": "GigabitEthernet1", 11 | "sys_name": "spine02.tesuto.internal", 12 | "sys_desc": "Cisco IOS Software [Everest], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.6.1, RELEASE SOFTWARE (fc2)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2017 by Cisco Systems, Inc.\nCompiled Sat 22-Jul-17 05:51 by", 13 | "ttl": "117", 14 | "system_capability": "B, R", 15 | "enabled_capability": "R", 16 | "mgmt_addr_type": "IPV4", 17 | "mgmt_addr": "100.96.0.20", 18 | "mgmt_addr_ipv6_type": "Address not advertised", 19 | "mgmt_addr_ipv6": "not advertised", 20 | "vlan_id": "not advertised" 21 | } 22 | }, 23 | "neigh_count": "1" 24 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/arista/api/arista_ospf_neighbors_vrf_netests.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "id": "EapiExplorer-1", 4 | "result": [ 5 | { 6 | "vrfs": { 7 | "CUSTOMER_NETESTS": { 8 | "instList": { 9 | "1": { 10 | "ospfNeighborEntries": [] 11 | } 12 | } 13 | } 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/arista/api/arista_ospf_neighbors_vrf_wejob.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "id": "EapiExplorer-1", 4 | "error": { 5 | "data": [ 6 | { 7 | "vrfs": {}, 8 | "errors": [ 9 | "OSPF instance does not exist in vrf CUSTOMER_WEJOB" 10 | ] 11 | } 12 | ], 13 | "message": "CLI command 1 of 1 \"show ip ospf neighbor detail vrf CUSTOMER_WEJOB\" failed: could not run command", 14 | "code": 1000 15 | } 16 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/arista/api/arista_ospf_rid_vrf_wejob.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "id": "EapiExplorer-1", 4 | "error": { 5 | "data": [ 6 | { 7 | "vrfs": {}, 8 | "errors": [ 9 | "OSPF instance does not exist in vrf CUSTOMER_WEJOB" 10 | ] 11 | } 12 | ], 13 | "message": "CLI command 1 of 1 \"show ip ospf vrf CUSTOMER_WEJOB\" failed: could not run command", 14 | "code": 1000 15 | } 16 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/arista/ssh/arista_ospf_neighbors_vrf_netests.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": { 3 | "CUSTOMER_NETESTS": { 4 | "instList": { 5 | "1": { 6 | "ospfNeighborEntries": [] 7 | } 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/arista/ssh/arista_ospf_neighbors_vrf_wejob.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": {}, 3 | "errors": [ 4 | "OSPF instance does not exist in vrf CUSTOMER_WEJOB" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/arista/ssh/arista_ospf_rid_vrf_wejob.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": {}, 3 | "errors": [ 4 | "OSPF instance does not exist in vrf CUSTOMER_WEJOB" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/cumulus/ssh/cumulus_ospf_neighbors.json: -------------------------------------------------------------------------------- 1 | { 2 | "neighbors": {} 3 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/cumulus/ssh/cumulus_ospf_neighbors_vrf_mgmt.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netests/netests/1a48bda461761c4ec854d6fa0c38629049009a4a/tests/features/src/outputs/ospf/cumulus/ssh/cumulus_ospf_neighbors_vrf_mgmt.json -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/cumulus/ssh/cumulus_ospf_no_running.txt: -------------------------------------------------------------------------------- 1 | ERROR: ospfd is not running -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/cumulus/ssh/cumulus_ospf_rid.json: -------------------------------------------------------------------------------- 1 | { 2 | "routerId": "51.51.51.51", 3 | "tosRoutesOnly": true, 4 | "rfc2328Conform": true, 5 | "spfScheduleDelayMsecs": 0, 6 | "holdtimeMinMsecs": 50, 7 | "holdtimeMaxMsecs": 5000, 8 | "holdtimeMultplier": 1, 9 | "spfHasNotRun": true, 10 | "lsaMinIntervalMsecs": 5000, 11 | "lsaMinArrivalMsecs": 1000, 12 | "writeMultiplier": 20, 13 | "refreshTimerMsecs": 10000, 14 | "lsaExternalCounter": 0, 15 | "lsaExternalChecksum": 0, 16 | "lsaAsopaqueCounter": 0, 17 | "lsaAsOpaqueChecksum": 0, 18 | "attachedAreaCounter": 0, 19 | "adjacencyChangesLogged": true, 20 | "areas": {} 21 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/cumulus/ssh/cumulus_ospf_rid_vrf_mgmt.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_interface.txt: -------------------------------------------------------------------------------- 1 | Command Execution Time: Tue May 12 04:10:59 2020 UTC 2 | ************************************************************************************ 3 | ---------------------------------------------------------------------------------------------------- 4 | 5 | Total ospf areas: 1 6 | 7 | Total ospf interfaces: 1 8 | 9 | ==================================================================================================== 10 | OSPF Interface - GlobalRouter 11 | ==================================================================================================== 12 | INTERFACE AREA ADM IFST MET PRI DR/ TYPE AUTH MTU 13 | ID BDR TYPE IGNO 14 | ---------------------------------------------------------------------------------------------------- 15 | 10.1.20.2 0.0.0.0 en BDR 1 1 10.1.20.1 brdc none dis 16 | 10.1.20.2 17 | 18 | 19 | DR_O = DR_OTHER -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_interface_vrf_mgmt.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:11:03 2020 UTC 3 | ************************************************************************************ 4 | 5 | Error: OSPF instance does not exist for VRF: "MgmtRouter" 6 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_interface_vrf_netests.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:11:01 2020 UTC 3 | ************************************************************************************ 4 | 5 | Error: OSPF instance does not exist for VRF: "netests_vrf" -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_neighbors.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:10:57 2020 UTC 3 | ************************************************************************************ 4 | 5 | ==================================================================================================== 6 | OSPF Neighbors - GlobalRouter 7 | ==================================================================================================== 8 | INTERFACE NBRROUTERID NBRIPADDR PRIO STATE RTXQLEN PERM TTL 9 | ---------------------------------------------------------------------------------------------------- 10 | 10.1.20.2 151.151.151.151 10.1.20.1 1 Full 0 Dyn 33 11 | 12 | Total ospf neighbors: 1 13 | 14 | H = Helping a Restarting neighbor -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_neighbors_vrf_mgmt.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:11:01 2020 UTC 3 | ************************************************************************************ 4 | 5 | Error: OSPF instance does not exist for VRF: "MgmtRouter" 6 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_neighbors_vrf_netests.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:10:59 2020 UTC 3 | ************************************************************************************ 4 | 5 | Error: OSPF instance does not exist for VRF: "netests_vrf" -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_rid.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:10:58 2020 UTC 3 | ************************************************************************************ 4 | 5 | ==================================================================================================== 6 | OSPF General - GlobalRouter 7 | ==================================================================================================== 8 | 9 | RouterId: 62.62.62.62 10 | AdminStat: enabled 11 | VersionNumber: 2 12 | AreaBdrRtrStatus: false 13 | ASBdrRtrStatus: false 14 | Bad-Lsa-Ignore: false 15 | ExternLsaCount: 0 16 | ExternLsaCksumSum: 0(0x0) 17 | TOSSupport: 0 18 | OriginateNewLsas: 36 19 | RxNewLsas: 129 20 | TrapEnable: false 21 | AutoVirtLinkEnable: false 22 | SpfHoldDownTime: 10 23 | Rfc1583Compatibility: disable 24 | Helper Mode : enabled 25 | 26 | default-metric : 27 | ethernet - 100 28 | fast-ethernet - 10 29 | gig-ethernet - 1 30 | ten-gig-ethernet - 1 31 | forty-gig-ethernet - 1 32 | vlan - 10 -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_rid_vrf_mgmt.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04:11:02 2020 UTC 3 | ************************************************************************************ 4 | 5 | Error: OSPF instance does not exist for VRF: "MgmtRouter" 6 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/extreme_vsp/ssh/extreme_vsp_ospf_rid_vrf_netests.txt: -------------------------------------------------------------------------------- 1 | ************************************************************************************ 2 | Command Execution Time: Tue May 12 04: 11: 00 2020 UTC 3 | ************************************************************************************ 4 | 5 | Error: OSPF instance does not exist for VRF: "netests_vrf" -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/ios/ssh/show_ip_ospf_interface_brief.txt: -------------------------------------------------------------------------------- 1 | Interface PID Area IP Address/Mask Cost State Nbrs F/C 2 | Gi2 4 0 10.5.1.1/24 1 DR 1/1 3 | Gi3 11 0 10.5.3.1/24 1 DR 0/1 -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/ios/ssh/show_ip_ospf_neighbors.txt: -------------------------------------------------------------------------------- 1 | Neighbor 61.61.61.61, interface address 10.5.1.2 2 | In the area 0 via interface GigabitEthernet2 3 | Neighbor priority is 1, State is FULL, 6 state changes 4 | DR is 10.5.1.1 BDR is 10.5.1.2 5 | Options is 0x2 in Hello (E-bit) 6 | Options is 0x2 in DBD (E-bit) 7 | Dead timer due in 00:00:37 8 | Neighbor is up for 01:11:51 9 | Index 1/1/1, retransmission queue length 0, number of retransmission 1 10 | First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0) 11 | Last retransmission scan length is 1, maximum is 1 12 | Last retransmission scan time is 0 msec, maximum is 0 msec 13 | Neighbor 63.63.63.63, interface address 10.5.3.2, interface-id 11 14 | In the area 0 via interface GigabitEthernet3 15 | Neighbor priority is 1, State is INIT, 7 state changes 16 | DR is 0.0.0.0 BDR is 0.0.0.0 17 | Options is 0x12 in Hello (E-bit, L-bit) 18 | LLS Options is 0x1 (LR) 19 | Dead timer due in 00:00:36 20 | Index 0/0/0, retransmission queue length 0, number of retransmission 1 21 | First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0) 22 | Last retransmission scan length is 1, maximum is 1 23 | Last retransmission scan time is 0 msec, maximum is 0 msec -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/juniper/api/juniper_ospf_neighbors_vrf_mgmt.xml: -------------------------------------------------------------------------------- 1 | OSPF instance is not running -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/juniper/api/juniper_ospf_rid_vrf_mgmt.xml: -------------------------------------------------------------------------------- 1 | OSPF instance is not running -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/juniper/netconf/juniper_ospf_neighbors_vrf_mgmt.xml: -------------------------------------------------------------------------------- 1 | OSPF instance is not running -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/juniper/netconf/juniper_ospf_rid_vrf_mgmt.xml: -------------------------------------------------------------------------------- 1 | OSPF instance is not running -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/juniper/ssh/juniper_ospf_neighbors_vrf_mgmt.json: -------------------------------------------------------------------------------- 1 | { 2 | "output": [ 3 | { 4 | "data": "OSPF instance is not running" 5 | } 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/juniper/ssh/juniper_ospf_rid_vrf_mgmt.json: -------------------------------------------------------------------------------- 1 | { 2 | "output": [ 3 | { 4 | "data": "OSPF instance is not running" 5 | } 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/nxos/nxos_no_ospf.txt: -------------------------------------------------------------------------------- 1 | ^ 2 | % Invalid command at '^' marker. -------------------------------------------------------------------------------- /tests/features/src/outputs/ospf/nxos/ssh/nxos_ospf_neighbors_vrf_netests.json: -------------------------------------------------------------------------------- 1 | { 2 | "TABLE_ctx": { 3 | "ROW_ctx": { 4 | "ptag": "4", 5 | "cname": "default", 6 | "TABLE_nbr": { 7 | "ROW_nbr": { 8 | "rid": "63.63.63.63", 9 | "addr": "10.2.3.2", 10 | "area": "0.0.0.0", 11 | "intf": "Ethernet1/3", 12 | "state": "FULL", 13 | "transition": "5", 14 | "lastchange": "PT13S", 15 | "master": "slave", 16 | "seqno": "0x4e78c7f9", 17 | "dbdallsentacked": "true", 18 | "dbdallsent": "true", 19 | "dbdallacked": "true", 20 | "helloptions": "0x12", 21 | "dbdoptions": "0x52", 22 | "lastnonhello": "PT1H18M53S", 23 | "deadtimer": "PT36S", 24 | "dbdrxmtimer": "PT28S" 25 | } 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/api/arista_ping_no_route.json: -------------------------------------------------------------------------------- 1 | { "id": "4611274624", 2 | "jsonrpc": "2.0", 3 | "result": [ 4 | {}, 5 | {"messages": ["connect: Network is unreachable\n"] 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/api/arista_ping_unreachable.json: -------------------------------------------------------------------------------- 1 | { "id": "4451735424", 2 | "jsonrpc": "2.0", 3 | "result": [ 4 | {}, 5 | { 6 | "messages": ["PING 192.168.1.111 (192.168.1.111) 72(100) bytes of data.\n\n--- 192.168.1.111 ping statistics ---\n1 packets transmitted,0 received,100% packet loss, time 0ms\n\n"] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/api/arista_ping_works.json: -------------------------------------------------------------------------------- 1 | { "id": "4556220456", 2 | "jsonrpc": "2.0", 3 | "result": [ 4 | {}, 5 | { "messages": ["PING 192.168.1.1 (192.168.1.1) 72(100) bytes of data.\n80 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.35 ms\n\n--- 192.168.1.1 ping statistics ---\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\nrtt min/avg/max/mdev = 3.359/3.359/3.359/0.000 ms\n" 6 | ] 7 | } 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/api/arista_ping_wrong_ip.json: -------------------------------------------------------------------------------- 1 | { "id": "4611274624", 2 | "jsonrpc": "2.0", 3 | "result": [ 4 | {}, 5 | { "messages": ["ping: 192.168.1.199kh: Temporary failure in name resolution\n"] 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/api/arista_ping_wrong_vrf.json: -------------------------------------------------------------------------------- 1 | { "id": "4611274624", 2 | "jsonrpc": "2.0", 3 | "result": [ 4 | {}, 5 | {"messages": ["connect: Network is unreachable\n"] 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/ssh/arista_ping_no_route.txt: -------------------------------------------------------------------------------- 1 | connect: Network is unreachable -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/ssh/arista_ping_unreachable.txt: -------------------------------------------------------------------------------- 1 | PING 192.168.1.111 (192.168.1.111) 72(100) bytes of data. 2 | 3 | --- 192.168.1.111 ping statistics --- 4 | 1 packets transmitted, 0 received, 100% packet loss, time 0ms -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/ssh/arista_ping_works.txt: -------------------------------------------------------------------------------- 1 | PING 192.168.1.1 (192.168.1.1) 72(100) bytes of data. 2 | 80 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=17.4 ms 3 | 4 | --- 192.168.1.1 ping statistics --- 5 | 1 packets transmitted, 1 received, 0% packet loss, time 0ms 6 | rtt min/avg/max/mdev = 17.410/17.410/17.410/0.000 ms -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/ssh/arista_ping_wrong_ip.txt: -------------------------------------------------------------------------------- 1 | ping: 1.12.234.3423: Temporary failure in name resolution -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/arista/ssh/arista_ping_wrong_vrf.txt: -------------------------------------------------------------------------------- 1 | % Invalid input - VRF 'dhwudhiewdhwiu' does not exist -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/extreme_vsp/ssh/extreme_vsp_ping_no_route.txt: -------------------------------------------------------------------------------- 1 | ping: timeout 2 | no answer from 8.8.8.8 -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/extreme_vsp/ssh/extreme_vsp_ping_unreachable.txt: -------------------------------------------------------------------------------- 1 | ping: timeout 2 | no answer from 172.16.194.222 3 | 4 | Please specify a sourceIp for a VRF ping! 5 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/extreme_vsp/ssh/extreme_vsp_ping_works.txt: -------------------------------------------------------------------------------- 1 | 172.16.194.1 is alive -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/extreme_vsp/ssh/extreme_vsp_ping_wrong_ip.txt: -------------------------------------------------------------------------------- 1 | Invalid host name format or IP address: 342.3.4.3 -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/extreme_vsp/ssh/extreme_vsp_ping_wrong_vrf.txt: -------------------------------------------------------------------------------- 1 | Error: The VRF Name entered does not correspond to any VRF -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_no_route.txt: -------------------------------------------------------------------------------- 1 | Type escape sequence to abort. 2 | Sending 1, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: 3 | . 4 | Success rate is 0 percent (0/1) -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_no_vrf_configured.txt: -------------------------------------------------------------------------------- 1 | ^ 2 | % Invalid input detected at '^' marker. 3 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_unreachable.txt: -------------------------------------------------------------------------------- 1 | Type escape sequence to abort. 2 | Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: 3 | ..... 4 | Success rate is 0 percent (0/5) -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_vrf_no_ip_src.txt: -------------------------------------------------------------------------------- 1 | % VRF TEST_DH does not have a usable source address -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_works.txt: -------------------------------------------------------------------------------- 1 | Type escape sequence to abort. 2 | Sending 1, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: 3 | ! 4 | Success rate is 100 percent (1/1), round-trip min/avg/max = 27/27/27 ms -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_wrong_ip.txt: -------------------------------------------------------------------------------- 1 | % Unrecognized host or address, or protocol not running. 2 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/ios/ssh/ios_ping_wrong_vrf.txt: -------------------------------------------------------------------------------- 1 | vrf e23eo23euo23e does not exist% Unable to find vrf 'e23eo23euo23e' 2 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/netconf/iosxr_ping_no_route.json: -------------------------------------------------------------------------------- 1 | { 2 | "rpc-reply": { 3 | "@message-id": "urn:uuid:fb35c54d-f573-4e93-acba-f47a358b457a", 4 | "@xmlns": "urn:ietf:params:xml:ns:netconf:base: 1.0", 5 | "ping-response": { 6 | "@xmlns": "http: //cisco.com/ns/yang/Cisco-IOS-XR-ping-act", 7 | "ipv4": { 8 | "data-size": "100", 9 | "destination": "222.2.2.2", 10 | "hits": "0", 11 | "pattern": "abcd", 12 | "repeat-count": "1", 13 | "replies": { 14 | "reply": { 15 | "reply-index": "1", 16 | "result": "U" 17 | } 18 | }, 19 | "rotate-pattern": "false", 20 | "success-rate": "0", 21 | "timeout": "2", 22 | "total": "1" 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/netconf/iosxr_ping_unreachable.json: -------------------------------------------------------------------------------- 1 | { 2 | "rpc-reply": { 3 | "@message-id": "urn:uuid:f64fba90-dd83-4633-941c-3cd9e6ec98c9", 4 | "@xmlns": "urn:ietf:params:xml:ns:netconf:base: 1.0", 5 | "ping-response": { 6 | "@xmlns": "http: //cisco.com/ns/yang/Cisco-IOS-XR-ping-act", 7 | "ipv4": { 8 | "data-size": "100", 9 | "destination": "33.33.33.33", 10 | "hits": "0", 11 | "pattern": "abcd", 12 | "repeat-count": "1", 13 | "replies": { 14 | "reply": { 15 | "reply-index": "1", 16 | "result": "." 17 | } 18 | }, 19 | "rotate-pattern": "false", 20 | "success-rate": "0", 21 | "timeout": "2", 22 | "total": "1" 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/netconf/iosxr_ping_works.json: -------------------------------------------------------------------------------- 1 | { 2 | "rpc-reply": { 3 | "@message-id": "urn:uuid: 3a4e22d2-ebc6-4e25-9a9a-c5602c493e8d", 4 | "@xmlns": "urn:ietf:params:xml:ns:netconf:base: 1.0", 5 | "ping-response": { 6 | "@xmlns": "http: //cisco.com/ns/yang/Cisco-IOS-XR-ping-act", 7 | "ipv4": { 8 | "data-size": "100", 9 | "destination": "1.1.1.20", 10 | "hits": "1", 11 | "pattern": "abcd", 12 | "repeat-count": "1", 13 | "replies": { 14 | "reply": { 15 | "reply-index": "1", 16 | "result": "!" 17 | } 18 | }, 19 | "rotate-pattern": "false", 20 | "rtt-avg": "29", 21 | "rtt-max": "29", 22 | "rtt-min": "29", 23 | "success-rate": "100", 24 | "timeout": "2", 25 | "total": "1" 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/netconf/iosxr_ping_wrong_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "rpc-reply": { 3 | "@message-id": "urn:uuid:a6d684b5-ba77-4664-a83b-46f55c3fb696", 4 | "@xmlns": "urn:ietf:params:xml:ns:netconf:base: 1.0", 5 | "rpc-error": { 6 | "error-message": { 7 | "#text": "IPv4PingTrace detected the warning condition Bad hostname or protocol not running", 8 | "@xml:lang": "en" 9 | }, 10 | "error-severity": "error", 11 | "error-tag": "operation-failed", 12 | "error-type": "application" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/netconf/iosxr_ping_wrong_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "rpc-reply": { 3 | "@message-id": "urn:uuid: 416e6d71-b8dc-4b6e-908a-48e8048bd992", 4 | "@xmlns": "urn:ietf:params:xml:ns:netconf:base: 1.0", 5 | "rpc-error": { 6 | "error-message": { 7 | "#text": "IPv4PingTrace detected the warningcondition Invalid VRF table name", 8 | "@xml:lang": "en" 9 | }, 10 | "error-severity": "error", 11 | "error-tag": "operation-failed", 12 | "error-type": "application" 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/ssh/iosxr_ping_no_route.txt: -------------------------------------------------------------------------------- 1 | Sat May 9 17:00:10.674 UTC 2 | Type escape sequence to abort. 3 | Sending 1, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: 4 | U 5 | Success rate is 0 percent (0/1) -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/ssh/iosxr_ping_unreachable.txt: -------------------------------------------------------------------------------- 1 | Sat May 9 16:59:07.053 UTC 2 | Type escape sequence to abort. 3 | Sending 1, 100-byte ICMP Echos to 5.3.2.2, timeout is 2 seconds: 4 | . 5 | Success rate is 0 percent (0/1) -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/ssh/iosxr_ping_works.txt: -------------------------------------------------------------------------------- 1 | Sat May 9 16:57:00.494 UTC 2 | Type escape sequence to abort. 3 | Sending 1, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: 4 | ! 5 | Success rate is 100 percent (1/1), round-trip min/avg/max = 29/29/29 ms -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/ssh/iosxr_ping_wrong_ip.txt: -------------------------------------------------------------------------------- 1 | Sat May 9 16:58:32.175 UTC 2 | % Bad hostname or protocol not running -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/iosxr/ssh/iosxr_ping_wrong_vrf.txt: -------------------------------------------------------------------------------- 1 | Sat May 9 16:57:54.842 UTC 2 | %% Invalid vrf table name -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/api/juniper_ping_no_route.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "@xmlns": "http: //xml.juniper.net/junos/19.4R0/junos-probe-tests", 4 | "packet-size": "56", 5 | "ping-failure": "no response", 6 | "probe-results-summary": { 7 | "packet-loss": "100", 8 | "probes-sent": "1", 9 | "responses-received": "0" 10 | }, 11 | "target-host": "9.9.99.88", 12 | "target-ip": "9.9.99.88", 13 | "xnm:warning": { 14 | "@xmlns": "http: //xml.juniper.net/xnm/1.1/xnm", 15 | "@xmlns:xnm": "http: //xml.juniper.net/xnm/1.1/xnm", 16 | "message": "sendto: No route to host", 17 | "source-daemon": "ping" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/api/juniper_ping_no_src_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "@xmlns": "http: //xml.juniper.net/junos/19.4R0/junos-probe-tests", 4 | "packet-size": "56", 5 | "ping-failure": "no response", 6 | "probe-results-summary": { 7 | "packet-loss": "100", 8 | "probes-sent": "1", 9 | "responses-received": "0" 10 | }, 11 | "target-host": "1.1.1.1", 12 | "target-ip": "1.1.1.1", 13 | "xnm:warning": { 14 | "@xmlns": "http: //xml.juniper.net/xnm/1.1/xnm", 15 | "@xmlns:xnm": "http: //xml.juniper.net/xnm/1.1/xnm", 16 | "message": "sendto: Can't assign requested address", 17 | "source-daemon": "ping" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/api/juniper_ping_unreachable.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "@xmlns": "http: //xml.juniper.net/junos/19.4R0/junos-probe-tests", 4 | "packet-size": "56", 5 | "ping-failure": "no response", 6 | "probe-results-summary": { 7 | "packet-loss": "100", 8 | "probes-sent": "1", 9 | "responses-received": "0" 10 | }, 11 | "target-host": "100.123.1.88", 12 | "target-ip": "100.123.1.88" 13 | } 14 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/api/juniper_ping_works.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "@xmlns": "http: //xml.juniper.net/junos/19.4R0/junos-probe-tests", 4 | "packet-size": "56", 5 | "ping-success": "None", 6 | "probe-result": { 7 | "@date-determined": "1589102280", 8 | "ip-address": "100.123.1.0", 9 | "probe-index": "1", 10 | "probe-success": "None", 11 | "response-size": "64", 12 | "rtt": "41", 13 | "sequence-number": "0", 14 | "time-to-live": "64" 15 | }, 16 | "probe-results-summary": { 17 | "packet-loss": "0", 18 | "probes-sent": "1", 19 | "responses-received": "1", 20 | "rtt-average": "41", 21 | "rtt-maximum": "41", 22 | "rtt-minimum": "41", 23 | "rtt-stddev": "0" 24 | }, 25 | "target-host": "100.123.1.0", 26 | "target-ip": "100.123.1.0" 27 | } 28 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/api/juniper_ping_wrong_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "@xmlns": "http: //xml.juniper.net/junos/19.4R0/junos-probe-tests", 4 | "ping-failure": "usage error", 5 | "xnm:error": { 6 | "@xmlns": "http: //xml.juniper.net/xnm/1.1/xnm", 7 | "@xmlns:xnm": "http: //xml.juniper.net/xnm/1.1/xnm", 8 | "message": "cannot resolve 100.123.1.11110: Host name lookup failure", 9 | "source-daemon": "ping" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/api/juniper_ping_wrong_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "@xmlns": "http: //xml.juniper.net/junos/19.4R0/junos-probe-tests", 4 | "ping-failure": "usage error", 5 | "xnm:error": { 6 | "@xmlns": "http: //xml.juniper.net/xnm/1.1/xnm", 7 | "@xmlns:xnm": "http: //xml.juniper.net/xnm/1.1/xnm", 8 | "message": "invalid routing instance `edkwedlwewjdnw", 9 | "source-daemon": "ping" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/netconf/juniper_ping_no_route.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "packet-size": "56", 4 | "ping-failure": "no response", 5 | "probe-results-summary": { 6 | "packet-loss": "100", 7 | "probes-sent": "1", 8 | "responses-received": "0" 9 | }, 10 | "rpc-error": { 11 | "error-message": "sendto: No route to host", 12 | "error-severity": "warning", 13 | "source-daemon": "ping" 14 | }, 15 | "target-host": "9.9.99.88", 16 | "target-ip": "9.9.99.88" 17 | } 18 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/netconf/juniper_ping_no_src_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "packet-size": "56", 4 | "ping-failure": "no response", 5 | "probe-results-summary": { 6 | "packet-loss": "100", 7 | "probes-sent": "1", 8 | "responses-received": "0" 9 | }, 10 | "rpc-error": { 11 | "error-message": "sendto: Can't assign requested address", 12 | "error-severity": "warning", 13 | "source-daemon": "ping" 14 | }, 15 | "target-host": "1.1.1.1", 16 | "target-ip": "1.1.1.1" 17 | } 18 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/netconf/juniper_ping_unreachable.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "packet-size": "56", 4 | "ping-failure": "no response", 5 | "probe-results-summary": { 6 | "packet-loss": "100", 7 | "probes-sent": "1", 8 | "responses-received": "0" 9 | }, 10 | "target-host": "100.123.1.88", 11 | "target-ip": "100.123.1.88" 12 | } 13 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/netconf/juniper_ping_works.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "packet-size": "56", 4 | "ping-success": "None", 5 | "probe-result": { 6 | "@date-determined": "1589101001", 7 | "ip-address": "100.123.1.0", 8 | "probe-index": "1", 9 | "probe-success": "None", 10 | "response-size": "64", 11 | "rtt": "43", 12 | "sequence-number": "0", 13 | "time-to-live": "64" 14 | }, 15 | "probe-results-summary": { 16 | "packet-loss": "0", 17 | "probes-sent": "1", 18 | "responses-received": "1", 19 | "rtt-average": "43", 20 | "rtt-maximum": "43", 21 | "rtt-minimum": "43", 22 | "rtt-stddev": "0" 23 | }, 24 | "target-host": "100.123.1.0", 25 | "target-ip": "100.123.1.0" 26 | } 27 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/netconf/juniper_ping_wrong_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "ping-failure": "usage error", 4 | "rpc-error": { 5 | "error-message": "cannot resolve 100.123.1.11110: Host name lookup failure", 6 | "error-severity": "error", 7 | "error-tag": "operation-failed", 8 | "error-type": "protocol", 9 | "source-daemon": "ping" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/netconf/juniper_ping_wrong_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "ping-results": { 3 | "ping-failure": "usage error", 4 | "rpc-error": { 5 | "error-message": "invalid routing instance `edkwedlwewjdnw", 6 | "error-severity": "error", 7 | "error-tag": "operation-failed", 8 | "error-type": "protocol", 9 | "source-daemon": "ping" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/ssh/juniper_ping_no_route.txt: -------------------------------------------------------------------------------- 1 | PING 9.9.99.88 (9.9.99.88): 56 data bytes 2 | ping: sendto: No route to host 3 | 4 | --- 9.9.99.88 ping statistics --- 5 | 1 packets transmitted, 0 packets received, 100% packet loss 6 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/ssh/juniper_ping_no_src_ip.txt: -------------------------------------------------------------------------------- 1 | PING 1.1.1.1 (1.1.1.1): 56 data bytes 2 | ping: sendto: Can't assign requested address 3 | 4 | --- 1.1.1.1 ping statistics --- 5 | 1 packets transmitted, 0 packets received, 100% packet loss 6 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/ssh/juniper_ping_unreachable.txt: -------------------------------------------------------------------------------- 1 | PING 1.1.1.1 (1.1.1.1): 56 data bytes 2 | 3 | --- 1.1.1.1 ping statistics --- 4 | 1 packets transmitted, 0 packets received, 100% packet loss -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/ssh/juniper_ping_works.txt: -------------------------------------------------------------------------------- 1 | PING 100.123.1.0 (100.123.1.0): 56 data bytes 2 | 64 bytes from 100.123.1.0: icmp_seq=0 ttl=64 time=0.041 ms 3 | 4 | --- 100.123.1.0 ping statistics --- 5 | 1 packets transmitted, 1 packets received, 0% packet loss 6 | round-trip min/avg/max/stddev = 0.041/0.041/0.041/0.000 ms -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/ssh/juniper_ping_wrong_ip.txt: -------------------------------------------------------------------------------- 1 | ping: cannot resolve 1.23.232.2323: Host name lookup failure 2 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/juniper/ssh/juniper_ping_wrong_vrf.txt: -------------------------------------------------------------------------------- 1 | ping: invalid routing instance `deiodhiewuwedhw' 2 | -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/api/nxos_ping_no_route.json: -------------------------------------------------------------------------------- 1 | { "id": 1, 2 | "jsonrpc": "2.0", 3 | "result": { 4 | "msg": "PING 8.8.8.8 (8.8.8.8): 56 data bytes\nping: sendto 8.8.8.8 64 chars, No route to host\nRequest 0 timed out\n\n--- 8.8.8.8 ping statistics ---\n1 packets transmitted 0 packets received, 100.00% packet loss\n" 5 | } 6 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/api/nxos_ping_unreachable.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "jsonrpc": "2.0", 4 | "result": { 5 | "msg": "PING 3.3.3.3 (3.3.3.3): 56 data bytes\nRequest 0 timed out\n\n--- 3.3.3.3 ping statistics ---\n1 packets transmitted, 0 packets received, 100.00% packet loss\n" 6 | } 7 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/api/nxos_ping_works.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "jsonrpc": "2.0", 4 | "result": { 5 | "msg": "PING 10.98.98.1 (10.98.98.1): 56 data bytes\n64 bytes from 10.98.98.1: icmp_seq=0 ttl=255 time=0.279 ms\n\n--- 10.98.98.1 ping statistics ---\n1 packets transmitted, 1 packets received, 0.00% packet loss\nround-trip min/avg/max = 0.279/0.279/0.279 ms\n" 6 | } 7 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/api/nxos_ping_wrong_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "jsonrpc": "2.0", 4 | "result": { 5 | "msg": "PING 3.3.3.3 (3.3.3.3): 56 data bytes\nping: sendto 3.3.3.3 64 chars, No route to host\nRequest 0 timed out\n\n--- 3.3.3.3 ping statistics ---\n1 packets transmitted, 0 packets received, 100.00% packet loss\n" 6 | } 7 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/api/nxos_ping_wrong_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 1, 3 | "jsonrpc": "2.0", 4 | "result": { 5 | "msg": "ping: bad context blablabla\n" 6 | } 7 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/ssh/nxos_ping_no_route.txt: -------------------------------------------------------------------------------- 1 | PING 3.3.3.3 (3.3.3.3): 56 data bytes 2 | ping: sendto 3.3.3.3 64 chars, No route to host 3 | Request 0 timed out 4 | 5 | --- 3.3.3.3 ping statistics --- 6 | 1 packets transmitted, 0 packets received, 100.00% packet loss -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/ssh/nxos_ping_unreachable.txt: -------------------------------------------------------------------------------- 1 | PING 3.3.3.3 (3.3.3.3): 56 data bytes 2 | Request 0 timed out 3 | 4 | --- 3.3.3.3 ping statistics --- 5 | 1 packets transmitted, 0 packets received, 100.00% packet loss -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/ssh/nxos_ping_works.txt: -------------------------------------------------------------------------------- 1 | PING 10.99.99.1 (10.99.99.1): 56 data bytes 2 | 64 bytes from 10.99.99.1: icmp_seq=0 ttl=255 time=0.431 ms 3 | 4 | --- 10.99.99.1 ping statistics --- 5 | 1 packets transmitted, 1 packets received, 0.00% packet loss 6 | round-trip min/avg/max = 0.431/0.43/0.431 ms -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/ssh/nxos_ping_wrong_ip.txt: -------------------------------------------------------------------------------- 1 | % Invalid host/interface 333.1.1.1 -------------------------------------------------------------------------------- /tests/features/src/outputs/ping/nxos/ssh/nxos_ping_wrong_vrf.txt: -------------------------------------------------------------------------------- 1 | ping: bad context deiodjwoiejd -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/arista/api/arista_api_get_vrf_no_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "jsonrpc": "2.0", 3 | "id": "4453119648", 4 | "result": [ 5 | { 6 | "vrfs": { 7 | "default": { 8 | "routeDistinguisher": "", 9 | "vrfState": "up", 10 | "interfaces": [ 11 | "Management1" 12 | ], 13 | "protocols": { 14 | "ipv4": { 15 | "routingState": "down", 16 | "protocolState": "up", 17 | "supported": "True" 18 | }, 19 | "ipv6": { 20 | "routingState": "down", 21 | "protocolState": "up", 22 | "supported": "True" 23 | } 24 | } 25 | } 26 | } 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/arista/ssh/arista_cli_get_vrf_no_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": { 3 | "default": { 4 | "routeDistinguisher": "", 5 | "vrfState": "up", 6 | "interfaces": [ 7 | "Management1" 8 | ], 9 | "protocols": { 10 | "ipv4": { 11 | "routingState": "down", 12 | "protocolState": "up", 13 | "supported": true 14 | }, 15 | "ipv6": { 16 | "routingState": "down", 17 | "protocolState": "up", 18 | "supported": true 19 | } 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/arista/ssh/arista_cli_get_vrf_one_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "vrfs": { 3 | "default": { 4 | "routeDistinguisher": "", 5 | "vrfState": "up", 6 | "interfaces": [ 7 | "Management1" 8 | ], 9 | "protocols": { 10 | "ipv4": { 11 | "routingState": "down", 12 | "protocolState": "up", 13 | "supported": true 14 | }, 15 | "ipv6": { 16 | "routingState": "down", 17 | "protocolState": "up", 18 | "supported": true 19 | } 20 | } 21 | }, 22 | "CUSTOMER_NETESTS": { 23 | "routeDistinguisher": "65151:15", 24 | "vrfState": "up", 25 | "interfaces": [], 26 | "protocols": { 27 | "ipv4": { 28 | "routingState": "down", 29 | "protocolState": "up", 30 | "supported": true 31 | }, 32 | "ipv6": { 33 | "routingState": "down", 34 | "protocolState": "up", 35 | "supported": true 36 | } 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/cumulus/api/cumulus_http_show_vrf.txt: -------------------------------------------------------------------------------- 1 | VRF Table 2 | ---------------- ----- 3 | mgmt 1001 -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/cumulus/ssh/cumulus_net_show_vrf.txt: -------------------------------------------------------------------------------- 1 | VRF Table 2 | ---------------- ----- 3 | mgmt 1001 -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/ios/api/cisco_ios_api_get_vrf.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | MGMT_VRF 6 | MGMT 7 | 65000:999 8 | 9 | 10 | 65000:99 11 | 12 | 13 | 65000:99 14 | 15 | 16 | 17 | 18 | SECURE_ZONE 19 | DESCR_TEST 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/ios/netconf/cisco_ios_nc_get_vrf.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | MGMT_VRF 8 | MGMT 9 | 65000:999 10 | 11 | 12 | 65000:99 13 | 14 | 15 | 65000:99 16 | 17 | 18 | 19 | 20 | SECURE_ZONE 21 | DESCR_TEST 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/ios/ssh/cisco_ios_show_ip_vrf_detail.txt: -------------------------------------------------------------------------------- 1 | VRF MGMT_VRF (VRF Id = 1); default RD 65000:999; default VPNID 2 | Description: VRF_FOR_DEVICE_MANAGEMENT 3 | New CLI format, supports multiple address-families 4 | Flags: 0x180C 5 | Interfaces: 6 | Gi0/0 7 | Address family ipv4 unicast (Table ID = 0x1): 8 | Flags: 0x0 9 | Export VPN route-target communities:RT:65100:9 10 | Import VPN route-target communities:RT:65100:9 11 | No import route-map 12 | No global export route-map 13 | No export route-map 14 | VRF label distribution protocol: not configured 15 | VRF label allocation mode: per-prefix 16 | Address family ipv6 unicast not active 17 | Address family ipv4 multicast not active 18 | 19 | VRF SECURE_ZONE (VRF Id = 2); default RD ; default VPNID 20 | New CLI format, supports multiple address-families 21 | Flags: 0x1808 22 | No interfaces 23 | Address family ipv4 unicast (Table ID = 0x2): 24 | Flags: 0x0 25 | No Export VPN route-target communities 26 | No Import VPN route-target communities 27 | No import route-map 28 | No global export route-map 29 | No export route-map 30 | VRF label distribution protocol: not configured 31 | VRF label allocation mode: per-prefix 32 | Address family ipv6 unicast not active 33 | Address family ipv4 multicast not active -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/ios/ssh/cisco_ios_ssh_get_vrf_many.txt: -------------------------------------------------------------------------------- 1 | VRF CUSTOMER_001 (VRF Id = 1); default RD 65123:123; default VPNID 2 | New CLI format, supports multiple address-families 3 | Flags: 0x180C 4 | No interfaces 5 | Address family ipv4 unicast not active 6 | Address family ipv6 unicast not active 7 | Address family ipv4 multicast not active 8 | Address family ipv6 multicast not active 9 | 10 | VRF CUSTOMER_002 (VRF Id = 2); default RD 65432:432; default VPNID 11 | New CLI format, supports multiple address-families 12 | Flags: 0x180C 13 | No interfaces 14 | Address family ipv4 unicast (Table ID = 0x2): 15 | Flags: 0x0 16 | Export VPN route-target communities 17 | RT:65222:1 18 | Import VPN route-target communities 19 | RT:65222:2 20 | No import route-map 21 | No global export route-map 22 | No export route-map 23 | VRF label distribution protocol: not configured 24 | VRF label allocation mode: per-prefix 25 | Address family ipv6 unicast not active 26 | Address family ipv4 multicast not active 27 | Address family ipv6 multicast not active -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/ios/ssh/cisco_ios_ssh_get_vrf_no_config.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/ios/ssh/cisco_ios_ssh_get_vrf_only_one.txt: -------------------------------------------------------------------------------- 1 | VRF CUSTOMER_001 (VRF Id = 1); default RD 65123:123; default VPNID 2 | New CLI format, supports multiple address-families 3 | Flags: 0x180C 4 | No interfaces 5 | Address family ipv4 unicast not active 6 | Address family ipv6 unicast not active 7 | Address family ipv4 multicast not active 8 | Address family ipv6 multicast not active -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/netconf/cisco_iosxr_nc_get_bgp.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | default 7 | 8 | 0 9 | 10 | 65000 11 | 12 | 13 | 14 | EXTERNAL_PEERING 15 | 16 | 17 | 18 | as 19 | 0 20 | 65000 21 | 100 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/netconf/cisco_iosxr_nc_get_bgp_no_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/netconf/cisco_iosxr_nc_get_bgp_one_vrf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/netconf/cisco_iosxr_nc_get_vrf_no_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/netconf/cisco_iosxr_nc_get_vrf_one_vrf.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | CUSTOMER_NETESTS 7 | 8 | 9 | 10 | ipv4 11 | unicast 12 | default 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/ssh/cisco_iosxr_show_vrf_all_detail.txt: -------------------------------------------------------------------------------- 1 | Tue Apr 7 14:02:13.173 UTC 2 | 3 | VRF EXTERNAL_PEERING; RD 65000:100; VPN ID not set 4 | VRF mode: Regular 5 | Description not set 6 | Address family IPV4 Unicast 7 | Import VPN route-target communities: 8 | RT:65000:1 9 | Export VPN route-target communities: 10 | RT:65000:1 11 | No import route policy 12 | No export route policy 13 | Address family IPV6 Unicast 14 | No import VPN route-target communities 15 | No export VPN route-target communities 16 | No import route policy 17 | No export route policy 18 | 19 | VRF MGMT_VRF; RD not set; VPN ID not set 20 | VRF mode: Regular 21 | Description MANAGEMENT_VRF 22 | Interfaces: 23 | MgmtEth0/0/CPU0/0 24 | Address family IPV4 Unicast 25 | No import VPN route-target communities 26 | No export VPN route-target communities 27 | No import route policy 28 | No export route policy 29 | Address family IPV6 Unicast 30 | No import VPN route-target communities 31 | No export VPN route-target communities 32 | No import route policy 33 | No export route policy -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/ssh/cisco_iosxr_show_vrf_all_detail_no_config.txt: -------------------------------------------------------------------------------- 1 | 2 | Sat May 2 18:19:50.114 UTC -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/iosxr/ssh/cisco_iosxr_show_vrf_all_detail_one_vrf.txt: -------------------------------------------------------------------------------- 1 | 2 | Sat May 2 16:41:31.870 UTC 3 | 4 | VRF CUSTOMER_NETESTS; RD not set; VPN ID not set 5 | VRF mode: Regular 6 | Description not set 7 | Address family IPV4 Unicast 8 | No import VPN route-target communities 9 | No export VPN route-target communities 10 | No import route policy 11 | No export route policy 12 | Address family IPV6 Unicast 13 | No import VPN route-target communities 14 | No export VPN route-target communities 15 | No import route policy 16 | No export route policy -------------------------------------------------------------------------------- /tests/features/src/outputs/vrf/napalm/napalm_get_vrf.json: -------------------------------------------------------------------------------- 1 | { 2 | "get_network_instances": { 3 | "MGMT_VRF": { 4 | "interfaces": { 5 | "interface": { 6 | "Gi0/0": {} 7 | } 8 | }, 9 | "name": "MGMT_VRF", 10 | "state": { 11 | "route_distinguisher": "65000: 999" 12 | }, 13 | "type": "L3VRF" 14 | }, 15 | "default": { 16 | "interfaces": { 17 | "interface": { 18 | "GigabitEthernet0/0": {}, 19 | "GigabitEthernet0/1": {}, 20 | "GigabitEthernet0/2": {}, 21 | "GigabitEthernet0/3": {}, 22 | "GigabitEthernet0/4": {}, 23 | "GigabitEthernet0/5": {}, 24 | "GigabitEthernet0/6": {}, 25 | "GigabitEthernet0/7": {} 26 | } 27 | }, 28 | "name": "default", 29 | "state": { 30 | "route_distinguisher": "" 31 | }, 32 | "type": "DEFAULT_INSTANCE" 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /tests/features/src/static_tests.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | 4 | 5 | # ---------------------------------------------------------------------------------------------------------------------- 6 | leaf03: 7 | default: 8 | - prefix: 10.255.255.202/32 9 | nexthop: 10 | - ip_address: 10.22.33.1 11 | 12 | - prefix: 10.255.255.101/32 13 | nexthop: 14 | - ip_address: 10.1.3.1 15 | 16 | mgmt: 17 | - prefix: 0.0.0.0/0 18 | nexthop: 19 | - ip_address: 10.0.5.1 20 | 21 | 22 | # ---------------------------------------------------------------------------------------------------------------------- 23 | leaf04: 24 | default: 25 | - prefix: 111.111.111.111/32 26 | nexthop: 27 | - ip_address: 10.1.4.1 28 | - ip_address: 10.3.4.1 29 | - prefix: 10.255.255.103/32 30 | nexthop: 31 | - ip_address: 10.3.4.1 32 | mgmt_junos: 33 | - prefix: 0.0.0.0/0 34 | nexthop: 35 | - ip_address: 10.0.5.1 -------------------------------------------------------------------------------- /tests/features/src/vlan_tests.yml: -------------------------------------------------------------------------------- 1 | --- 2 | leaf01: 3 | - id: 999 4 | ipv4_addresses: 5 | - ip_address: 192.168.1.1 6 | netmask: 24 7 | - ip_address: 192.168.1.1 8 | netmask: 24 -------------------------------------------------------------------------------- /tests/features/src/vrf_tests.yml: -------------------------------------------------------------------------------- 1 | --- 2 | leaf01: 3 | # Cumulus Networks 4 | - vrf_name: default 5 | vrf_id: 1000 6 | - vrf_name: mgmt 7 | vrf_id: 1001 8 | 9 | leaf02: 10 | # Cisco Nexus NXOS 11 | - vrf_name: management 12 | - vrf_name: default 13 | - vrf_name: CUSTOMER_001 14 | l3_vni: 1000 15 | - vrf_name: INTERNAL_PEERING 16 | rd: 65432:222 17 | rt_exp: 65432:22 18 | rt_imp: 65432:22 19 | 20 | leaf03: 21 | - vrf_name: default 22 | - vrf_name: CUSTOMER_NETESTS 23 | rd: 65151:15 24 | - vrf_name: CUSTOMER_WEJOB 25 | rd: 1111:11 26 | 27 | leaf04: 28 | # Juniper VMX / Junos 29 | - vrf_name: default 30 | - vrf_name: mgmt_junos 31 | - vrf_name: CUSTOMER_001 32 | 33 | leaf05: 34 | # Cisco IOS 35 | - vrf_name: default 36 | - vrf_name: MGMT_VRF 37 | - vrf_name: SECURE_ZONE 38 | 39 | spine02: 40 | # Extreme Networks VSP 41 | - vrf_name: GlobalRouter 42 | - vrf_name: mgmt_vrf 43 | - vrf_name: MgmtRouter 44 | 45 | spine03: 46 | # Cisco IOS-XR 47 | - vrf_name: default 48 | - vrf_name: MGMT_VRF 49 | - vrf_name: EXTERNAL_PEERING -------------------------------------------------------------------------------- /tests/features/validate_netests_inventory.feature: -------------------------------------------------------------------------------- 1 | Feature: Test Python class netests/tools/verify/ValidateNetestsInventory 2 | Scenario: 3 | Given A Nornir object based on an Ansible inventory 4 | Then This inventory is working 5 | 6 | Scenario: 7 | Given A Nornir object based on an Ansible with a connexion error 8 | Then This inventory is not working 9 | 10 | Scenario: 11 | Given A Nornir object based on an Ansible with a platform error 12 | Then This inventory is not working 13 | 14 | Scenario: 15 | Given A Nornir object based on an Ansible with a seucre_api error 16 | Then This inventory is not working 17 | 18 | Scenario: 19 | Given A Nornir object based on an Ansible with a port error 20 | Then This inventory is not working 21 | 22 | Scenario: 23 | Given A Nornir object based on an Ansible with a connexion platform error 24 | Then This inventory is not working 25 | -------------------------------------------------------------------------------- /tests/inventory/ansible/group_vars/all.yml: -------------------------------------------------------------------------------- 1 | data: 2 | vrfs: 3 | - name: management 4 | bgp: True 5 | ospf: True -------------------------------------------------------------------------------- /tests/inventory/ansible/group_vars/leaf.yml: -------------------------------------------------------------------------------- 1 | port: 443 -------------------------------------------------------------------------------- /tests/inventory/ansible/group_vars/spine.yml: -------------------------------------------------------------------------------- 1 | port: 22 -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/leaf01.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.2 2 | username: cumulus 3 | password: CumulusLinux! 4 | platform: linux 5 | connexion: ssh 6 | port: 22 -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/leaf02.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.8 2 | username: admin 3 | password: Ci$co123 4 | platform: nxos 5 | port: 8443 6 | connexion: api 7 | 8 | routing: 9 | static: 10 | ipv4: 11 | default: 12 | - subnet: 1.1.1.1/32 13 | via: 14 | - ip: 255.255.255.1 15 | - ip: 255.255.255.2 16 | 17 | - subnet: 10.255.255.201 18 | mask: 32 19 | via: 20 | - ip: 10.1.1.2 21 | 22 | - subnet: 10.255.255.202/32 23 | via: 24 | - ip: 10.1.2.2 25 | - ip: 10.1.3.2 26 | 27 | - subnet: 10.255.255.203/32 28 | via: 29 | - ip: 10.1.3.2 30 | 31 | mgmt: 32 | - subnet: 0.0.0.0/0 33 | via: 34 | - ip: 10.0.5.1 -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/leaf03.yml: -------------------------------------------------------------------------------- 1 | # ARISTA DEVICE DOES NOT SHOW STATIC ROUTES THAT ARE NOT IN THE FIB !!!!!!!!!!!!! 2 | 3 | hostname: 172.16.194.6 4 | username: admain 5 | password: arista 6 | platform: eos 7 | connexion: napalm 8 | port: 22 9 | 10 | routing: 11 | static: 12 | ipv4: 13 | default: 14 | - subnet: 1.1.1.1/32 15 | via: 16 | - ip: 255.255.255.1 17 | - ip: 255.255.255.2 18 | 19 | - subnet: 10.255.255.201 20 | mask: 32 21 | via: 22 | - ip: 10.1.1.2 23 | 24 | - subnet: 10.255.255.202/32 25 | via: 26 | - ip: 10.1.2.2 27 | - ip: 10.1.3.2 28 | 29 | - subnet: 10.255.255.203/32 30 | via: 31 | - ip: 10.1.3.2 32 | 33 | mgmt: 34 | - subnet: 0.0.0.0/0 35 | via: 36 | - ip: 10.0.5.1 -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/leaf04.yml: -------------------------------------------------------------------------------- 1 | hostname: 66.129.235.11 2 | username: jcluser 3 | password: Juniper!1 4 | platform: junos 5 | port: 31000 6 | connexion: netconf 7 | secure_api: false -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/leaf05.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.9 2 | username: admin 3 | password: cisco 4 | platform: ios 5 | port: 22 6 | connexion: napalm -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/spine01.yml: -------------------------------------------------------------------------------- 1 | hostname: 10.0.5.101 2 | username: cumulus 3 | password: CumulusLinux! 4 | platform: linux 5 | 6 | 7 | routing: 8 | static: 9 | ipv4: 10 | default: 11 | - subnet: 1.1.1.1/32 12 | via: 13 | - ip: 255.255.255.1 14 | - ip: 255.255.255.2 15 | 16 | - subnet: 10.255.255.201 17 | mask: 32 18 | via: 19 | - ip: 10.1.1.2 20 | 21 | - subnet: 10.255.255.202/32 22 | via: 23 | - ip: 10.1.2.2 24 | - ip: 10.1.3.2 25 | 26 | - subnet: 10.255.255.203/32 27 | via: 28 | - ip: 10.1.3.2 29 | 30 | mgmt: 31 | - subnet: 0.0.0.0/0 32 | via: 33 | - ip: 10.0.5.1 -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/spine02.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.7 2 | username: rwa 3 | password: rwa 4 | platform: extreme_vsp 5 | connexion: ssh 6 | port: 22 -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/spine03.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.10 2 | username: dhadmin 3 | password: Cisco12345-- 4 | platform: iosxr 5 | port: 22 6 | connexion: napalm -------------------------------------------------------------------------------- /tests/inventory/ansible/host_vars/spine04.yml: -------------------------------------------------------------------------------- 1 | hostname: 10.0.5.104 2 | username: admin 3 | password: admin 4 | platform: iosxr 5 | port: 22 6 | connextion: ssh -------------------------------------------------------------------------------- /tests/inventory/ansible/hosts: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf01 3 | leaf02 4 | #leaf03 5 | #leaf04 6 | #leaf05 7 | 8 | [spine] 9 | #spine01 10 | #spine02 11 | #spine03 -------------------------------------------------------------------------------- /tests/inventory/ansible/hosts_virtual: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf01 ansible_host=192.168.254.10 ansible_port=22201 3 | leaf02 ansible_host=192.168.254.10 ansible_port=22202 4 | leaf03 ansible_host=192.168.254.10 ansible_port=22203 5 | 6 | [spine] 7 | spine01 ansible_host=192.168.254.10 ansible_port=22101 8 | spine02 ansible_host=192.168.254.10 ansible_port=22102 9 | -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/leaf01.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.2 2 | username: cumulus 3 | password: CumulusLinux! 4 | platform: linux 5 | connexion: restconf 6 | port: 22 -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/leaf02.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.8 2 | username: admin 3 | password: Ci$co123 4 | platform: netests_os 5 | port: 8443 6 | connexion: api 7 | 8 | routing: 9 | static: 10 | ipv4: 11 | default: 12 | - subnet: 1.1.1.1/32 13 | via: 14 | - ip: 255.255.255.1 15 | - ip: 255.255.255.2 16 | 17 | - subnet: 10.255.255.201 18 | mask: 32 19 | via: 20 | - ip: 10.1.1.2 21 | 22 | - subnet: 10.255.255.202/32 23 | via: 24 | - ip: 10.1.2.2 25 | - ip: 10.1.3.2 26 | 27 | - subnet: 10.255.255.203/32 28 | via: 29 | - ip: 10.1.3.2 30 | 31 | mgmt: 32 | - subnet: 0.0.0.0/0 33 | via: 34 | - ip: 10.0.5.1 -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/leaf03.yml: -------------------------------------------------------------------------------- 1 | # ARISTA DEVICE DOES NOT SHOW STATIC ROUTES THAT ARE NOT IN THE FIB !!!!!!!!!!!!! 2 | 3 | hostname: 172.16.194.6 4 | username: admain 5 | password: arista 6 | platform: eos 7 | connexion: api 8 | port: 443 9 | secure_api: https 10 | 11 | routing: 12 | static: 13 | ipv4: 14 | default: 15 | - subnet: 1.1.1.1/32 16 | via: 17 | - ip: 255.255.255.1 18 | - ip: 255.255.255.2 19 | 20 | - subnet: 10.255.255.201 21 | mask: 32 22 | via: 23 | - ip: 10.1.1.2 24 | 25 | - subnet: 10.255.255.202/32 26 | via: 27 | - ip: 10.1.2.2 28 | - ip: 10.1.3.2 29 | 30 | - subnet: 10.255.255.203/32 31 | via: 32 | - ip: 10.1.3.2 33 | 34 | mgmt: 35 | - subnet: 0.0.0.0/0 36 | via: 37 | - ip: 10.0.5.1 -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/leaf04.yml: -------------------------------------------------------------------------------- 1 | hostname: 66.129.235.11 2 | username: jcluser 3 | password: Juniper!1 4 | platform: junos 5 | port: 3100033 6 | connexion: netconf 7 | secure_api: false -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/leaf05.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.9 2 | username: admin 3 | password: cisco 4 | platform: ios 5 | port: 22 6 | connexion: napalm -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/spine01.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.61 2 | platform: linux 3 | username: cumulus 4 | password: CumulusLinux! 5 | connexion: netconf 6 | port: 830 -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/spine02.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.7 2 | username: rwa 3 | password: rwa 4 | platform: extreme_vsp 5 | connexion: ssh 6 | port: 22 -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/spine03.yml: -------------------------------------------------------------------------------- 1 | hostname: 172.16.194.10 2 | username: dhadmin 3 | password: Cisco12345-- 4 | platform: iosxr 5 | port: 22 6 | connexion: napalm -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/host_vars/spine04.yml: -------------------------------------------------------------------------------- 1 | hostname: 10.0.5.104 2 | username: admin 3 | password: admin 4 | platform: iosxr 5 | port: 22 6 | connextion: ssh -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/hosts: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf01 3 | leaf02 4 | leaf03 5 | leaf04 6 | leaf05 7 | 8 | [spine] 9 | spine01 10 | spine02 11 | spine03 -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/hosts_bad_connexion: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf01 3 | -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/hosts_bad_connexion_platform: -------------------------------------------------------------------------------- 1 | [spine] 2 | spine01 3 | -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/hosts_bad_platform: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf02 3 | -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/hosts_bad_port: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf04 3 | -------------------------------------------------------------------------------- /tests/inventory/bad/ansible/hosts_bad_secure_api: -------------------------------------------------------------------------------- 1 | [leaf] 2 | leaf03 3 | -------------------------------------------------------------------------------- /tests/inventory/netbox/netbox.yml: -------------------------------------------------------------------------------- 1 | emptyfile -------------------------------------------------------------------------------- /tests/inventory/nornir/std/defaults.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /tests/inventory/nornir/std/groups.yml: -------------------------------------------------------------------------------- 1 | global: 2 | data: 3 | syslog: 10.0.5.254 4 | 5 | spine: 6 | data: 7 | asn: 65001 8 | 9 | leaf: 10 | data: 11 | vlans: 12 | - 1000 -------------------------------------------------------------------------------- /tests/inventory/nornir/std/hosts.yml: -------------------------------------------------------------------------------- 1 | # ################################################ 2 | # 3 | # ROUTER 4 | # 5 | 6 | 7 | # ################################################ 8 | # 9 | # SPINE 10 | # 11 | 12 | # ################################################ 13 | # 14 | # EXIT 15 | # 16 | 17 | # ################################################ 18 | # 19 | # LEAF 20 | # 21 | 22 | spine03: 23 | hostname: 10.0.5.203 24 | username: admin 25 | password: admin123 26 | port: 22 27 | platform: iosxr 28 | groups: 29 | - global 30 | data: 31 | connexion: netconf 32 | vrfs: 33 | - name: mgmt 34 | bgp: True 35 | ospf: True -------------------------------------------------------------------------------- /tests/inventory/nornir/virt/defaults.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /tests/inventory/nornir/virt/groups.yml: -------------------------------------------------------------------------------- 1 | global: 2 | data: 3 | syslog: 10.0.5.254 4 | 5 | spine: 6 | data: 7 | asn: 65001 8 | 9 | leaf: 10 | data: 11 | vlans: 12 | - 1000 -------------------------------------------------------------------------------- /tests/run_behave.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "------------------------------------------" 4 | echo ">>> Start Behave tests ..." 5 | echo "------------------------------------------" 6 | 7 | declare -i return_value=0 8 | declare -a commands_lst=( 9 | 'behave tests/features/ --no-capture' 10 | ) 11 | 12 | for command in "${commands_lst[@]}" 13 | do 14 | $command 15 | if [ $? -ne 0 ]; then 16 | return_value=1 17 | fi 18 | done 19 | 20 | exit $return_value -------------------------------------------------------------------------------- /tests/run_syntax.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "------------------------------------------" 4 | echo ">>> Start Syntax tests ..." 5 | echo "------------------------------------------" 6 | 7 | declare -i return_value=0 8 | declare -a commands_lst=( 9 | 'pylama netests/' 10 | ) 11 | 12 | for command in "${commands_lst[@]}" 13 | do 14 | echo "$command" 15 | $command 16 | if [ $? -ne 0 ]; then 17 | echo -e "\e[101 WARNING - Command has failed !!! Fix before commit and push !! \e[49m" 18 | echo -e "****************************************************************************" 19 | return_value=1 20 | fi 21 | done 22 | 23 | exit $return_value -------------------------------------------------------------------------------- /tests/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | declare -i return_value=0 4 | declare -a commands_lst=( 5 | 'sh tests/run_behave.sh' 6 | 'sh tests/run_syntax.sh' 7 | ) 8 | 9 | for command in "${commands_lst[@]}" 10 | do 11 | $command 12 | if [ $? -ne 0 ]; then 13 | return_value=1 14 | fi 15 | done 16 | 17 | echo "------------------------------------------" 18 | echo ">>> Tests finished result is ... [$return_value]" 19 | echo "[0] = Success!" 20 | echo "[X] = Failed!" 21 | echo "------------------------------------------" 22 | 23 | exit $return_value 24 | --------------------------------------------------------------------------------