├── .github ├── ISSUE_TEMPLATE └── PULL_REQUEST_TEMPLATE ├── .gitignore ├── .travis.yml ├── AUTHORS ├── LICENSE ├── MANIFEST.in ├── README.md ├── napalm_iosxr ├── __init__.py ├── constants.py ├── iosxr.py └── templates │ ├── delete_ntp_peers.j2 │ ├── delete_ntp_servers.j2 │ ├── delete_probes.j2 │ ├── delete_snmp_config.j2 │ ├── delete_users.j2 │ ├── schedule_probes.j2 │ ├── set_hostname.j2 │ ├── set_ntp_peers.j2 │ ├── set_ntp_servers.j2 │ ├── set_probes.j2 │ ├── set_users.j2 │ └── snmp_config.j2 ├── requirements-dev.txt ├── requirements.txt ├── setup.cfg ├── setup.py ├── test ├── __init__.py └── unit │ ├── TestIOSXRDriver.py │ ├── __init__.py │ ├── conftest.py │ ├── iosxr │ ├── initial.conf │ ├── merge_good.conf │ ├── merge_good.diff │ ├── merge_typo.conf │ ├── mock_data │ │ ├── _CLI__Configuration_showconfigurationmerge__Configuration___CLI_.rpc │ │ ├── _CLI__Configuration_showrunning-config__Configuration___CLI_.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_0__slot___Naming___Slot.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_1__slot___Naming___Slot.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_FT0__slot___Naming___Sl.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_FT1__slot___Naming___Sl.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_PM0__slot___Naming___Sl.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_RSP0__slot___Naming___S.rpc │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming__rack_0__rack___Naming__SlotTable__Slot__Naming__slot_RSP1__slot___Naming___S.rpc │ │ ├── _Get__AdminOperational__MemorySummary___MemorySummary___AdminOperational___Get_.rpc │ │ ├── _Get__AdminOperational__PlatformInventory__RackTable__Rack__Naming__Name_0__Name___Naming__SlotTable___SlotTable___Rack___RackTable___PlatformInventor.rpc │ │ ├── _Get__Configuration__AAA___AAA___Configuration___Get_.rpc │ │ ├── _Get__Configuration__BGP__Instance__Naming__InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.rpc │ │ ├── _Get__Configuration__IPSLA___IPSLA___Configuration___Get_.rpc │ │ ├── _Get__Configuration__NTP___NTP___Configuration___Get_.rpc │ │ ├── _Get__Configuration__SNMP___SNMP___Configuration___Get_.rpc │ │ ├── _Get__Operational__ARP___ARP___Operational___Get_.rpc │ │ ├── _Get__Operational__BGP__Active__DefaultVRF__AFTable__AF__Naming__AFName_IPv4Unicast__AFName___Naming__PathTable__Path__Naming__Network__IPV4Address_1..rpc │ │ ├── _Get__Operational__BGP__ConfigInstanceTable__ConfigInstance__Naming__InstanceName_default__InstanceName___Naming__ConfigInstanceVRFTable___ConfigInsta.rpc │ │ ├── _Get__Operational__BGP__ConfigInstanceTable__ConfigInstance__Naming__InstanceName_default__InstanceName___Naming__ConfigInstanceVRFTable____ConfigInst.rpc │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__InstanceName_default__InstanceName___Naming__InstanceActive__DefaultVRF__GlobalProcessInfo___.rpc │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__InstanceName_default__InstanceName___Naming__InstanceActive__VRFTable__VRF__Naming_default__N.rpc │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__InstanceName_default__InstanceName___Naming__InstanceActive__VRFTable__VRF__Naming_test2__Nam.rpc │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__InstanceName_default__InstanceName___Naming__InstanceActive__VRFTable__VRF__Naming_test__Nami.rpc │ │ ├── _Get__Operational__IPSLA___IPSLA___Operational___Get_.rpc │ │ ├── _Get__Operational__IPV4Network___IPV4Network__IPV6Network___IPV6Network___Operational___Get_.rpc │ │ ├── _Get__Operational__Interfaces__InterfaceTable___InterfaceTable___Interfaces___Operational___Get_.rpc │ │ ├── _Get__Operational__Interfaces____Operational___Get_.rpc │ │ ├── _Get__Operational__L2VPNForwarding___L2VPNForwarding___Operational___Get_.rpc │ │ ├── _Get__Operational__LLDP___LLDP___Operational___Get_.rpc │ │ ├── _Get__Operational__NTP__NodeTable___NodeTable___NTP___Operational___Get_.rpc │ │ ├── _Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default__VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTable__SAF__Na.rpc │ │ ├── _Get__Operational__SystemMonitoring___SystemMonitoring___Operational___Get_.rpc │ │ ├── _Get__Operational__SystemTime___PlatformInventory____Operational___Get_.rpc │ │ ├── _Set__Action__TraceRoute__IPV4__Destination_8.8.8.8__Destination___IPV4___TraceRoute___Action___Set_.rpc │ │ ├── show_interface_description.txt │ │ ├── show_interfaces.txt │ │ ├── show_lldp_neighbors.txt │ │ └── show_version.txt │ ├── new_good.conf │ ├── new_good.diff │ └── new_typo.conf │ ├── mocked_data │ ├── test_get_arp_table │ │ └── normal │ │ │ ├── _Get__Operational__ARP___ARP___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_bgp_config │ │ ├── mixed_with_without_groups │ │ │ ├── _Get__Configuration__BGP__Instance__Naming__________InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.txt │ │ │ └── expected_result.json │ │ ├── normal │ │ │ ├── _Get__Configuration__BGP__Instance__Naming__________InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.txt │ │ │ └── expected_result.json │ │ └── peers_without_groups │ │ │ ├── _Get__Configuration__BGP__Instance__Naming__________InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_bgp_neighbors │ │ └── normal │ │ │ ├── _Get__Operational__BGP__ConfigInstanceTable__ConfigInstance__Naming__________InstanceName_default__InstanceName___Naming__ConfigInstanceVRFTable______.txt │ │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__________________InstanceName_default__InstanceName___Naming__InstanceActive__DefaultVRF______.txt │ │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__________________InstanceName_default__InstanceName___Naming__InstanceActive__VRFTable__VRF___.txt │ │ │ └── expected_result.json │ ├── test_get_bgp_neighbors_detail │ │ └── normal │ │ │ ├── _Get__Operational__BGP__ConfigInstanceTable__ConfigInstance__________Naming__InstanceName_default__InstanceName___Naming__ConfigInstanceVRFTable______.txt │ │ │ ├── _Get__Operational__BGP__InstanceTable__Instance__Naming__________InstanceName_default__InstanceName___Naming__InstanceActive__VRFTable__VRF__Naming_de.txt │ │ │ └── expected_result.json │ ├── test_get_config │ │ └── normal │ │ │ ├── _CLI__Configuration_show_configuration_merge__Configuration___CLI_.txt │ │ │ ├── _CLI__Configuration_show_running_config__Configuration___CLI_.txt │ │ │ └── expected_result.json │ ├── test_get_config_filtered │ │ └── normal │ │ │ ├── _CLI__Configuration_show_configuration_merge__Configuration___CLI_.txt │ │ │ ├── _CLI__Configuration_show_running_config__Configuration___CLI_.txt │ │ │ └── expected_result.json │ ├── test_get_environment │ │ └── normal │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_0__slot___N.txt │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_1__slot___N.txt │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_FT0__slot__.txt │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_FT1__slot__.txt │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_PM0__slot__.txt │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_RSP0__slot_.txt │ │ │ ├── _Get__AdminOperational__EnvironmentalMonitoring__RackTable__Rack__Naming______________rack_0__rack___Naming__SlotTable__Slot__Naming__slot_RSP1__slot_.txt │ │ │ ├── _Get__AdminOperational__MemorySummary_______________MemorySummary___AdminOperational___Get_.txt │ │ │ ├── _Get__AdminOperational__PlatformInventory__RackTable__Rack__Naming__________Name_0__Name___Naming__SlotTable___SlotTable___Rack___RackTable___Platform.txt │ │ │ ├── _Get__Operational__Interfaces____Operational___Get_.txt │ │ │ ├── _Get__Operational__SystemMonitoring___SystemMonitoring___Operational___Get_.txt │ │ │ ├── _Get__Operational__SystemTime___PlatformInventory____________Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_facts │ │ └── normal │ │ │ ├── _Get__Operational__Interfaces____Operational___Get_.txt │ │ │ ├── _Get__Operational__SystemTime___PlatformInventory____________Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_firewall_policies │ │ └── normal │ │ │ └── expected_result.json │ ├── test_get_interfaces │ │ └── normal │ │ │ ├── _Get__Operational__Interfaces____Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_interfaces_counters │ │ └── normal │ │ │ ├── _Get__Operational__Interfaces__InterfaceTable___InterfaceTable___________Interfaces___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_interfaces_ip │ │ └── normal │ │ │ ├── _Get__Operational__IPV4Network___IPV4Network__________IPV6Network___IPV6Network___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_lldp_neighbors │ │ └── normal │ │ │ ├── expected_result.json │ │ │ └── show_lldp_neighbors.txt │ ├── test_get_lldp_neighbors_detail │ │ └── normal │ │ │ ├── _Get__Operational__LLDP___LLDP___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_mac_address_table │ │ └── normal │ │ │ ├── _Get__Operational__L2VPNForwarding___L2VPNForwarding___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_network_instances │ │ └── normal │ │ │ └── expected_result.json │ ├── test_get_ntp_peers │ │ └── normal │ │ │ ├── _Get__Configuration__NTP___NTP___Configuration___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_ntp_servers │ │ └── normal │ │ │ ├── _Get__Configuration__NTP___NTP___Configuration___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_ntp_stats │ │ └── normal │ │ │ ├── _Get__Operational__NTP__NodeTable___NodeTable___NTP___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_optics │ │ └── normal │ │ │ └── expected_result.json │ ├── test_get_probes_config │ │ └── normal │ │ │ ├── _Get__Configuration__IPSLA___IPSLA___Configuration___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_probes_results │ │ └── normal │ │ │ ├── _Get__Configuration__IPSLA___IPSLA___Configuration___Get_.txt │ │ │ ├── _Get__Operational__IPSLA___IPSLA___Operational___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_route_to │ │ └── SR638170159 │ │ │ ├── _Get__Operational__BGP__Active__DefaultVRF__AFTable__________________AF__Naming__AFName_IPv4Unicast__AFName___Naming__PathTable__Path__Naming__Network.txt │ │ │ ├── _Get__Operational__IPV6_RIB__VRFTable__VRF__Naming__VRFName_default______________VRFName___Naming__AFTable__AF__Naming__AFName_IPv6__AFName___Naming__SAFTa.txt │ │ │ ├── _Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default______________VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTa.txt │ │ │ └── expected_result.json │ ├── test_get_snmp_information │ │ └── normal │ │ │ ├── _Get__Configuration__SNMP___SNMP___Configuration___Get_.txt │ │ │ └── expected_result.json │ ├── test_get_users │ │ └── normal │ │ │ ├── _Get__Configuration__AAA___AAA___Configuration___Get_.txt │ │ │ └── expected_result.json │ ├── test_is_alive │ │ └── normal │ │ │ └── expected_result.json │ ├── test_ping │ │ └── normal │ │ │ └── expected_result.json │ └── test_traceroute │ │ └── normal │ │ ├── _Set__Action__TraceRoute__IPV4__Destination_8_8_8_8__________Destination__MaxTTL_255__MaxTTL__Timeout_2__Timeout___IPV4___TraceRoute___Action_________.txt │ │ ├── _Set__Action__TraceRoute__IPV4__Destination_8_8_8_8__________Destination___IPV4___TraceRoute___Action___________Set_.txt │ │ └── expected_result.json │ └── test_getters.py └── tox.ini /.github/ISSUE_TEMPLATE: -------------------------------------------------------------------------------- 1 | ### The NAPALM Project has reunified! 2 | 3 | Please submit all NAPALM issues to: 4 | https://github.com/napalm-automation/napalm/issues 5 | 6 | 7 | ### DO NOT submit any issues to this repository. 8 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | ### The NAPALM Project has reunified! 2 | 3 | Please submit all NAPALM pull requests to: 4 | https://github.com/napalm-automation/napalm/pulls 5 | 6 | 7 | ### DO NOT submit any pull requests to this repository. 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # Installer logs 26 | pip-log.txt 27 | pip-delete-this-directory.txt 28 | 29 | # Unit test / coverage reports 30 | htmlcov/ 31 | .tox/ 32 | .coverage 33 | .cache 34 | nosetests.xml 35 | coverage.xml 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mr Developer 41 | .mr.developer.cfg 42 | .project 43 | .pydevproject 44 | 45 | # Rope 46 | .ropeproject 47 | 48 | # Django stuff: 49 | *.log 50 | *.pot 51 | 52 | # Sphinx documentation 53 | docs/_build/ 54 | 55 | .idea 56 | .DS_Store 57 | 58 | env 59 | *.swp 60 | 61 | test/unit/test_devices.py 62 | report.json 63 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 2.7 4 | - 3.4 5 | - 3.5 6 | install: 7 | - pip install tox-travis 8 | - pip install coveralls 9 | 10 | deploy: 11 | provider: pypi 12 | user: dbarroso 13 | password: 14 | secure: ozv9Lic7tX6Qm0R2zlUGtn/jgydKhOt3GEBnVD+x2CbtNfTsI2WPwkRABa8kcuuZvZYUVePYVnsB1qZ1UO2US8Bly80eaCw4+vOtLVZO3PNLynU9yrtN5yYfQEAkUep+FYsBaBKqfoap6qoSdl7uK/InqfVLkaP44UmOpqm4xktqcf6Gj93Qefpht781LPl9FF00hWY/XisNB7XdwEOysez2VvRxIAJ80jZAn5EK/iZq9rO3UgRlljn1bQYLd8ZTL+VdmPkQ0sfZTWpH8fhKXiUqZx9Xy/kgaXqtjEMeOkOrvyevisrBwEVa1Zo/TK1j4SjpKEqxIPEV5V2M6oTsVMsWyKQrTFYvabmGM9CS09c64kdHArP0DTdR853C7tAIUzWXuHCtNm9GYNjlYIHyjjpZ+HjtO3btiBMW22bTb2l6vlc6o0eSmSyMwc2pQIC390fL4cKfKgVJHLRfecjjovvakTMlPfJCkLeKSYXodpTOyDME7p0ZpEEqI/neLv96qBmWvY+KssA1VMCKOI9y53vmu2BQ4Nb9yxzsQT/fD534MpxHaiydyY8FCW9b/gcfZ5dEikaWTNQtDlWzQQ5HwKHwrk+IPZBpYAptnDn0CFUOw+hU+v7gXOp1+vHmq1XMYihcVQzA5dSUnyFBcMw1wf4JUsifnNQAdpqPbxOvjWw= 15 | on: 16 | tags: true 17 | branch: master 18 | 19 | script: 20 | - tox 21 | 22 | after_success: 23 | - coveralls 24 | - if [ $TRAVIS_TAG ]; then curl -X POST https://readthedocs.org/build/napalm; fi 25 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | David Barroso 2 | Elisa Jasinska 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include requirements.txt 2 | include napalm_iosxr/templates/*.j2 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![PyPI](https://img.shields.io/pypi/v/napalm-iosxr.svg)](https://pypi.python.org/pypi/napalm-iosxr) 2 | [![Build Status](https://travis-ci.org/napalm-automation/napalm-iosxr.svg?branch=master)](https://travis-ci.org/napalm-automation/napalm-iosxr) 3 | [![Coverage Status](https://coveralls.io/repos/github/napalm-automation/napalm-iosxr/badge.svg?branch=master)](https://coveralls.io/github/napalm-automation/napalm-iosxr) 4 | 5 | # napalm-iosxr 6 | ## DEPRECATED, SEE [Napalm: Reunification](https://napalm-automation.net/reunification/). 7 | ## The only maintained repository is [Napalm](https://github.com/napalm-automation/napalm). 8 | -------------------------------------------------------------------------------- /napalm_iosxr/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2016 Dravetech AB. All rights reserved. 3 | # 4 | # The contents of this file are licensed under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with the 6 | # License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | # License for the specific language governing permissions and limitations under 14 | # the License. 15 | 16 | """napalm_iosxr package.""" 17 | 18 | # Import stdlib 19 | import pkg_resources 20 | 21 | # Import local modules 22 | from napalm_iosxr.iosxr import IOSXRDriver # noqa 23 | 24 | __all__ = ('IOSXRDriver',) 25 | 26 | try: 27 | __version__ = pkg_resources.get_distribution('napalm-iosxr').version 28 | except pkg_resources.DistributionNotFound: 29 | __version__ = "Not installed" 30 | -------------------------------------------------------------------------------- /napalm_iosxr/constants.py: -------------------------------------------------------------------------------- 1 | """Constants for the IOS-XR driver.""" 2 | 3 | from __future__ import unicode_literals 4 | 5 | from napalm_base.constants import * # noqa 6 | 7 | SR_638170159_SOLVED = False 8 | # this flag says if the Cisco TAC SR 638170159 9 | # has been solved 10 | # 11 | # "XML Agent Does not retrieve correct BGP routes data" 12 | # is a weird bug reported on 2016-02-22 22:54:21 13 | # briefly, all BGP routes are handled by the XML agent 14 | # in such a way they have the following details: 15 | # 16 | # - all neighbors are 0.0.0.0 17 | # - all routes are 0.0.0.0/0 18 | # - all RD = 0000000000000000 19 | # 20 | # because of this none of the data retrieved 21 | # from the BGP oper is usable thus has direct implications 22 | # in our implementation of `get_route_to` when retrieving 23 | # the BGP protocol specific attributes. 24 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/delete_ntp_peers.j2: -------------------------------------------------------------------------------- 1 | {% for peer in peers %} 2 | no ntp peer {{peer}} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/delete_ntp_servers.j2: -------------------------------------------------------------------------------- 1 | {% for server in servers %} 2 | no ntp server {{server}} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/delete_probes.j2: -------------------------------------------------------------------------------- 1 | ipsla 2 | {% set probe_id = 0 %} 3 | {% for probe_name, probe_test in probes.iteritems() %} 4 | {% for test_name, test_details in probe_test.iteritems() %} 5 | no schedule operation {{probe_id + loop.index}} 6 | {% endfor %} 7 | {% set probe_id = probe_id + probe_test.keys()|length %} 8 | {% endfor %} 9 | {% set probe_id = 0 %} 10 | {% for probe_name, probe_test in probes.iteritems() %} 11 | {% for test_name, test_details in probe_test.iteritems() %} 12 | no operation {{probe_id + loop.index}} 13 | {% endfor %} 14 | {% set probe_id = probe_id + probe_test.keys()|length %} 15 | {% endfor %} 16 | ! 17 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/delete_snmp_config.j2: -------------------------------------------------------------------------------- 1 | {% if (location is defined) and location %} 2 | no snmp-server location "{{location}}" 3 | {% endif %} 4 | {% if (contact is defined) and contact %} 5 | no snmp-server contact "{{contact}}" 6 | {% endif %} 7 | {% if (chassis_id is defined) and chassis_id %} 8 | no snmp-server chassis-id "{{chassis_id}}" 9 | {% endif %} 10 | {% if (community is defined) and community %} 11 | {% for comm_name, comm_details in community.iteritems() %} 12 | no community {{comm_name}} 13 | {% endfor %} 14 | {% endif %} 15 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/delete_users.j2: -------------------------------------------------------------------------------- 1 | {%- for user_name, user_details in users.iteritems() %} 2 | {%- if user_details %} 3 | username {{user_name}} 4 | {%- endif %} 5 | {%- if user_details.get('password') %} 6 | no password 7 | {%- endif %} 8 | {%- if user_details.get('level') %} 9 | no group 10 | {%- endif %} 11 | {%- else %} 12 | no username {{user_name}} 13 | {%- endfor %} 14 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/schedule_probes.j2: -------------------------------------------------------------------------------- 1 | ipsla 2 | {% set probe_id = 0 %} 3 | {% for probe_name, probe_test in probes.iteritems() %} 4 | {% for test_name, test_details in probe_test.iteritems() %} 5 | schedule operation {{probe_id + loop.index}} 6 | start-time now 7 | life forever 8 | ! 9 | {% endfor %} 10 | {% set probe_id = probe_id + probe_test.keys()|length %} 11 | {% endfor %} 12 | ! 13 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/set_hostname.j2: -------------------------------------------------------------------------------- 1 | hostname {{hostname}} 2 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/set_ntp_peers.j2: -------------------------------------------------------------------------------- 1 | {% for peer in peers %} 2 | ntp peer {{peer}} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/set_ntp_servers.j2: -------------------------------------------------------------------------------- 1 | {% for server in servers %} 2 | ntp server {{server}} 3 | {% endfor %} 4 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/set_probes.j2: -------------------------------------------------------------------------------- 1 | ipsla 2 | {% set probe_id = 0 %} 3 | {% for probe_name, probe_test in probes.iteritems() %} 4 | {% for test_name, test_details in probe_test.iteritems() %} 5 | no schedule operation {{probe_id + loop.index}} 6 | {% endfor %} 7 | {% set probe_id = probe_id + probe_test.keys()|length %} 8 | {% endfor %} 9 | {% set probe_id = 0 %} 10 | {% for probe_name, probe_test in probes.iteritems() %} 11 | {% for test_name, test_details in probe_test.iteritems() %} 12 | operation {{probe_id + loop.index}} 13 | {% if test_details.probe_type is defined %} 14 | type {{test_details.probe_type|replace('ping', 'echo')|replace('-', ' ')}} 15 | {% else %} 16 | type icmp echo 17 | {% endif %} 18 | tag {{test_name}} 19 | history 20 | lives 1 21 | filter all 22 | buckets {{test_details.probe_count}} 23 | ! 24 | {% if test_details.source is defined %} 25 | source address {{test_details.source}} 26 | {% endif %} 27 | destination address {{test_details.target}} 28 | {% if test_details.test_interval is defined %} 29 | timeout {{(test_details.test_interval - 1) * 1000}} 30 | frequency {{test_details.test_interval}} 31 | {% endif %} 32 | ! 33 | {% endfor %} 34 | {% set probe_id = probe_id + probe_test.keys()|length %} 35 | ! 36 | {% endfor %} 37 | ! 38 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/set_users.j2: -------------------------------------------------------------------------------- 1 | {%- for user_name, user_details in users.items() %} 2 | username {{user_name}} 3 | {% set user_level = user_details.level|default(1) %} 4 | {%- if user_level == 15 %} 5 | group root-system 6 | {%- elif user_level == 5 %} 7 | group operator 8 | {%- elif user_level == 2 %} 9 | group serviceadmin 10 | {%- elif user_level == 1 %} 11 | group sysadmin 12 | {% endif %} 13 | {%- if user_details.get('password') %} 14 | password {{user_details.password}} 15 | {%- endif %} 16 | {%- endfor %} 17 | -------------------------------------------------------------------------------- /napalm_iosxr/templates/snmp_config.j2: -------------------------------------------------------------------------------- 1 | {% if (location is defined) and location %} 2 | snmp-server location "{{location}}" 3 | {% endif %} 4 | {% if (contact is defined) and contact %} 5 | snmp-server contact "{{contact}}" 6 | {% endif %} 7 | {% if (chassis_id is defined) and chassis_id %} 8 | snmp-server chassis-id "{{chassis_id}}" 9 | {% endif %} 10 | {% if (community is defined) and community %} 11 | {% for comm_name, comm_details in community.iteritems() %} 12 | {% if (comm_details is defined) and comm_details %} 13 | {% if (comm_details.get('mode') is defined) and comm_details.get('mode') == 'rw' %} 14 | snmp-server community {{comm_name}} RW 15 | {% else %} 16 | snmp-server community {{comm_name}} RO 17 | {% endif %} 18 | {% else %} 19 | snmp-server community {{comm_name}} RO 20 | {% endif %} 21 | {% endfor %} 22 | {% endif %} 23 | 24 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | coveralls 2 | future 3 | pytest 4 | pytest-cov 5 | pytest-json 6 | pytest-pythonpath 7 | pylama 8 | flake8-import-order 9 | -r requirements.txt 10 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | napalm-base>=0.25.0 2 | pyIOSXR>=0.51 3 | netmiko>=1.4.3 4 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [pylama] 2 | linters = mccabe,pep8,pyflakes 3 | ignore = D203,C901,E128 4 | skip = .tox/* 5 | 6 | [pylama:pep8] 7 | max_line_length = 100 8 | 9 | [tool:pytest] 10 | addopts = --cov=napalm_iosxr --cov-report term-missing -vs --pylama 11 | json_report = report.json 12 | jsonapi = true 13 | 14 | [coverage:run] 15 | include = 16 | napalm_iosxr/* 17 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """setup.py file.""" 2 | 3 | import uuid 4 | 5 | from setuptools import setup, find_packages 6 | from pip.req import parse_requirements 7 | 8 | __author__ = 'David Barroso ' 9 | 10 | install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1()) 11 | reqs = [str(ir.req) for ir in install_reqs] 12 | 13 | setup( 14 | name="napalm-iosxr", 15 | version="0.5.6", 16 | packages=find_packages(exclude=["test", "test.*"]), 17 | author="David Barroso, Mircea Ulinic", 18 | author_email="dbarrosop@dravetech.com, mircea@cloudflare.com", 19 | description="Network Automation and Programmability Abstraction Layer with Multivendor support", 20 | classifiers=[ 21 | 'Topic :: Utilities', 22 | 'Programming Language :: Python', 23 | 'Operating System :: POSIX :: Linux', 24 | 'Operating System :: MacOS', 25 | ], 26 | url="https://github.com/napalm-automation/napalm-iosxr", 27 | include_package_data=True, 28 | install_requires=reqs, 29 | ) 30 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/napalm-automation/napalm-iosxr/fd4b5ddd82026a7ed6518f17abe3069da981473a/test/__init__.py -------------------------------------------------------------------------------- /test/unit/TestIOSXRDriver.py: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Spotify AB. All rights reserved. 2 | # 3 | # The contents of this file are licensed under the Apache License, Version 2.0 4 | # (the "License"); you may not use this file except in compliance with the 5 | # License. You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | 15 | import unittest 16 | import os 17 | 18 | from napalm_iosxr.iosxr import IOSXRDriver 19 | from napalm_base.test.base import TestConfigNetworkDriver, TestGettersNetworkDriver 20 | 21 | 22 | class TestConfigIOSXRDriver(unittest.TestCase, TestConfigNetworkDriver): 23 | 24 | @classmethod 25 | def setUpClass(cls): 26 | hostname = '127.0.0.1' 27 | username = 'vagrant' 28 | password = 'vagrant' 29 | cls.vendor = 'iosxr' 30 | 31 | optional_args = {'port': 12202} 32 | cls.device = IOSXRDriver(hostname, 33 | username, 34 | password, 35 | timeout=60, 36 | optional_args=optional_args) 37 | cls.device.open() 38 | cls.device.load_replace_candidate(filename='%s/initial.conf' % cls.vendor) 39 | cls.device.commit_config() 40 | 41 | 42 | class TestGetterIOSXRDriver(unittest.TestCase, TestGettersNetworkDriver): 43 | 44 | @classmethod 45 | def setUpClass(cls): 46 | cls.mock = True 47 | 48 | hostname = '192.168.56.202' 49 | username = 'vagrant' 50 | password = 'vagrant' 51 | cls.vendor = 'iosxr' 52 | 53 | cls.device = IOSXRDriver(hostname, username, password, timeout=60) 54 | 55 | if cls.mock: 56 | cls.device.device = FakeIOSXRDevice() 57 | else: 58 | cls.device.open() 59 | 60 | 61 | class FakeIOSXRDevice: 62 | 63 | @staticmethod 64 | def read_txt_file(filename): 65 | curr_dir = os.path.dirname(os.path.abspath(__file__)) 66 | fullpath = os.path.join(curr_dir, filename) 67 | with open(fullpath) as data_file: 68 | return data_file.read() 69 | 70 | def _execute_config_show(self, show_command): 71 | rpc_request = '{show_command}'.format( 72 | show_command=show_command 73 | ) 74 | return self.make_rpc_call(rpc_request) 75 | 76 | def show_version(self): 77 | return self.read_txt_file('iosxr/mock_data/show_version.txt') 78 | 79 | def show_interfaces(self): 80 | return self.read_txt_file('iosxr/mock_data/show_interfaces.txt') 81 | 82 | def show_interface_description(self): 83 | return self.read_txt_file('iosxr/mock_data/show_interface_description.txt') 84 | 85 | def show_lldp_neighbors(self): 86 | return self.read_txt_file('iosxr/mock_data/show_lldp_neighbors.txt') 87 | 88 | def make_rpc_call(self, rpc_call): 89 | rpc_call = rpc_call.replace('<', '_')\ 90 | .replace('>', '_')\ 91 | .replace('/', '_')\ 92 | .replace('\n', '')\ 93 | .replace(' ', '') 94 | return self.read_txt_file('iosxr/mock_data/{}.rpc'.format(rpc_call[0:150])) 95 | -------------------------------------------------------------------------------- /test/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/napalm-automation/napalm-iosxr/fd4b5ddd82026a7ed6518f17abe3069da981473a/test/unit/__init__.py -------------------------------------------------------------------------------- /test/unit/conftest.py: -------------------------------------------------------------------------------- 1 | """Test fixtures.""" 2 | from __future__ import print_function 3 | from __future__ import unicode_literals 4 | 5 | from builtins import super 6 | 7 | import pytest 8 | from napalm_base.test import conftest as parent_conftest 9 | 10 | from napalm_base.test.double import BaseTestDouble 11 | 12 | from napalm_iosxr import iosxr 13 | 14 | 15 | @pytest.fixture(scope='class') 16 | def set_device_parameters(request): 17 | """Set up the class.""" 18 | def fin(): 19 | request.cls.device.close() 20 | request.addfinalizer(fin) 21 | 22 | request.cls.driver = iosxr.IOSXRDriver 23 | request.cls.patched_driver = PatchedIOSXRDriver 24 | request.cls.vendor = 'iosxr' 25 | parent_conftest.set_device_parameters(request) 26 | 27 | 28 | def pytest_generate_tests(metafunc): 29 | """Generate test cases dynamically.""" 30 | parent_conftest.pytest_generate_tests(metafunc, __file__) 31 | 32 | 33 | class PatchedIOSXRDriver(iosxr.IOSXRDriver): 34 | """Patched IOS Driver.""" 35 | 36 | def __init__(self, hostname, username, password, timeout=60, optional_args=None): 37 | 38 | super().__init__(hostname, username, password, timeout, optional_args) 39 | 40 | self.patched_attrs = ['device'] 41 | self.device = FakeIOSXRDevice() 42 | 43 | def is_alive(self): 44 | return { 45 | 'is_alive': True # In testing everything works.. 46 | } 47 | 48 | def open(self): 49 | pass 50 | 51 | 52 | class FakeIOSXRDevice(BaseTestDouble): 53 | """IOSXR device test double.""" 54 | 55 | def close(self): 56 | pass 57 | 58 | def make_rpc_call(self, rpc_call, encoded=True): 59 | filename = '{}.txt'.format(self.sanitize_text(rpc_call)) 60 | full_path = self.find_file(filename) 61 | result = self.read_txt_file(full_path) 62 | if encoded: 63 | return str.encode(result) 64 | else: 65 | return result 66 | 67 | def show_lldp_neighbors(self): 68 | filename = 'show_lldp_neighbors.txt' 69 | full_path = self.find_file(filename) 70 | result = self.read_txt_file(full_path) 71 | return result 72 | 73 | def _execute_config_show(self, show_command): 74 | rpc_request = '{show_command}'.format( 75 | show_command=show_command 76 | ) 77 | return self.make_rpc_call(rpc_request, encoded=False) 78 | -------------------------------------------------------------------------------- /test/unit/iosxr/initial.conf: -------------------------------------------------------------------------------- 1 | interface MgmtEth0/0/CPU0/0 2 | ipv4 address dhcp 3 | 4 | interface GigabitEthernet0/0/0/0 5 | 6 | interface GigabitEthernet0/0/0/1 7 | 8 | ssh server v2 9 | ssh server rate-limit 600 10 | xml agent tty 11 | 12 | lldp 13 | 14 | end 15 | -------------------------------------------------------------------------------- /test/unit/iosxr/merge_good.conf: -------------------------------------------------------------------------------- 1 | interface GigabitEthernet0/0/0/0 2 | ipv4 address 192.168.80.12 255.255.255.0 3 | 4 | router bgp 65000 5 | vrf test 6 | neighbor 1.1.1.5 7 | remote-as 1 8 | -------------------------------------------------------------------------------- /test/unit/iosxr/merge_good.diff: -------------------------------------------------------------------------------- 1 | - interface GigabitEthernet0/0/0/0 2 | - ipv4 address 192.168.80.12 255.255.255.0 3 | - ! 4 | - router bgp 65000 5 | - vrf test 6 | - neighbor 1.1.1.5 7 | - remote-as 1 8 | - ! 9 | - ! 10 | - ! 11 | -------------------------------------------------------------------------------- /test/unit/iosxr/merge_typo.conf: -------------------------------------------------------------------------------- 1 | interface GigabitEthernet0/0/0/0 2 | ipv4 address 192.168.80.12 255.255.255.0 3 | 4 | router bgp 65000 5 | vrf test 6 | neighbor 1.1.1.5 7 | remote-as 1 8 | 9 | hotname ASD -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_CLI__Configuration_showconfigurationmerge__Configuration___CLI_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Building configuration... 4 | !! IOS XR Configuration version = 6.2.1.08I 5 | !! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant 6 | ! 7 | telnet vrf default ipv4 server max-servers 10 8 | username vagrant 9 | group root-lr 10 | group cisco-support 11 | secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/ 12 | ! 13 | tpa 14 | address-family ipv4 15 | update-source MgmtEth0/RP0/CPU0/0 16 | ! 17 | ! 18 | interface MgmtEth0/RP0/CPU0/0 19 | description testing parallel commits 20 | ipv4 address dhcp 21 | ! 22 | interface GigabitEthernet0/0/0/0 23 | shutdown 24 | ! 25 | interface GigabitEthernet0/0/0/1 26 | shutdown 27 | ! 28 | interface GigabitEthernet0/0/0/2 29 | shutdown 30 | ! 31 | interface GigabitEthernet0/0/0/3 32 | shutdown 33 | ! 34 | router static 35 | address-family ipv4 unicast 36 | 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2 37 | ! 38 | ! 39 | grpc 40 | port 57777 41 | ! 42 | xml agent tty 43 | iteration on size 1 44 | ! 45 | ssh server v2 46 | ssh server vrf default 47 | end 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_CLI__Configuration_showrunning-config__Configuration___CLI_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Building configuration... 4 | !! IOS XR Configuration version = 6.2.1.08I 5 | !! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant 6 | ! 7 | telnet vrf default ipv4 server max-servers 10 8 | username vagrant 9 | group root-lr 10 | group cisco-support 11 | secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/ 12 | ! 13 | tpa 14 | address-family ipv4 15 | update-source MgmtEth0/RP0/CPU0/0 16 | ! 17 | ! 18 | interface MgmtEth0/RP0/CPU0/0 19 | description testing parallel commits 20 | ipv4 address dhcp 21 | ! 22 | interface GigabitEthernet0/0/0/0 23 | shutdown 24 | ! 25 | interface GigabitEthernet0/0/0/1 26 | shutdown 27 | ! 28 | interface GigabitEthernet0/0/0/2 29 | shutdown 30 | ! 31 | interface GigabitEthernet0/0/0/3 32 | shutdown 33 | ! 34 | router static 35 | address-family ipv4 unicast 36 | 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2 37 | ! 38 | ! 39 | grpc 40 | port 57777 41 | ! 42 | xml agent tty 43 | iteration on size 1 44 | ! 45 | ssh server v2 46 | ssh server vrf default 47 | end 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__AdminOperational__MemorySummary___MemorySummary___AdminOperational___Get_.rpc: -------------------------------------------------------------------------------- 1 | 0RSP0CPU0409664424509443412946944615861645234129469448201193282011932134217728000RSP1CPU040966442450944341294694461586164524452450304820119328201193213421772800 -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Configuration__AAA___AAA___Configuration___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | default 12 | 13 | 14 | 15 | Loopback0 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 1 24 | 25 | 26 | 27 | 192.168.0.1 28 | 29 | 30 | 31 | 49 32 | 33 | 34 | 35 | true 36 | 37 | 38 | 39 | true 40 | 41 | 42 | 23HY2342423B42JK3H4JK 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | dummy-test 53 | 54 | 55 | 56 | true 57 | 58 | 59 | 60 | 61 | 62 | root-system 63 | 64 | 65 | 66 | true 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | dummy-test2 75 | 76 | 77 | 78 | true 79 | 80 | 81 | 82 | 83 | 84 | root-system 85 | 86 | 87 | 88 | true 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Configuration__BGP__Instance__Naming__InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | default013335trueIPv4Unicasttruetrue32falsefalsefalsevlan700-to-bgpstatic-to-bgpIPv6Unicasttruetrue32falsefalsefalsevlan700-to-bgpstatic-to-bgpIPv4Flowspectrue4-public-anycast-peerstrueIPv4Unicasttruetrue4-public-anycast-peers-in4-public-anycast-peers-outtruetrue172.17.17.734-cogent-transit192.168.20.3090504-public-anycast-peersTelekom Romania [RO ISP ANYCAST]IPv4Unicasttrue500075false0false172.17.17.500481614-public-anycast-peersNextGen [RO ISP ANYCAST]IPv4Unicasttrue50075false0false192.168.50.5090094-public-anycast-peersM247 Ltd [UK Hosting ANYCAST]IPv4Unicasttrue100075false0false192.158.17.54-SERVER-LAN -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Configuration__IPSLA___IPSLA___Configuration___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 1 12 | 13 | 14 | 15 | 16 | 17 | true 18 | 19 | 20 | test-GT-4 21 | 22 | 23 | 24 | 1 25 | 26 | 27 | All 28 | 29 | 30 | 20 31 | 32 | 33 | 34 | 1.1.1.1.1 35 | 36 | 37 | 2.2.2.2 38 | 39 | 40 | 2000 41 | 42 | 43 | 3 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 2 52 | 53 | 54 | 55 | 56 | 57 | true 58 | 59 | 60 | sjc01-TE-4 61 | 62 | 63 | 64 | 1 65 | 66 | 67 | All 68 | 69 | 70 | 20 71 | 72 | 73 | 74 | 3.3.3.3 75 | 76 | 77 | 4.4.4.4 78 | 79 | 80 | 2000 81 | 82 | 83 | 3 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 1 94 | 95 | 96 | 97 | 98 | Now 99 | 100 | 101 | 102 | Forever 103 | 104 | 105 | 106 | 107 | 108 | 2 109 | 110 | 111 | 112 | 113 | Now 114 | 115 | 116 | 117 | Forever 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Configuration__NTP___NTP___Configuration___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | default 11 | 12 | 13 | 14 | 15 | 16 | 17 | 1.2.3.4 18 | 19 | 20 | 21 | 22 | 23 | Server 24 | 25 | 26 | 27 | Prefer 28 | 29 | 30 | 31 | 32 | 33 | 34 | 5.6.7.8 35 | 36 | 37 | 38 | 39 | 40 | Server 41 | 42 | 43 | 44 | Prefer 45 | 46 | 47 | 48 | 49 | 50 | 51 | 9.10.11.12 52 | 53 | 54 | 55 | 56 | 57 | Peer 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 13.14.15.16 66 | 67 | 68 | 69 | 70 | 71 | Peer 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | default 84 | 85 | 86 | 87 | Loopback0 88 | 89 | 90 | 91 | 92 | true 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Configuration__SNMP___SNMP___Configuration___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | hackme 12 | 13 | 14 | 15 | ReadOnly 16 | 17 | 18 | ifyoucan 19 | 20 | 21 | 22 | 23 | 24 | 25 | edge01.yyz01 26 | 27 | 28 | noc@cloudflare.com 29 | 30 | 31 | Toronto, Canada 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Operational__BGP__ConfigInstanceTable__ConfigInstance__Naming__InstanceName_default__InstanceName___Naming__ConfigInstanceVRFTable____ConfigInst.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | default 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Operational__BGP__InstanceTable__Instance__Naming__InstanceName_default__InstanceName___Naming__InstanceActive__DefaultVRF__GlobalProcessInfo___.rpc: -------------------------------------------------------------------------------- 1 | defaultdefault1610612736true31337default2120600173693440true1736934421true1.9.9.01.9.9.0falsetruefalsefalsefalsefalsefalsefalsefalsefalsetrue100601803truefalse0falsefalsetrue1203606001.2.3.40test313378473falsetrue0000000BGP_ST_IDLE10NoBestLocalAddressIPv40.0.0.0false0IPv41.2.3.400falsefalsefalsefalsefalsefalsefalsefalsefalseBGP_BFD_STATE_NONEBGP_BFD_STATE_NONE333314489963380106141300.0.0.041false0falsefalsefalsefalsefalsefalsefalsefalse180601806033003050000000000000000000000000000000BGP_NONEBGP_PEER_RESET_REASON_NONE00000000000847300600000000000000000000000000000000-10000BGP_TCP_MODE_TYPE_EITHERfalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsefalsedefaultfalsetruefalse120360000000false0BGP_NBR_NSR_ST_NONEfalsetrue000falsefalsefalsefalse00000000000000000000000000000000000000000000000000000000000000000000000000000000000falsefalsefalse0000000falsefalsefalsefalse 2 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Operational__IPV4Network___IPV4Network__IPV6Network___IPV6Network___Operational___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | BVI10default10.49.8.11610612736Up192.168.0.11610612736Up210224.0.0.2224.0.0.11500truefalsefalsefalsefalsetruetruefalsefalsefalseStrictfalsefalsefalsefalsefalsefalsefalsefalseBVI100default172.17.17.11610612736Up192.168.21.11610612736Up24100224.0.0.2224.0.0.11500truefalsefalsefalsefalsetrue
172.17.18.1
24100
192.168.23.1
24100
truefalsefalsefalseStrictfalsefalsefalsefalsefalsefalsefalsefalse
0RSP0CPU0400000000defaultBVI100Up
FF02::5
FF02::5
FF02::5
FF02::5
1500OperUp
2400:cb00:49:1024::1
64Activefalse0
FE80::5A0A:20FF:FEEB:91E4
128Activefalse0
truefalsefalsefalse00falsefalse0falsefalsefalsetruefalsefalse
Bundle-Ether2Up
FF02::8
FF02::9
FF02::5
FF02::5
1500OperUp
2001:db8::
126Activefalse0
FE80::2237:06FF:FECF:67E4
128Activefalse0
6-transit-intruefalsefalsefalse00falsefalse0falsefalsefalsetruefalsefalse
-------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default__VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTable__SAF__Na.rpc: -------------------------------------------------------------------------------- 1 | defaultIPv4Unicastdefault
1.0.4.0
24
1.0.4.024493bgp13335141024121512693920001483664025525500truefalse18048051048577491881795201453752883323041839
37.49.232.13
37.49.232.13::None00973297320false000104857700000falsefalsefalsefalsefalsefalse0000.0.0.00.0.0.0false0000
-------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Get__Operational__SystemTime___PlatformInventory____Operational___Get_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 2016 9 | 10 | 11 | 7 12 | 13 | 14 | 12 15 | 16 | 17 | 10 18 | 19 | 20 | 5 21 | 22 | 23 | 54 24 | 25 | 26 | 804 27 | 28 | 29 | UTC 30 | 31 | 32 | NTP 33 | 34 | 35 | 36 | 37 | edge01.tab01 38 | 39 | 40 | 35457914 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 0 50 | 51 | 52 | 53 | 54 | 55 | chassis ASR-9904-AC 56 | 57 | 58 | ASR 9904 2 Line Card Slot Chassis with V2 AC PEM 59 | 60 | 61 | ASR-9904-AC 62 | 63 | 64 | V01 65 | 66 | 67 | FOX1717PLM4 68 | 69 | 70 | 5.3.1 71 | 72 | 73 | 1.3.6.1.4.1.9.12.3.1.3.1301 74 | 75 | 76 | true 77 | 78 | 79 | 80 | 81 | ADMIN_STATE_INVALID 82 | 83 | 84 | ADMIN_POWER_INVALID 85 | 86 | 87 | INV_CARD_NOT_PRESENT 88 | 89 | 90 | UNMONITORED 91 | 92 | 93 | MODULE_RESET_REASON_UNKNOWN 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 0 101 | 102 | 103 | 104 | 105 | 0 106 | 107 | 108 | 0 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/_Set__Action__TraceRoute__IPV4__Destination_8.8.8.8__Destination___IPV4___TraceRoute___Action___Set_.rpc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 8.8.8.8 9 | 10 | 11 | 1 12 | 13 | 14 | 127.0.0.1 15 | 16 | 17 | 18 | 8.8.8.8 19 | 20 | 21 | 22 | 0 23 | 24 | 25 | * 26 | 27 | 28 | 29 | 2 30 | 31 | 32 | tor10.ip4.gtt.net 33 | 34 | 35 | 1.1.1.1 36 | 37 | 38 | 39 | 0 40 | 41 | 42 | 0 43 | 44 | 45 | 46 | 3 47 | 48 | 49 | tcore5.TNK-Toronto.as6453.net 50 | 51 | 52 | 2.2.2.2 53 | 54 | 55 | 56 | 0 57 | 58 | 59 | 186 60 | 61 | 62 | 63 | 0 64 | 65 | 66 | * 67 | 68 | 69 | 70 | 5 71 | 72 | 73 | tcore22.SQN-San-Jose.as6453.net 74 | 75 | 76 | 3.3.3.3 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 192 84 | 85 | 86 | 87 | 6 88 | 89 | 90 | tcore0.PDI-Palo-Alto.as6453.net 91 | 92 | 93 | 4.4.4.4 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 169 101 | 102 | 103 | 104 | 7 105 | 106 | 107 | tcore17.TV2-Tokyo.as6453.net 108 | 109 | 110 | 5.5.5.5 111 | 112 | 113 | 114 | 0 115 | 116 | 117 | 189 118 | 119 | 120 | 121 | 8 122 | 123 | 124 | tcore7.TV2-Tokyo.as6453.net 125 | 126 | 127 | 6.6.6.6 128 | 129 | 130 | 131 | 0 132 | 133 | 134 | 186 135 | 136 | 137 | 138 | 9 139 | 140 | 141 | 8.8.8.8 142 | 143 | 144 | 145 | 0 146 | 147 | 148 | 199 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/show_interface_description.txt: -------------------------------------------------------------------------------- 1 | Fri Nov 27 10:02:21.639 UTC 2 | 3 | Interface Status Protocol Description 4 | -------------------------------------------------------------------------------- 5 | Nu0 up up 6 | Mg0/0/CPU0/0 up up 7 | Gi0/0/0/0 up up 8 | Gi0/0/0/1 up up 9 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/show_interfaces.txt: -------------------------------------------------------------------------------- 1 | Null0 is up, line protocol is up 2 | Interface state transitions: 1 3 | Hardware is Null interface 4 | Internet address is Unknown 5 | MTU 1500 bytes, BW 0 Kbit 6 | reliability 255/255, txload Unknown, rxload Unknown 7 | Encapsulation Null, loopback not set, 8 | Last input never, output never 9 | Last clearing of "show interface" counters never 10 | 5 minute input rate 0 bits/sec, 0 packets/sec 11 | 5 minute output rate 0 bits/sec, 0 packets/sec 12 | 0 packets input, 0 bytes, 0 total input drops 13 | 0 drops for unrecognized upper-level protocol 14 | Received 0 broadcast packets, 0 multicast packets 15 | 0 packets output, 0 bytes, 0 total output drops 16 | Output 0 broadcast packets, 0 multicast packets 17 | 18 | MgmtEth0/0/CPU0/0 is up, line protocol is up 19 | Interface state transitions: 1 20 | Hardware is Management Ethernet, address is 0800.27a3.db3b (bia 0800.27a3.db3b) 21 | Internet address is 192.168.56.202/24 22 | MTU 1514 bytes, BW 0 Kbit 23 | reliability 255/255, txload Unknown, rxload Unknown 24 | Encapsulation ARPA, 25 | Duplex unknown, 0Kb/s, unknown, link type is autonegotiation 26 | output flow control is off, input flow control is off 27 | Carrier delay (up) is 10 msec 28 | loopback not set, 29 | ARP type ARPA, ARP timeout 04:00:00 30 | Last input 00:00:00, output 00:00:00 31 | Last clearing of "show interface" counters never 32 | 5 minute input rate 0 bits/sec, 0 packets/sec 33 | 5 minute output rate 0 bits/sec, 0 packets/sec 34 | 2653 packets input, 433617 bytes, 0 total input drops 35 | 0 drops for unrecognized upper-level protocol 36 | Received 851 broadcast packets, 500 multicast packets 37 | 0 runts, 0 giants, 0 throttles, 0 parity 38 | 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 39 | 822 packets output, 211959 bytes, 0 total output drops 40 | Output 5 broadcast packets, 0 multicast packets 41 | 0 output errors, 0 underruns, 0 applique, 0 resets 42 | 0 output buffer failures, 0 output buffers swapped out 43 | 1 carrier transitions 44 | 45 | GigabitEthernet0/0/0/0 is up, line protocol is up 46 | Interface state transitions: 1 47 | Hardware is GigabitEthernet, address is 0800.27b2.4650 (bia 0800.27b2.4650) 48 | Internet address is Unknown 49 | MTU 1514 bytes, BW 1000000 Kbit (Max: 1000000 Kbit) 50 | reliability 255/255, txload 0/255, rxload 0/255 51 | Encapsulation ARPA, 52 | Full-duplex, 1000Mb/s, unknown, link type is force-up 53 | output flow control is off, input flow control is off 54 | Carrier delay (up) is 10 msec 55 | loopback not set, 56 | Last input 00:00:28, output 00:00:18 57 | Last clearing of "show interface" counters never 58 | 5 minute input rate 0 bits/sec, 0 packets/sec 59 | 5 minute output rate 0 bits/sec, 0 packets/sec 60 | 365 packets input, 72270 bytes, 0 total input drops 61 | 0 drops for unrecognized upper-level protocol 62 | Received 0 broadcast packets, 365 multicast packets 63 | 0 runts, 0 giants, 0 throttles, 0 parity 64 | 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 65 | 367 packets output, 63491 bytes, 0 total output drops 66 | Output 0 broadcast packets, 367 multicast packets 67 | 0 output errors, 0 underruns, 0 applique, 0 resets 68 | 0 output buffer failures, 0 output buffers swapped out 69 | 1 carrier transitions 70 | 71 | GigabitEthernet0/0/0/1 is up, line protocol is up 72 | Interface state transitions: 1 73 | Hardware is GigabitEthernet, address is 0800.27a5.abb0 (bia 0800.27a5.abb0) 74 | Internet address is Unknown 75 | MTU 1514 bytes, BW 1000000 Kbit (Max: 1000000 Kbit) 76 | reliability 255/255, txload 0/255, rxload 0/255 77 | Encapsulation ARPA, 78 | Full-duplex, 1000Mb/s, unknown, link type is force-up 79 | output flow control is off, input flow control is off 80 | Carrier delay (up) is 10 msec 81 | loopback not set, 82 | Last input 00:00:28, output 00:00:18 83 | Last clearing of "show interface" counters never 84 | 5 minute input rate 0 bits/sec, 0 packets/sec 85 | 5 minute output rate 0 bits/sec, 0 packets/sec 86 | 365 packets input, 72270 bytes, 0 total input drops 87 | 0 drops for unrecognized upper-level protocol 88 | Received 0 broadcast packets, 365 multicast packets 89 | 0 runts, 0 giants, 0 throttles, 0 parity 90 | 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 91 | 367 packets output, 63491 bytes, 0 total output drops 92 | Output 0 broadcast packets, 367 multicast packets 93 | 0 output errors, 0 underruns, 0 applique, 0 resets 94 | 0 output buffer failures, 0 output buffers swapped out 95 | 1 carrier transitions 96 | 97 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/show_lldp_neighbors.txt: -------------------------------------------------------------------------------- 1 | Capability codes: 2 | (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device 3 | (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other 4 | 5 | Device ID Local Intf Hold-time Capability Port ID 6 | precise64 Gi0/0/0/0 120 N/A 0800.27f3.3c29 7 | precise64 Gi0/0/0/1 120 N/A 0800.275d.d2a8 8 | 9 | Total entries displayed: 2 10 | -------------------------------------------------------------------------------- /test/unit/iosxr/mock_data/show_version.txt: -------------------------------------------------------------------------------- 1 | Cisco IOS XR Software, Version 5.3.0[Default] 2 | Copyright (c) 2015 by Cisco Systems, Inc. 3 | 4 | ROM: GRUB, Version 1.99(0), DEV RELEASE 5 | 6 | ios uptime is 2 hours, 20 minutes 7 | System image file is "bootflash:disk0/xrvr-os-mbi-5.3.0/mbixrvr-rp.vm" 8 | 9 | cisco IOS XRv Series (Pentium II Stepping 1) processor with 2096703K bytes of memory. 10 | Pentium II Stepping 1 processor at 2304MHz, Revision 2.174 11 | IOS XRv Chassis 12 | 13 | 1 Management Ethernet 14 | 2 GigabitEthernet 15 | 97070k bytes of non-volatile configuration memory. 16 | 866M bytes of hard disk. 17 | 2321392k bytes of disk0: (Sector size 512 bytes). 18 | 19 | Configuration register on node 0/0/CPU0 is 0x2102 20 | Boot device on node 0/0/CPU0 is disk0: 21 | Package active on node 0/0/CPU0: 22 | iosxr-infra, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-infra-5.3.0 23 | Built on Sun Jan 18 17:35:11 UTC 2015 24 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 25 | 26 | iosxr-fwding, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-fwding-5.3.0 27 | Built on Sun Jan 18 17:35:11 UTC 2015 28 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 29 | 30 | iosxr-routing, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-routing-5.3.0 31 | Built on Sun Jan 18 17:35:11 UTC 2015 32 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 33 | 34 | iosxr-ce, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-ce-5.3.0 35 | Built on Sun Jan 18 17:35:11 UTC 2015 36 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 37 | 38 | xrvr-os-mbi, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-os-mbi-5.3.0 39 | Built on Sun Jan 18 17:36:08 UTC 2015 40 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 41 | 42 | xrvr-base, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-base-5.3.0 43 | Built on Sun Jan 18 17:35:11 UTC 2015 44 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 45 | 46 | xrvr-fwding, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-fwding-5.3.0 47 | Built on Sun Jan 18 17:35:11 UTC 2015 48 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 49 | 50 | xrvr-mgbl-x, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-mgbl-x-5.3.0 51 | Built on Sun Jan 18 17:35:21 UTC 2015 52 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 53 | 54 | iosxr-mpls, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-mpls-5.3.0 55 | Built on Sun Jan 18 17:35:11 UTC 2015 56 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 57 | 58 | iosxr-mgbl, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-mgbl-5.3.0 59 | Built on Sun Jan 18 17:35:11 UTC 2015 60 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 61 | 62 | iosxr-mcast, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-mcast-5.3.0 63 | Built on Sun Jan 18 17:35:11 UTC 2015 64 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 65 | 66 | xrvr-mcast-supp, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-mcast-supp-5.3.0 67 | Built on Sun Jan 18 17:35:11 UTC 2015 68 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 69 | 70 | iosxr-bng, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-bng-5.3.0 71 | Built on Sun Jan 18 17:35:09 UTC 2015 72 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 73 | 74 | xrvr-bng-supp, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-bng-supp-5.3.0 75 | Built on Sun Jan 18 17:35:09 UTC 2015 76 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 77 | 78 | iosxr-security, V 5.3.0[Default], Cisco Systems, at disk0:iosxr-security-5.3.0 79 | Built on Sun Jan 18 17:35:06 UTC 2015 80 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 81 | 82 | xrvr-fullk9-x, V 5.3.0[Default], Cisco Systems, at disk0:xrvr-fullk9-x-5.3.0 83 | Built on Sun Jan 18 17:36:17 UTC 2015 84 | By iox-lnx-003 in /auto/srcarchive11/production/5.3.0/all/workspace for pie 85 | -------------------------------------------------------------------------------- /test/unit/iosxr/new_good.conf: -------------------------------------------------------------------------------- 1 | hostname ios-xrv-unittest-changed 2 | 3 | interface MgmtEth0/0/CPU0/0 4 | ipv4 address dhcp 5 | 6 | interface GigabitEthernet0/0/0/0 7 | ipv4 address 192.168.78.12 255.255.255.0 8 | 9 | router bgp 65000 10 | vrf test 11 | neighbor 1.1.1.2 12 | remote-as 1 13 | 14 | vrf test2 15 | neighbor 2.2.2.3 16 | remote-as 2 17 | 18 | ssh server v2 19 | xml agent tty 20 | 21 | lldp 22 | 23 | end 24 | -------------------------------------------------------------------------------- /test/unit/iosxr/new_good.diff: -------------------------------------------------------------------------------- 1 | + hostname ios-xrv-unittest-changed 2 | + interface GigabitEthernet0/0/0/0 3 | + ipv4 address 192.168.78.12 255.255.255.0 4 | + ! 5 | - interface GigabitEthernet0/0/0/1 6 | + router bgp 65000 7 | + vrf test 8 | + neighbor 1.1.1.2 9 | + remote-as 1 10 | + ! 11 | + ! 12 | + vrf test2 13 | + neighbor 2.2.2.3 14 | + remote-as 2 15 | + ! 16 | + ! 17 | + ! 18 | - ssh server rate-limit 600 19 | -------------------------------------------------------------------------------- /test/unit/iosxr/new_typo.conf: -------------------------------------------------------------------------------- 1 | hostname ios-xrv-unittest-changed 2 | 3 | interface MgmtEth0/0/CPU0/0 4 | ipv4 address dhcp 5 | 6 | interface GigabitEthernet0/0/0/0 7 | ipv4 address 192.168.78.12 255.255.255.0 8 | 9 | asd 10 | 11 | router bgp 65000 12 | vrf test 13 | neighbor 1.1.1.2 14 | remote-as 1 15 | 16 | vrf test2 17 | neighbor 2.2.2.3 18 | remote-as 2 19 | 20 | ssh server v2 21 | xml agent tty 22 | 23 | lldp 24 | 25 | end 26 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_config/mixed_with_without_groups/_Get__Configuration__BGP__Instance__Naming__________InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | default065900true10.255.255.1IPv4Unicasttrue192.168.1.024RRtrue065900Loopback0IPv4UnicasttrueRP-RR-IN100000090false12010.255.255.2065900Loopback0IPv4Unicasttruepass-allpass-all10.255.255.3RR10.255.255.12RRIPv4UnicasttrueRP-SPECIAL-SNOWFLAKE-IN10.255.255.220065900Loopback0IPv4Unicasttruepass-allpass-all 3 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_config/mixed_with_without_groups/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "_": { 3 | "remote_as": 0, 4 | "neighbors": { 5 | "10.255.255.220": { 6 | "remote_as": 65900, 7 | "export_policy": "pass-all", 8 | "description": "", 9 | "route_reflector_client": false, 10 | "nhs": false, 11 | "local_as": 0, 12 | "import_policy": "pass-all", 13 | "local_address": "", 14 | "prefix_limit": { 15 | "inet": { 16 | "unicast": { 17 | "limit": 0, 18 | "teardown": { 19 | "threshold": 0, 20 | "timeout": 0 21 | } 22 | } 23 | } 24 | }, 25 | "authentication_key": "" 26 | }, 27 | "10.255.255.2": { 28 | "remote_as": 65900, 29 | "export_policy": "pass-all", 30 | "description": "", 31 | "route_reflector_client": false, 32 | "nhs": false, 33 | "local_as": 0, 34 | "import_policy": "pass-all", 35 | "local_address": "", 36 | "prefix_limit": { 37 | "inet": { 38 | "unicast": { 39 | "limit": 0, 40 | "teardown": { 41 | "threshold": 0, 42 | "timeout": 0 43 | } 44 | } 45 | } 46 | }, 47 | "authentication_key": "" 48 | } 49 | }, 50 | "multihop_ttl": 0, 51 | "import_policy": "", 52 | "local_address": "", 53 | "type": "", 54 | "remove_private_as": false, 55 | "description": "", 56 | "export_policy": "", 57 | "local_as": 0, 58 | "apply_groups": [], 59 | "multipath": false, 60 | "prefix_limit": {} 61 | }, 62 | "RR": { 63 | "remote_as": 65900, 64 | "neighbors": { 65 | "10.255.255.12": { 66 | "remote_as": 0, 67 | "export_policy": "", 68 | "description": "", 69 | "route_reflector_client": false, 70 | "nhs": false, 71 | "local_as": 0, 72 | "import_policy": "RP-SPECIAL-SNOWFLAKE-IN", 73 | "local_address": "", 74 | "prefix_limit": { 75 | "inet": { 76 | "unicast": { 77 | "limit": 0, 78 | "teardown": { 79 | "threshold": 0, 80 | "timeout": 0 81 | } 82 | } 83 | } 84 | }, 85 | "authentication_key": "" 86 | }, 87 | "10.255.255.3": { 88 | "remote_as": 0, 89 | "export_policy": "", 90 | "description": "", 91 | "route_reflector_client": false, 92 | "nhs": false, 93 | "local_as": 0, 94 | "import_policy": "", 95 | "local_address": "", 96 | "prefix_limit": {}, 97 | "authentication_key": "" 98 | } 99 | }, 100 | "multihop_ttl": 0, 101 | "import_policy": "RP-RR-IN", 102 | "local_address": "", 103 | "type": "external", 104 | "remove_private_as": true, 105 | "description": "", 106 | "export_policy": "", 107 | "local_as": 0, 108 | "apply_groups": [], 109 | "multipath": false, 110 | "prefix_limit": {} 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_config/normal/_Get__Configuration__BGP__Instance__Naming__________InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | default013335trueIPv4Unicasttruetrue32falsefalsefalsevlan700-to-bgpstatic-to-bgpIPv6Unicasttruetrue32falsefalsefalsevlan700-to-bgpstatic-to-bgpIPv4Flowspectrue4-public-anycast-peerstrueIPv4Unicasttruetrue4-public-anycast-peers-in4-public-anycast-peers-outtruetrue172.17.17.734-cogent-transit192.168.20.3090504-public-anycast-peersTelekom Romania [RO ISP ANYCAST]IPv4Unicasttrue500075false0false172.17.17.500481614-public-anycast-peersNextGen [RO ISP ANYCAST]IPv4Unicasttrue50075false0false192.168.50.5090094-public-anycast-peersM247 Ltd [UK Hosting ANYCAST]IPv4Unicasttrue100075false0false192.158.17.54-SERVER-LAN 3 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_config/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "4-public-anycast-peers": { 3 | "local_as": 0, 4 | "remove_private_as": true, 5 | "import_policy": "4-public-anycast-peers-in", 6 | "multihop_ttl": 0, 7 | "neighbors": { 8 | "192.168.20.3": { 9 | "export_policy": "", 10 | "local_as": 0, 11 | "prefix_limit": { 12 | "inet": { 13 | "unicast": { 14 | "teardown": { 15 | "timeout": 0, 16 | "threshold": 75 17 | }, 18 | "limit": 5000 19 | } 20 | } 21 | }, 22 | "remote_as": 9050, 23 | "import_policy": "", 24 | "nhs": false, 25 | "authentication_key": "", 26 | "local_address": "", 27 | "description": "Telekom Romania [RO ISP ANYCAST]", 28 | "route_reflector_client": false 29 | }, 30 | "172.17.17.50": { 31 | "export_policy": "", 32 | "local_as": 0, 33 | "prefix_limit": { 34 | "inet": { 35 | "unicast": { 36 | "teardown": { 37 | "timeout": 0, 38 | "threshold": 75 39 | }, 40 | "limit": 500 41 | } 42 | } 43 | }, 44 | "remote_as": 48161, 45 | "import_policy": "", 46 | "nhs": false, 47 | "authentication_key": "", 48 | "local_address": "", 49 | "description": "NextGen [RO ISP ANYCAST]", 50 | "route_reflector_client": false 51 | }, 52 | "192.168.50.5": { 53 | "export_policy": "", 54 | "local_as": 0, 55 | "prefix_limit": { 56 | "inet": { 57 | "unicast": { 58 | "teardown": { 59 | "timeout": 0, 60 | "threshold": 75 61 | }, 62 | "limit": 1000 63 | } 64 | } 65 | }, 66 | "remote_as": 9009, 67 | "import_policy": "", 68 | "nhs": false, 69 | "authentication_key": "", 70 | "local_address": "", 71 | "description": "M247 Ltd [UK Hosting ANYCAST]", 72 | "route_reflector_client": false 73 | } 74 | }, 75 | "multipath": false, 76 | "export_policy": "4-public-anycast-peers-out", 77 | "type": "external", 78 | "apply_groups": [], 79 | "remote_as": 0, 80 | "prefix_limit": {}, 81 | "description": "", 82 | "local_address": "" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_config/peers_without_groups/_Get__Configuration__BGP__Instance__Naming__________InstanceName_default__InstanceName___Naming___Instance___BGP___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | default065900true10.255.255.1IPv4Unicasttrue192.168.1.02410.255.255.2065900Loopback0IPv4Unicasttruepass-allpass-all10.255.255.3065900Loopback0IPv4Unicasttruepass-allpass-all 3 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_config/peers_without_groups/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "_": { 3 | "multipath": false, 4 | "prefix_limit": {}, 5 | "description": "", 6 | "type": "", 7 | "import_policy": "", 8 | "export_policy": "", 9 | "local_address": "", 10 | "remove_private_as": false, 11 | "remote_as": 0, 12 | "multihop_ttl": 0, 13 | "local_as": 0, 14 | "apply_groups": [], 15 | "neighbors": { 16 | "10.255.255.2": { 17 | "route_reflector_client": false, 18 | "prefix_limit": { 19 | "inet": { 20 | "unicast": { 21 | "teardown": { 22 | "timeout": 0, 23 | "threshold": 0 24 | }, 25 | "limit": 0 26 | } 27 | } 28 | }, 29 | "local_as": 0, 30 | "description": "", 31 | "local_address": "", 32 | "import_policy": "pass-all", 33 | "remote_as": 65900, 34 | "export_policy": "pass-all", 35 | "authentication_key": "", 36 | "nhs": false 37 | }, 38 | "10.255.255.3": { 39 | "route_reflector_client": false, 40 | "prefix_limit": { 41 | "inet": { 42 | "unicast": { 43 | "teardown": { 44 | "timeout": 0, 45 | "threshold": 0 46 | }, 47 | "limit": 0 48 | } 49 | } 50 | }, 51 | "local_as": 0, 52 | "description": "", 53 | "local_address": "", 54 | "import_policy": "pass-all", 55 | "remote_as": 65900, 56 | "export_policy": "pass-all", 57 | "authentication_key": "", 58 | "nhs": false 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_neighbors/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": { 3 | "router_id": "1.1.1.1", 4 | "peers": { 5 | "20.20.20.20": { 6 | "is_enabled": false, 7 | "uptime": 10009522, 8 | "remote_as": 1234, 9 | "description": "Why so curious?", 10 | "remote_id": "1.2.3.4", 11 | "local_as": 13335, 12 | "is_up": true, 13 | "address_family": { 14 | "ipv4": { 15 | "sent_prefixes": 1348, 16 | "accepted_prefixes": 588215, 17 | "received_prefixes": 588224 18 | } 19 | } 20 | }, 21 | "9.10.11.12": { 22 | "is_enabled": false, 23 | "uptime": -1, 24 | "remote_as": 7777, 25 | "description": "Banana", 26 | "remote_id": "0.0.0.0", 27 | "local_as": 13335, 28 | "is_up": false, 29 | "address_family": { 30 | "ipv4": { 31 | "sent_prefixes": 0, 32 | "accepted_prefixes": 0, 33 | "received_prefixes": 0 34 | } 35 | } 36 | }, 37 | "30.30.30.30": { 38 | "is_enabled": false, 39 | "uptime": -1, 40 | "remote_as": 7777, 41 | "description": "Banana", 42 | "remote_id": "0.0.0.0", 43 | "local_as": 13335, 44 | "is_up": false, 45 | "address_family": { 46 | "ipv4": { 47 | "sent_prefixes": 0, 48 | "accepted_prefixes": 0, 49 | "received_prefixes": 0 50 | } 51 | } 52 | }, 53 | "5.6.7.8": { 54 | "is_enabled": false, 55 | "uptime": 1871663, 56 | "remote_as": 13335, 57 | "description": "", 58 | "remote_id": "5.6.7.8", 59 | "local_as": 13335, 60 | "is_up": true, 61 | "address_family": { 62 | "ipv4": { 63 | "sent_prefixes": 0, 64 | "accepted_prefixes": 316, 65 | "received_prefixes": 316 66 | } 67 | } 68 | } 69 | } 70 | }, 71 | "global": { 72 | "router_id": "1.9.9.0", 73 | "peers": { 74 | "1.2.3.4": { 75 | "is_enabled": false, 76 | "uptime": -1, 77 | "remote_as": 8473, 78 | "description": "test", 79 | "remote_id": "0.0.0.0", 80 | "local_as": 31337, 81 | "is_up": false, 82 | "address_family": { 83 | "ipv4": { 84 | "sent_prefixes": 0, 85 | "accepted_prefixes": 0, 86 | "received_prefixes": 0 87 | } 88 | } 89 | } 90 | } 91 | }, 92 | "test2": { 93 | "router_id": "1.1.1.1", 94 | "peers": { 95 | "20.20.20.20": { 96 | "is_enabled": false, 97 | "uptime": 10009522, 98 | "remote_as": 1234, 99 | "description": "Why so curious?", 100 | "remote_id": "1.2.3.4", 101 | "local_as": 13335, 102 | "is_up": true, 103 | "address_family": { 104 | "ipv4": { 105 | "sent_prefixes": 1348, 106 | "accepted_prefixes": 588215, 107 | "received_prefixes": 588224 108 | } 109 | } 110 | }, 111 | "9.10.11.12": { 112 | "is_enabled": false, 113 | "uptime": -1, 114 | "remote_as": 7777, 115 | "description": "Banana", 116 | "remote_id": "0.0.0.0", 117 | "local_as": 13335, 118 | "is_up": false, 119 | "address_family": { 120 | "ipv4": { 121 | "sent_prefixes": 0, 122 | "accepted_prefixes": 0, 123 | "received_prefixes": 0 124 | } 125 | } 126 | }, 127 | "30.30.30.30": { 128 | "is_enabled": false, 129 | "uptime": -1, 130 | "remote_as": 7777, 131 | "description": "Banana", 132 | "remote_id": "0.0.0.0", 133 | "local_as": 13335, 134 | "is_up": false, 135 | "address_family": { 136 | "ipv4": { 137 | "sent_prefixes": 0, 138 | "accepted_prefixes": 0, 139 | "received_prefixes": 0 140 | } 141 | } 142 | }, 143 | "5.6.7.8": { 144 | "is_enabled": false, 145 | "uptime": 1871663, 146 | "remote_as": 13335, 147 | "description": "", 148 | "remote_id": "5.6.7.8", 149 | "local_as": 13335, 150 | "is_up": true, 151 | "address_family": { 152 | "ipv4": { 153 | "sent_prefixes": 0, 154 | "accepted_prefixes": 316, 155 | "received_prefixes": 316 156 | } 157 | } 158 | } 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_bgp_neighbors_detail/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "global": { 3 | "7777": [{ 4 | "suppress_4byte_as": false, 5 | "local_as_prepend": true, 6 | "connection_state": "Idle", 7 | "multihop": true, 8 | "input_messages": 0, 9 | "previous_connection_state": "", 10 | "output_messages": 0, 11 | "remove_private_as": false, 12 | "multipath": false, 13 | "messages_queued_out": 0, 14 | "keepalive": 60, 15 | "remote_as": 7777, 16 | "local_port": 0, 17 | "active_prefix_count": 0, 18 | "configured_holdtime": 180, 19 | "routing_table": "default", 20 | "flap_count": 0, 21 | "suppressed_prefix_count": 0, 22 | "local_address": "0.0.0.0", 23 | "remote_port": 0, 24 | "input_updates": 0, 25 | "configured_keepalive": 60, 26 | "router_id": "0.0.0.0", 27 | "export_policy": "4-public-peer-anycast-out", 28 | "local_as": 13335, 29 | "remote_address": "9.10.11.12", 30 | "advertised_prefix_count": 0, 31 | "local_address_configured": false, 32 | "import_policy": "4-public-anycast-peers-in", 33 | "last_event": "", 34 | "accepted_prefix_count": 0, 35 | "up": false, 36 | "output_updates": 0, 37 | "received_prefix_count": 0, 38 | "holdtime": 180 39 | }, { 40 | "suppress_4byte_as": false, 41 | "local_as_prepend": true, 42 | "connection_state": "Idle", 43 | "multihop": true, 44 | "input_messages": 0, 45 | "previous_connection_state": "", 46 | "output_messages": 0, 47 | "remove_private_as": false, 48 | "multipath": false, 49 | "messages_queued_out": 0, 50 | "keepalive": 60, 51 | "remote_as": 7777, 52 | "local_port": 0, 53 | "active_prefix_count": 0, 54 | "configured_holdtime": 180, 55 | "routing_table": "default", 56 | "flap_count": 0, 57 | "suppressed_prefix_count": 0, 58 | "local_address": "0.0.0.0", 59 | "remote_port": 0, 60 | "input_updates": 0, 61 | "configured_keepalive": 60, 62 | "router_id": "0.0.0.0", 63 | "export_policy": "4-public-peer-anycast-out", 64 | "local_as": 13335, 65 | "remote_address": "30.30.30.30", 66 | "advertised_prefix_count": 0, 67 | "local_address_configured": false, 68 | "import_policy": "4-public-anycast-peers-in", 69 | "last_event": "", 70 | "accepted_prefix_count": 0, 71 | "up": false, 72 | "output_updates": 0, 73 | "received_prefix_count": 0, 74 | "holdtime": 180 75 | }], 76 | "1234": [{ 77 | "suppress_4byte_as": true, 78 | "local_as_prepend": true, 79 | "connection_state": "Established", 80 | "multihop": false, 81 | "input_messages": 94231366, 82 | "previous_connection_state": "OpenSent", 83 | "output_messages": 1009230, 84 | "remove_private_as": false, 85 | "multipath": false, 86 | "messages_queued_out": 0, 87 | "keepalive": 30, 88 | "remote_as": 1234, 89 | "local_port": 62349, 90 | "active_prefix_count": 273802, 91 | "configured_holdtime": 180, 92 | "routing_table": "default", 93 | "flap_count": 1, 94 | "suppressed_prefix_count": 9, 95 | "local_address": "20.20.20.21", 96 | "remote_port": 179, 97 | "input_updates": 0, 98 | "configured_keepalive": 60, 99 | "router_id": "1.2.3.4", 100 | "export_policy": "4-gtt-out", 101 | "local_as": 13335, 102 | "remote_address": "20.20.20.20", 103 | "advertised_prefix_count": 1348, 104 | "local_address_configured": false, 105 | "import_policy": "4-gtt-in", 106 | "last_event": "", 107 | "accepted_prefix_count": 588215, 108 | "up": true, 109 | "output_updates": 0, 110 | "received_prefix_count": 588224, 111 | "holdtime": 90 112 | }], 113 | "13335": [{ 114 | "suppress_4byte_as": false, 115 | "local_as_prepend": true, 116 | "connection_state": "Established", 117 | "multihop": false, 118 | "input_messages": 162901, 119 | "previous_connection_state": "Connect", 120 | "output_messages": 151392, 121 | "remove_private_as": false, 122 | "multipath": false, 123 | "messages_queued_out": 0, 124 | "keepalive": 60, 125 | "remote_as": 13335, 126 | "local_port": 179, 127 | "active_prefix_count": 0, 128 | "configured_holdtime": 180, 129 | "routing_table": "default", 130 | "flap_count": 3, 131 | "suppressed_prefix_count": 0, 132 | "local_address": "8.8.8.8", 133 | "remote_port": 63014, 134 | "input_updates": 0, 135 | "configured_keepalive": 60, 136 | "router_id": "5.6.7.8", 137 | "export_policy": "reject-all-out", 138 | "local_as": 13335, 139 | "remote_address": "5.6.7.8", 140 | "advertised_prefix_count": 0, 141 | "local_address_configured": false, 142 | "import_policy": "blackhole-rs-4-in", 143 | "last_event": "", 144 | "accepted_prefix_count": 316, 145 | "up": true, 146 | "output_updates": 0, 147 | "received_prefix_count": 316, 148 | "holdtime": 180 149 | }] 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_config/normal/_CLI__Configuration_show_configuration_merge__Configuration___CLI_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Building configuration... 4 | !! IOS XR Configuration version = 6.2.1.08I 5 | !! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant 6 | ! 7 | telnet vrf default ipv4 server max-servers 10 8 | username vagrant 9 | group root-lr 10 | group cisco-support 11 | secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/ 12 | ! 13 | tpa 14 | address-family ipv4 15 | update-source MgmtEth0/RP0/CPU0/0 16 | ! 17 | ! 18 | interface MgmtEth0/RP0/CPU0/0 19 | description testing parallel commits 20 | ipv4 address dhcp 21 | ! 22 | interface GigabitEthernet0/0/0/0 23 | shutdown 24 | ! 25 | interface GigabitEthernet0/0/0/1 26 | shutdown 27 | ! 28 | interface GigabitEthernet0/0/0/2 29 | shutdown 30 | ! 31 | interface GigabitEthernet0/0/0/3 32 | shutdown 33 | ! 34 | router static 35 | address-family ipv4 unicast 36 | 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2 37 | ! 38 | ! 39 | grpc 40 | port 57777 41 | ! 42 | xml agent tty 43 | iteration on size 1 44 | ! 45 | ssh server v2 46 | ssh server vrf default 47 | end 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_config/normal/_CLI__Configuration_show_running_config__Configuration___CLI_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Building configuration... 4 | !! IOS XR Configuration version = 6.2.1.08I 5 | !! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant 6 | ! 7 | telnet vrf default ipv4 server max-servers 10 8 | username vagrant 9 | group root-lr 10 | group cisco-support 11 | secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/ 12 | ! 13 | tpa 14 | address-family ipv4 15 | update-source MgmtEth0/RP0/CPU0/0 16 | ! 17 | ! 18 | interface MgmtEth0/RP0/CPU0/0 19 | description testing parallel commits 20 | ipv4 address dhcp 21 | ! 22 | interface GigabitEthernet0/0/0/0 23 | shutdown 24 | ! 25 | interface GigabitEthernet0/0/0/1 26 | shutdown 27 | ! 28 | interface GigabitEthernet0/0/0/2 29 | shutdown 30 | ! 31 | interface GigabitEthernet0/0/0/3 32 | shutdown 33 | ! 34 | router static 35 | address-family ipv4 unicast 36 | 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2 37 | ! 38 | ! 39 | grpc 40 | port 57777 41 | ! 42 | xml agent tty 43 | iteration on size 1 44 | ! 45 | ssh server v2 46 | ssh server vrf default 47 | end 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_config/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "running": "\n\nBuilding configuration...\n!! IOS XR Configuration version = 6.2.1.08I\n!! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant\n!\ntelnet vrf default ipv4 server max-servers 10\nusername vagrant\n group root-lr\n group cisco-support\n secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/\n!\ntpa\n address-family ipv4\n update-source MgmtEth0/RP0/CPU0/0\n !\n!\ninterface MgmtEth0/RP0/CPU0/0\n description testing parallel commits\n ipv4 address dhcp\n!\ninterface GigabitEthernet0/0/0/0\n shutdown\n!\ninterface GigabitEthernet0/0/0/1\n shutdown\n!\ninterface GigabitEthernet0/0/0/2\n shutdown\n!\ninterface GigabitEthernet0/0/0/3\n shutdown\n!\nrouter static\n address-family ipv4 unicast\n 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2\n !\n!\ngrpc\n port 57777\n!\nxml agent tty\n iteration on size 1\n!\nssh server v2\nssh server vrf default\nend\n\n\n", 3 | "startup": "", 4 | "candidate": "\n\nBuilding configuration...\n!! IOS XR Configuration version = 6.2.1.08I\n!! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant\n!\ntelnet vrf default ipv4 server max-servers 10\nusername vagrant\n group root-lr\n group cisco-support\n secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/\n!\ntpa\n address-family ipv4\n update-source MgmtEth0/RP0/CPU0/0\n !\n!\ninterface MgmtEth0/RP0/CPU0/0\n description testing parallel commits\n ipv4 address dhcp\n!\ninterface GigabitEthernet0/0/0/0\n shutdown\n!\ninterface GigabitEthernet0/0/0/1\n shutdown\n!\ninterface GigabitEthernet0/0/0/2\n shutdown\n!\ninterface GigabitEthernet0/0/0/3\n shutdown\n!\nrouter static\n address-family ipv4 unicast\n 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2\n !\n!\ngrpc\n port 57777\n!\nxml agent tty\n iteration on size 1\n!\nssh server v2\nssh server vrf default\nend\n\n\n" 5 | } 6 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_config_filtered/normal/_CLI__Configuration_show_configuration_merge__Configuration___CLI_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Building configuration... 4 | !! IOS XR Configuration version = 6.2.1.08I 5 | !! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant 6 | ! 7 | telnet vrf default ipv4 server max-servers 10 8 | username vagrant 9 | group root-lr 10 | group cisco-support 11 | secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/ 12 | ! 13 | tpa 14 | address-family ipv4 15 | update-source MgmtEth0/RP0/CPU0/0 16 | ! 17 | ! 18 | interface MgmtEth0/RP0/CPU0/0 19 | description testing parallel commits 20 | ipv4 address dhcp 21 | ! 22 | interface GigabitEthernet0/0/0/0 23 | shutdown 24 | ! 25 | interface GigabitEthernet0/0/0/1 26 | shutdown 27 | ! 28 | interface GigabitEthernet0/0/0/2 29 | shutdown 30 | ! 31 | interface GigabitEthernet0/0/0/3 32 | shutdown 33 | ! 34 | router static 35 | address-family ipv4 unicast 36 | 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2 37 | ! 38 | ! 39 | grpc 40 | port 57777 41 | ! 42 | xml agent tty 43 | iteration on size 1 44 | ! 45 | ssh server v2 46 | ssh server vrf default 47 | end 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_config_filtered/normal/_CLI__Configuration_show_running_config__Configuration___CLI_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Building configuration... 4 | !! IOS XR Configuration version = 6.2.1.08I 5 | !! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant 6 | ! 7 | telnet vrf default ipv4 server max-servers 10 8 | username vagrant 9 | group root-lr 10 | group cisco-support 11 | secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/ 12 | ! 13 | tpa 14 | address-family ipv4 15 | update-source MgmtEth0/RP0/CPU0/0 16 | ! 17 | ! 18 | interface MgmtEth0/RP0/CPU0/0 19 | description testing parallel commits 20 | ipv4 address dhcp 21 | ! 22 | interface GigabitEthernet0/0/0/0 23 | shutdown 24 | ! 25 | interface GigabitEthernet0/0/0/1 26 | shutdown 27 | ! 28 | interface GigabitEthernet0/0/0/2 29 | shutdown 30 | ! 31 | interface GigabitEthernet0/0/0/3 32 | shutdown 33 | ! 34 | router static 35 | address-family ipv4 unicast 36 | 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2 37 | ! 38 | ! 39 | grpc 40 | port 57777 41 | ! 42 | xml agent tty 43 | iteration on size 1 44 | ! 45 | ssh server v2 46 | ssh server vrf default 47 | end 48 | 49 | 50 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_config_filtered/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "running": "", 3 | "startup": "", 4 | "candidate": "\n\nBuilding configuration...\n!! IOS XR Configuration version = 6.2.1.08I\n!! Last configuration change at Wed Aug 17 16:49:00 2016 by vagrant\n!\ntelnet vrf default ipv4 server max-servers 10\nusername vagrant\n group root-lr\n group cisco-support\n secret 5 $1$gZpA$ued8wLDDwikqTVKTEvUe2/\n!\ntpa\n address-family ipv4\n update-source MgmtEth0/RP0/CPU0/0\n !\n!\ninterface MgmtEth0/RP0/CPU0/0\n description testing parallel commits\n ipv4 address dhcp\n!\ninterface GigabitEthernet0/0/0/0\n shutdown\n!\ninterface GigabitEthernet0/0/0/1\n shutdown\n!\ninterface GigabitEthernet0/0/0/2\n shutdown\n!\ninterface GigabitEthernet0/0/0/3\n shutdown\n!\nrouter static\n address-family ipv4 unicast\n 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 10.0.2.2\n !\n!\ngrpc\n port 57777\n!\nxml agent tty\n iteration on size 1\n!\nssh server v2\nssh server vrf default\nend\n\n\n" 5 | } 6 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_environment/normal/_Get__AdminOperational__MemorySummary_______________MemorySummary___AdminOperational___Get_.txt: -------------------------------------------------------------------------------- 1 | 0RSP0CPU0409664424509443412946944615861645234129469448201193282011932134217728000RSP1CPU040966442450944341294694461586164524452450304820119328201193213421772800 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_environment/normal/_Get__Operational__SystemTime___PlatformInventory____________Operational___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 2016 9 | 10 | 11 | 7 12 | 13 | 14 | 12 15 | 16 | 17 | 10 18 | 19 | 20 | 5 21 | 22 | 23 | 54 24 | 25 | 26 | 804 27 | 28 | 29 | UTC 30 | 31 | 32 | NTP 33 | 34 | 35 | 36 | 37 | edge01.tab01 38 | 39 | 40 | 35457914 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 0 50 | 51 | 52 | 53 | 54 | 55 | chassis ASR-9904-AC 56 | 57 | 58 | ASR 9904 2 Line Card Slot Chassis with V2 AC PEM 59 | 60 | 61 | ASR-9904-AC 62 | 63 | 64 | V01 65 | 66 | 67 | FOX1717PLM4 68 | 69 | 70 | 5.3.1 71 | 72 | 73 | 1.3.6.1.4.1.9.12.3.1.3.1301 74 | 75 | 76 | true 77 | 78 | 79 | 80 | 81 | ADMIN_STATE_INVALID 82 | 83 | 84 | ADMIN_POWER_INVALID 85 | 86 | 87 | INV_CARD_NOT_PRESENT 88 | 89 | 90 | UNMONITORED 91 | 92 | 93 | MODULE_RESET_REASON_UNKNOWN 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 0 101 | 102 | 103 | 104 | 105 | 0 106 | 107 | 108 | 0 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_environment/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "fans": { 3 | "FT1": { 4 | "status": true 5 | }, 6 | "FT0": { 7 | "status": true 8 | } 9 | }, 10 | "cpu": { 11 | "0/RSP0/CPU0": { 12 | "%usage": 3.0 13 | }, 14 | "0/2/CPU0": { 15 | "%usage": 3.0 16 | }, 17 | "0/RSP1/CPU0": { 18 | "%usage": 1.0 19 | }, 20 | "0/3/CPU0": { 21 | "%usage": 29.0 22 | }, 23 | "0/0/CPU0": { 24 | "%usage": 3.0 25 | }, 26 | "0/1/CPU0": { 27 | "%usage": 3.0 28 | } 29 | }, 30 | "temperature": { 31 | "FT1": { 32 | "is_alert": false, 33 | "temperature": 31.5, 34 | "is_critical": false 35 | }, 36 | "FT0": { 37 | "is_alert": false, 38 | "temperature": 31.4, 39 | "is_critical": false 40 | }, 41 | "RSP1": { 42 | "is_alert": false, 43 | "temperature": 33.8, 44 | "is_critical": false 45 | }, 46 | "RSP0": { 47 | "is_alert": false, 48 | "temperature": 33.8, 49 | "is_critical": false 50 | }, 51 | "1": { 52 | "is_alert": false, 53 | "temperature": 38.7, 54 | "is_critical": false 55 | }, 56 | "0": { 57 | "is_alert": false, 58 | "temperature": 38.7, 59 | "is_critical": false 60 | } 61 | }, 62 | "power": { 63 | "PM0": { 64 | "status": true, 65 | "output": 448.26848, 66 | "capacity": 3000.0 67 | } 68 | }, 69 | "memory": { 70 | "available_ram": 6158616452, 71 | "used_ram": 2745669508 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_facts/normal/_Get__Operational__SystemTime___PlatformInventory____________Operational___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 2016 9 | 10 | 11 | 7 12 | 13 | 14 | 12 15 | 16 | 17 | 10 18 | 19 | 20 | 5 21 | 22 | 23 | 54 24 | 25 | 26 | 804 27 | 28 | 29 | UTC 30 | 31 | 32 | NTP 33 | 34 | 35 | 36 | 37 | edge01.tab01 38 | 39 | 40 | 35457914 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 0 50 | 51 | 52 | 53 | 54 | 55 | chassis ASR-9904-AC 56 | 57 | 58 | ASR 9904 2 Line Card Slot Chassis with V2 AC PEM 59 | 60 | 61 | ASR-9904-AC 62 | 63 | 64 | V01 65 | 66 | 67 | FOX1717PLM4 68 | 69 | 70 | 5.3.1 71 | 72 | 73 | 1.3.6.1.4.1.9.12.3.1.3.1301 74 | 75 | 76 | true 77 | 78 | 79 | 80 | 81 | ADMIN_STATE_INVALID 82 | 83 | 84 | ADMIN_POWER_INVALID 85 | 86 | 87 | INV_CARD_NOT_PRESENT 88 | 89 | 90 | UNMONITORED 91 | 92 | 93 | MODULE_RESET_REASON_UNKNOWN 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 0 101 | 102 | 103 | 104 | 105 | 0 106 | 107 | 108 | 0 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_facts/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "uptime": 35457914, 3 | "vendor": "Cisco", 4 | "hostname": "edge01.tab01", 5 | "fqdn": "edge01.tab01", 6 | "os_version": "5.3.1", 7 | "serial_number": "FOX1717PLM4", 8 | "interface_list": ["TenGigE0/0/0/13", "TenGigE0/0/0/14", "TenGigE0/0/0/24"], 9 | "model": "ASR-9904-AC" 10 | } 11 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_firewall_policies/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_interfaces/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "TenGigE0/0/0/14": { 3 | "is_enabled": false, 4 | "description": "", 5 | "last_flapped": -1.0, 6 | "is_up": false, 7 | "mac_address": "E0:AC:F1:64:71:52", 8 | "speed": 10000 9 | }, 10 | "TenGigE0/0/0/24": { 11 | "is_enabled": false, 12 | "description": "", 13 | "last_flapped": -1.0, 14 | "is_up": false, 15 | "mac_address": "E0:AC:F1:64:71:5C", 16 | "speed": 10000 17 | }, 18 | "TenGigE0/0/0/13": { 19 | "is_enabled": false, 20 | "description": "", 21 | "last_flapped": -1.0, 22 | "is_up": false, 23 | "mac_address": "E0:AC:F1:64:71:51", 24 | "speed": 10000 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_interfaces_ip/normal/_Get__Operational__IPV4Network___IPV4Network__________IPV6Network___IPV6Network___Operational___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | BVI10default10.49.8.11610612736Up192.168.0.11610612736Up210224.0.0.2224.0.0.11500truefalsefalsefalsefalsetruetruefalsefalsefalseStrictfalsefalsefalsefalsefalsefalsefalsefalseBVI100default172.17.17.11610612736Up192.168.21.11610612736Up24100224.0.0.2224.0.0.11500truefalsefalsefalsefalsetrue
172.17.18.1
24100
192.168.23.1
24100
truefalsefalsefalseStrictfalsefalsefalsefalsefalsefalsefalsefalse
0RSP0CPU0400000000defaultBVI100Up
FF02::5
FF02::5
FF02::5
FF02::5
1500OperUp
2400:cb00:49:1024::1
64Activefalse0
FE80::5A0A:20FF:FEEB:91E4
128Activefalse0
truefalsefalsefalse00falsefalse0falsefalsefalsetruefalsefalse
Bundle-Ether2Up
FF02::8
FF02::9
FF02::5
FF02::5
1500OperUp
2001:db8::
126Activefalse0
FE80::2237:06FF:FECF:67E4
128Activefalse0
6-transit-intruefalsefalsefalse00falsefalse0falsefalsefalsetruefalsefalse
3 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_interfaces_ip/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bundle-Ether2": { 3 | "ipv6": { 4 | "2001:db8::": { 5 | "prefix_length": 126 6 | } 7 | } 8 | }, 9 | "BVI10": { 10 | "ipv4": { 11 | "192.168.0.1": { 12 | "prefix_length": 21 13 | } 14 | } 15 | }, 16 | "BVI100": { 17 | "ipv4": { 18 | "192.168.21.1": { 19 | "prefix_length": 24 20 | }, 21 | "192.168.23.1": { 22 | "prefix_length": 24 23 | }, 24 | "172.17.18.1": { 25 | "prefix_length": 24 26 | } 27 | }, 28 | "ipv6": { 29 | "2400:cb00:49:1024::1": { 30 | "prefix_length": 64 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_lldp_neighbors/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "Gi0/0/0/0": [{ 3 | "hostname": "precise64", 4 | "port": "0800.27f3.3c29" 5 | }], 6 | "Gi0/0/0/1": [{ 7 | "hostname": "precise64", 8 | "port": "0800.275d.d2a8" 9 | }] 10 | } 11 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_lldp_neighbors/normal/show_lldp_neighbors.txt: -------------------------------------------------------------------------------- 1 | Capability codes: 2 | (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device 3 | (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other 4 | 5 | Device ID Local Intf Hold-time Capability Port ID 6 | precise64 Gi0/0/0/0 120 N/A 0800.27f3.3c29 7 | precise64 Gi0/0/0/1 120 N/A 0800.275d.d2a8 8 | 9 | Total entries displayed: 2 10 | 11 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_lldp_neighbors_detail/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "TenGigE0/0/0/8": [{ 3 | "remote_port_description": "Ethernet2/2/1", 4 | "remote_port": "Eth2/2/1", 5 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.1(0)N1(1a)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2015, Cisco Systems, Inc. All rights reserved.", 6 | "remote_chassis_id": "8C:60:4F:69:E9:6C", 7 | "remote_system_name": "core04.yyz01.as13335.net", 8 | "parent_interface": "Bundle-Ether8", 9 | "remote_system_capab": "B", 10 | "remote_system_enable_capab": "B" 11 | }], 12 | "TenGigE0/0/0/4": [{ 13 | "remote_port_description": "Ethernet2/1/1", 14 | "remote_port": "Eth2/1/1", 15 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.0(5)N1(1)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2014, Cisco Systems, Inc. All rights reserved.", 16 | "remote_chassis_id": "8C:60:4F:35:61:58", 17 | "remote_system_name": "core03.yyz01.as13335.com", 18 | "parent_interface": "Bundle-Ether3", 19 | "remote_system_capab": "B", 20 | "remote_system_enable_capab": "B" 21 | }], 22 | "TenGigE0/0/0/5": [{ 23 | "remote_port_description": "xe-0/1/1.0", 24 | "remote_port": "602", 25 | "remote_system_description": "Juniper Networks, Inc. ex4200-48t , version 11.4R2.14 Build date: 2012-03-17 17:46:53 UTC", 26 | "remote_chassis_id": "78:FE:3D:EC:92:80", 27 | "remote_system_name": "core01.yyz01", 28 | "parent_interface": "Bundle-Ether1", 29 | "remote_system_capab": "B,R", 30 | "remote_system_enable_capab": "B,R" 31 | }], 32 | "TenGigE0/0/0/2": [{ 33 | "remote_port_description": "PN Switch Port(9)", 34 | "remote_port": "9", 35 | "remote_system_description": "", 36 | "remote_chassis_id": "0a000196", 37 | "remote_system_name": "core02.yyz01", 38 | "parent_interface": "Bundle-Ether2", 39 | "remote_system_capab": "B,R", 40 | "remote_system_enable_capab": "B" 41 | }], 42 | "TenGigE0/0/0/3": [{ 43 | "remote_port_description": "xe-0/1/0.0", 44 | "remote_port": "601", 45 | "remote_system_description": "Juniper Networks, Inc. ex4200-48t , version 11.4R2.14 Build date: 2012-03-17 17:46:53 UTC", 46 | "remote_chassis_id": "78:FE:3D:EC:92:80", 47 | "remote_system_name": "core01.yyz01", 48 | "parent_interface": "Bundle-Ether1", 49 | "remote_system_capab": "B,R", 50 | "remote_system_enable_capab": "B,R" 51 | }], 52 | "TenGigE0/0/0/16": [{ 53 | "remote_port_description": "Ethernet2/1/2", 54 | "remote_port": "Eth2/1/2", 55 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.0(5)N1(1)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2014, Cisco Systems, Inc. All rights reserved.", 56 | "remote_chassis_id": "8C:60:4F:35:61:59", 57 | "remote_system_name": "core03.yyz01.as13335.com", 58 | "parent_interface": "Bundle-Ether3", 59 | "remote_system_capab": "B", 60 | "remote_system_enable_capab": "B" 61 | }], 62 | "TenGigE0/0/0/17": [{ 63 | "remote_port_description": "PN Switch Port(64)", 64 | "remote_port": "64", 65 | "remote_system_description": "", 66 | "remote_chassis_id": "0a000196", 67 | "remote_system_name": "core02.yyz01", 68 | "parent_interface": "Bundle-Ether2", 69 | "remote_system_capab": "B,R", 70 | "remote_system_enable_capab": "B" 71 | }], 72 | "TenGigE0/0/0/14": [{ 73 | "remote_port_description": "PN Switch Port(63)", 74 | "remote_port": "63", 75 | "remote_system_description": "", 76 | "remote_chassis_id": "0a000196", 77 | "remote_system_name": "core02.yyz01", 78 | "parent_interface": "Bundle-Ether2", 79 | "remote_system_capab": "B,R", 80 | "remote_system_enable_capab": "B" 81 | }], 82 | "TenGigE0/0/0/15": [{ 83 | "remote_port_description": "xe-1/1/0.0", 84 | "remote_port": "656", 85 | "remote_system_description": "Juniper Networks, Inc. ex4200-48t , version 11.4R2.14 Build date: 2012-03-17 17:46:53 UTC", 86 | "remote_chassis_id": "78:FE:3D:EC:92:80", 87 | "remote_system_name": "core01.yyz01", 88 | "parent_interface": "Bundle-Ether1", 89 | "remote_system_capab": "B,R", 90 | "remote_system_enable_capab": "B,R" 91 | }], 92 | "TenGigE0/0/0/28": [{ 93 | "remote_port_description": "Ethernet2/1/4", 94 | "remote_port": "Eth2/1/4", 95 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.0(5)N1(1)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2014, Cisco Systems, Inc. All rights reserved.", 96 | "remote_chassis_id": "8C:60:4F:35:61:5B", 97 | "remote_system_name": "core03.yyz01.as13335.com", 98 | "parent_interface": "Bundle-Ether3", 99 | "remote_system_capab": "B", 100 | "remote_system_enable_capab": "B" 101 | }], 102 | "TenGigE0/0/0/27": [{ 103 | "remote_port_description": "Ethernet2/1/3", 104 | "remote_port": "Eth2/1/3", 105 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.0(5)N1(1)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2014, Cisco Systems, Inc. All rights reserved.", 106 | "remote_chassis_id": "8C:60:4F:35:61:5A", 107 | "remote_system_name": "core03.yyz01.as13335.com", 108 | "parent_interface": "Bundle-Ether3", 109 | "remote_system_capab": "B", 110 | "remote_system_enable_capab": "B" 111 | }], 112 | "TenGigE0/0/0/25": [{ 113 | "remote_port_description": "PN Switch Port(10)", 114 | "remote_port": "10", 115 | "remote_system_description": "", 116 | "remote_chassis_id": "0a000196", 117 | "remote_system_name": "core02.yyz01", 118 | "parent_interface": "Bundle-Ether2", 119 | "remote_system_capab": "B,R", 120 | "remote_system_enable_capab": "B" 121 | }], 122 | "TenGigE0/0/0/30": [{ 123 | "remote_port_description": "Ethernet2/2/3", 124 | "remote_port": "Eth2/2/3", 125 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.1(0)N1(1a)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2015, Cisco Systems, Inc. All rights reserved.", 126 | "remote_chassis_id": "8C:60:4F:69:E9:6E", 127 | "remote_system_name": "core04.yyz01.as13335.net", 128 | "parent_interface": "Bundle-Ether8", 129 | "remote_system_capab": "B", 130 | "remote_system_enable_capab": "B" 131 | }], 132 | "TenGigE0/0/0/32": [{ 133 | "remote_port_description": "Ethernet2/2/4", 134 | "remote_port": "Eth2/2/4", 135 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.1(0)N1(1a)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2015, Cisco Systems, Inc. All rights reserved.", 136 | "remote_chassis_id": "8C:60:4F:69:E9:6F", 137 | "remote_system_name": "core04.yyz01.as13335.net", 138 | "parent_interface": "Bundle-Ether8", 139 | "remote_system_capab": "B", 140 | "remote_system_enable_capab": "B" 141 | }], 142 | "TenGigE0/0/0/19": [{ 143 | "remote_port_description": "Ethernet2/2/2", 144 | "remote_port": "Eth2/2/2", 145 | "remote_system_description": "Cisco Nexus Operating System (NX-OS) Software 7.1(0)N1(1a)\nTAC support: http://www.cisco.com/tac\nCopyright (c) 2002-2015, Cisco Systems, Inc. All rights reserved.", 146 | "remote_chassis_id": "8C:60:4F:69:E9:6D", 147 | "remote_system_name": "core04.yyz01.as13335.net", 148 | "parent_interface": "Bundle-Ether8", 149 | "remote_system_capab": "B", 150 | "remote_system_enable_capab": "B" 151 | }] 152 | } 153 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_network_instances/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_ntp_peers/normal/_Get__Configuration__NTP___NTP___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | default 11 | 12 | 13 | 14 | 15 | 16 | 17 | 1.2.3.4 18 | 19 | 20 | 21 | 22 | 23 | Server 24 | 25 | 26 | 27 | Prefer 28 | 29 | 30 | 31 | 32 | 33 | 34 | 5.6.7.8 35 | 36 | 37 | 38 | 39 | 40 | Server 41 | 42 | 43 | 44 | Prefer 45 | 46 | 47 | 48 | 49 | 50 | 51 | 9.10.11.12 52 | 53 | 54 | 55 | 56 | 57 | Peer 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 13.14.15.16 66 | 67 | 68 | 69 | 70 | 71 | Peer 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | default 84 | 85 | 86 | 87 | Loopback0 88 | 89 | 90 | 91 | 92 | true 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_ntp_peers/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "13.14.15.16": {}, 3 | "9.10.11.12": {} 4 | } 5 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_ntp_servers/normal/_Get__Configuration__NTP___NTP___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | default 11 | 12 | 13 | 14 | 15 | 16 | 17 | 1.2.3.4 18 | 19 | 20 | 21 | 22 | 23 | Server 24 | 25 | 26 | 27 | Prefer 28 | 29 | 30 | 31 | 32 | 33 | 34 | 5.6.7.8 35 | 36 | 37 | 38 | 39 | 40 | Server 41 | 42 | 43 | 44 | Prefer 45 | 46 | 47 | 48 | 49 | 50 | 51 | 9.10.11.12 52 | 53 | 54 | 55 | 56 | 57 | Peer 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 13.14.15.16 66 | 67 | 68 | 69 | 70 | 71 | Peer 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | default 84 | 85 | 86 | 87 | Loopback0 88 | 89 | 90 | 91 | 92 | true 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_ntp_servers/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "1.2.3.4": {}, 3 | "5.6.7.8": {} 4 | } 5 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_optics/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_probes_config/normal/_Get__Configuration__IPSLA___IPSLA___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 1 12 | 13 | 14 | 15 | 16 | 17 | true 18 | 19 | 20 | test-GT-4 21 | 22 | 23 | 24 | 1 25 | 26 | 27 | All 28 | 29 | 30 | 20 31 | 32 | 33 | 34 | 1.1.1.1.1 35 | 36 | 37 | 2.2.2.2 38 | 39 | 40 | 2000 41 | 42 | 43 | 3 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 2 52 | 53 | 54 | 55 | 56 | 57 | true 58 | 59 | 60 | sjc01-TE-4 61 | 62 | 63 | 64 | 1 65 | 66 | 67 | All 68 | 69 | 70 | 20 71 | 72 | 73 | 74 | 3.3.3.3 75 | 76 | 77 | 4.4.4.4 78 | 79 | 80 | 2000 81 | 82 | 83 | 3 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 1 94 | 95 | 96 | 97 | 98 | Now 99 | 100 | 101 | 102 | Forever 103 | 104 | 105 | 106 | 107 | 108 | 2 109 | 110 | 111 | 112 | 113 | Now 114 | 115 | 116 | 117 | Forever 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_probes_config/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "1": { 3 | "test-GT-4": { 4 | "source": "1.1.1.1.1", 5 | "probe_type": "icmp-ping", 6 | "target": "2.2.2.2", 7 | "test_interval": 3, 8 | "probe_count": 20 9 | } 10 | }, 11 | "2": { 12 | "sjc01-TE-4": { 13 | "source": "3.3.3.3", 14 | "probe_type": "icmp-ping", 15 | "target": "4.4.4.4", 16 | "test_interval": 3, 17 | "probe_count": 20 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_probes_results/normal/_Get__Configuration__IPSLA___IPSLA___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 1 12 | 13 | 14 | 15 | 16 | 17 | true 18 | 19 | 20 | test-GT-4 21 | 22 | 23 | 24 | 1 25 | 26 | 27 | All 28 | 29 | 30 | 20 31 | 32 | 33 | 34 | 1.1.1.1.1 35 | 36 | 37 | 2.2.2.2 38 | 39 | 40 | 2000 41 | 42 | 43 | 3 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 2 52 | 53 | 54 | 55 | 56 | 57 | true 58 | 59 | 60 | sjc01-TE-4 61 | 62 | 63 | 64 | 1 65 | 66 | 67 | All 68 | 69 | 70 | 20 71 | 72 | 73 | 74 | 3.3.3.3 75 | 76 | 77 | 4.4.4.4 78 | 79 | 80 | 2000 81 | 82 | 83 | 3 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 1 94 | 95 | 96 | 97 | 98 | Now 99 | 100 | 101 | 102 | Forever 103 | 104 | 105 | 106 | 107 | 108 | 2 109 | 110 | 111 | 112 | 113 | Now 114 | 115 | 116 | 117 | Forever 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_probes_results/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "1": { 3 | "test-GT-4": { 4 | "last_test_min_delay": 87.0, 5 | "global_test_min_delay": 86.0, 6 | "target": "", 7 | "global_test_max_delay": 159.0, 8 | "probe_type": "icmp-ping", 9 | "global_test_avg_delay": 88.62016806722689, 10 | "last_test_avg_delay": 87.0, 11 | "current_test_min_delay": 0.0, 12 | "last_test_max_delay": 87.0, 13 | "current_test_max_delay": 0.0, 14 | "last_test_loss": 0, 15 | "rtt": 87.15, 16 | "source": "1.1.1.1.1", 17 | "round_trip_jitter": -1.7033112740867153, 18 | "probe_count": 20, 19 | "current_test_avg_delay": 0.0 20 | } 21 | }, 22 | "2": { 23 | "sjc01-TE-4": { 24 | "last_test_min_delay": 1.0, 25 | "global_test_min_delay": 1.0, 26 | "target": "", 27 | "global_test_max_delay": 1.0, 28 | "probe_type": "icmp-ping", 29 | "global_test_avg_delay": 1.0, 30 | "last_test_avg_delay": 1.0, 31 | "current_test_min_delay": 0.0, 32 | "last_test_max_delay": 1.0, 33 | "current_test_max_delay": 0.0, 34 | "last_test_loss": 0, 35 | "rtt": 1.0, 36 | "source": "3.3.3.3", 37 | "round_trip_jitter": 0.0, 38 | "probe_count": 20, 39 | "current_test_avg_delay": 0.0 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_route_to/SR638170159/_Get__Operational__IPV6_RIB__VRFTable__VRF__Naming__VRFName_default______________VRFName___Naming__AFTable__AF__Naming__AFName_IPv6__AFName___Naming__SAFTa.txt: -------------------------------------------------------------------------------- 1 | defaultIPv6Unicastdefault
dead:beef:210:210::53
2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_route_to/SR638170159/_Get__Operational__RIB__VRFTable__VRF__Naming__VRFName_default______________VRFName___Naming__AFTable__AF__Naming__AFName_IPv4__AFName___Naming__SAFTa.txt: -------------------------------------------------------------------------------- 1 | defaultIPv4Unicastdefault
1.0.4.0
24
1.0.4.024493bgp13335141024121512693920001483664025525500truefalse18048051048577491881795201453752883323041839
37.49.232.13
37.49.232.13::None00973297320false000104857700000falsefalsefalsefalsefalsefalse0000.0.0.00.0.0.0false0000
2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_route_to/SR638170159/expected_result.json: -------------------------------------------------------------------------------- 1 | {"1.0.4.0/24": [{"protocol": "bgp", "outgoing_interface": "", "age": 1804805, "current_active": true, "routing_table": "default", "last_active": false, "protocol_attributes": {}, "next_hop": "37.49.232.13", "selected_next_hop": false, "inactive_reason": "", "preference": 12}]} 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_snmp_information/normal/_Get__Configuration__SNMP___SNMP___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | hackme 12 | 13 | 14 | 15 | ReadOnly 16 | 17 | 18 | ifyoucan 19 | 20 | 21 | 22 | 23 | 24 | 25 | edge01.yyz01 26 | 27 | 28 | noc@cloudflare.com 29 | 30 | 31 | Toronto, Canada 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_snmp_information/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "contact": "noc@cloudflare.com", 3 | "location": "Toronto, Canada", 4 | "community": { 5 | "hackme": { 6 | "mode": "ro", 7 | "acl": "ifyoucan" 8 | } 9 | }, 10 | "chassis_id": "edge01.yyz01" 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_users/normal/_Get__Configuration__AAA___AAA___Configuration___Get_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | default 12 | 13 | 14 | 15 | Loopback0 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 1 24 | 25 | 26 | 27 | 192.168.0.1 28 | 29 | 30 | 31 | 49 32 | 33 | 34 | 35 | true 36 | 37 | 38 | 39 | true 40 | 41 | 42 | 23HY2342423B42JK3H4JK 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | dummy-test 53 | 54 | 55 | 56 | true 57 | 58 | 59 | 60 | 61 | 62 | root-system 63 | 64 | 65 | 66 | true 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | dummy-test2 75 | 76 | 77 | 78 | true 79 | 80 | 81 | 82 | 83 | 84 | root-system 85 | 86 | 87 | 88 | true 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_get_users/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | { 2 | "dummy-test2": { 3 | "password": "", 4 | "sshkeys": [], 5 | "level": 15 6 | }, 7 | "dummy-test": { 8 | "password": "", 9 | "sshkeys": [], 10 | "level": 15 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_is_alive/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | {"is_alive": true} 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_ping/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_traceroute/normal/_Set__Action__TraceRoute__IPV4__Destination_8_8_8_8__________Destination__MaxTTL_255__MaxTTL__Timeout_2__Timeout___IPV4___TraceRoute___Action_________.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 8.8.8.8 9 | 10 | 11 | 1 12 | 13 | 14 | 127.0.0.1 15 | 16 | 17 | 18 | 8.8.8.8 19 | 20 | 21 | 22 | 0 23 | 24 | 25 | * 26 | 27 | 28 | 29 | 2 30 | 31 | 32 | tor10.ip4.gtt.net 33 | 34 | 35 | 1.1.1.1 36 | 37 | 38 | 39 | 0 40 | 41 | 42 | 0 43 | 44 | 45 | 46 | 3 47 | 48 | 49 | tcore5.TNK-Toronto.as6453.net 50 | 51 | 52 | 2.2.2.2 53 | 54 | 55 | 56 | 0 57 | 58 | 59 | 186 60 | 61 | 62 | 63 | 0 64 | 65 | 66 | * 67 | 68 | 69 | 70 | 5 71 | 72 | 73 | tcore22.SQN-San-Jose.as6453.net 74 | 75 | 76 | 3.3.3.3 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 192 84 | 85 | 86 | 87 | 6 88 | 89 | 90 | tcore0.PDI-Palo-Alto.as6453.net 91 | 92 | 93 | 4.4.4.4 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 169 101 | 102 | 103 | 104 | 7 105 | 106 | 107 | tcore17.TV2-Tokyo.as6453.net 108 | 109 | 110 | 5.5.5.5 111 | 112 | 113 | 114 | 0 115 | 116 | 117 | 189 118 | 119 | 120 | 121 | 8 122 | 123 | 124 | tcore7.TV2-Tokyo.as6453.net 125 | 126 | 127 | 6.6.6.6 128 | 129 | 130 | 131 | 0 132 | 133 | 134 | 186 135 | 136 | 137 | 138 | 9 139 | 140 | 141 | 8.8.8.8 142 | 143 | 144 | 145 | 0 146 | 147 | 148 | 199 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_traceroute/normal/_Set__Action__TraceRoute__IPV4__Destination_8_8_8_8__________Destination___IPV4___TraceRoute___Action___________Set_.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 8.8.8.8 9 | 10 | 11 | 1 12 | 13 | 14 | 127.0.0.1 15 | 16 | 17 | 18 | 8.8.8.8 19 | 20 | 21 | 22 | 0 23 | 24 | 25 | * 26 | 27 | 28 | 29 | 2 30 | 31 | 32 | tor10.ip4.gtt.net 33 | 34 | 35 | 1.1.1.1 36 | 37 | 38 | 39 | 0 40 | 41 | 42 | 0 43 | 44 | 45 | 46 | 3 47 | 48 | 49 | tcore5.TNK-Toronto.as6453.net 50 | 51 | 52 | 2.2.2.2 53 | 54 | 55 | 56 | 0 57 | 58 | 59 | 186 60 | 61 | 62 | 63 | 0 64 | 65 | 66 | * 67 | 68 | 69 | 70 | 5 71 | 72 | 73 | tcore22.SQN-San-Jose.as6453.net 74 | 75 | 76 | 3.3.3.3 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 192 84 | 85 | 86 | 87 | 6 88 | 89 | 90 | tcore0.PDI-Palo-Alto.as6453.net 91 | 92 | 93 | 4.4.4.4 94 | 95 | 96 | 97 | 0 98 | 99 | 100 | 169 101 | 102 | 103 | 104 | 7 105 | 106 | 107 | tcore17.TV2-Tokyo.as6453.net 108 | 109 | 110 | 5.5.5.5 111 | 112 | 113 | 114 | 0 115 | 116 | 117 | 189 118 | 119 | 120 | 121 | 8 122 | 123 | 124 | tcore7.TV2-Tokyo.as6453.net 125 | 126 | 127 | 6.6.6.6 128 | 129 | 130 | 131 | 0 132 | 133 | 134 | 186 135 | 136 | 137 | 138 | 9 139 | 140 | 141 | 8.8.8.8 142 | 143 | 144 | 145 | 0 146 | 147 | 148 | 199 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /test/unit/mocked_data/test_traceroute/normal/expected_result.json: -------------------------------------------------------------------------------- 1 | {"success": {"1": {"probes": {"1": {"rtt": 2000.0, "ip_address": "*", "host_name": "*"}}}, "3": {"probes": {"1": {"rtt": 2000.0, "ip_address": "2.2.2.2", "host_name": "tcore5.TNK-Toronto.as6453.net"}}}, "2": {"probes": {"1": {"rtt": 0.0, "ip_address": "1.1.1.1", "host_name": "tor10.ip4.gtt.net"}}}, "5": {"probes": {"1": {"rtt": 192.0, "ip_address": "3.3.3.3", "host_name": "tcore22.SQN-San-Jose.as6453.net"}}}, "7": {"probes": {"1": {"rtt": 189.0, "ip_address": "5.5.5.5", "host_name": "tcore17.TV2-Tokyo.as6453.net"}}}, "6": {"probes": {"1": {"rtt": 169.0, "ip_address": "4.4.4.4", "host_name": "tcore0.PDI-Palo-Alto.as6453.net"}}}, "9": {"probes": {"1": {"rtt": 199.0, "ip_address": "8.8.8.8", "host_name": "8.8.8.8"}}}, "8": {"probes": {"1": {"rtt": 186.0, "ip_address": "6.6.6.6", "host_name": "tcore7.TV2-Tokyo.as6453.net"}}}}} 2 | -------------------------------------------------------------------------------- /test/unit/test_getters.py: -------------------------------------------------------------------------------- 1 | """Tests for getters.""" 2 | from __future__ import print_function 3 | from __future__ import unicode_literals 4 | 5 | from napalm_base.test.getters import BaseTestGetters 6 | 7 | 8 | import pytest 9 | 10 | 11 | @pytest.mark.usefixtures("set_device_parameters") 12 | class TestGetter(BaseTestGetters): 13 | """Test get_* methods.""" 14 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27,py34,py35 3 | 4 | [testenv] 5 | deps = 6 | -rrequirements-dev.txt 7 | 8 | commands= 9 | py.test 10 | --------------------------------------------------------------------------------