cisco_node_utils_mgx 2.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.rubocop.yml +96 -0
- data/.travis.yml +17 -0
- data/CHANGELOG.md +676 -0
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +10 -0
- data/LICENSE +201 -0
- data/README.md +246 -0
- data/Rakefile +44 -0
- data/SUPPORT.md +3 -0
- data/bin/.rubocop.yml +18 -0
- data/bin/check_metric_limits.rb +109 -0
- data/bin/git/hooks/commit-msg/enforce_style +89 -0
- data/bin/git/hooks/hook_lib +115 -0
- data/bin/git/hooks/hooks-wrapper +38 -0
- data/bin/git/hooks/post-flow-hotfix-start/update-version +24 -0
- data/bin/git/hooks/post-flow-release-finish/update-version +29 -0
- data/bin/git/hooks/post-flow-release-start/update-version +19 -0
- data/bin/git/hooks/post-merge/update-hooks +6 -0
- data/bin/git/hooks/post-rewrite/update-hooks +6 -0
- data/bin/git/hooks/pre-commit/check_unstaged_changes +18 -0
- data/bin/git/hooks/pre-commit/rubocop +25 -0
- data/bin/git/hooks/pre-commit/validate-diffs +45 -0
- data/bin/git/hooks/pre-commit/validate-yaml +18 -0
- data/bin/git/hooks/pre-push/check-changelog +24 -0
- data/bin/git/hooks/pre-push/rubocop +7 -0
- data/bin/git/update-hooks +123 -0
- data/bin/show_running_yang.rb +233 -0
- data/cisco_node_utils.gemspec +41 -0
- data/docs/README-develop-best-practices.md +521 -0
- data/docs/README-develop-node-utils-APIs.md +570 -0
- data/docs/README-maintainers.md +77 -0
- data/docs/README-test-execution.md +57 -0
- data/docs/README-utilities.md +14 -0
- data/docs/agent_files.png +0 -0
- data/docs/cisco_node_utils.yaml.example +36 -0
- data/docs/template-router.rb +123 -0
- data/docs/template-test_router.rb +104 -0
- data/ext/mkrf_conf.rb +63 -0
- data/lib/.rubocop.yml +18 -0
- data/lib/cisco_node_utils/aaa_authentication_login.rb +95 -0
- data/lib/cisco_node_utils/aaa_authentication_login_service.rb +138 -0
- data/lib/cisco_node_utils/aaa_authorization_service.rb +156 -0
- data/lib/cisco_node_utils/ace.rb +467 -0
- data/lib/cisco_node_utils/acl.rb +101 -0
- data/lib/cisco_node_utils/banner.rb +63 -0
- data/lib/cisco_node_utils/bfd_global.rb +305 -0
- data/lib/cisco_node_utils/bgp.rb +988 -0
- data/lib/cisco_node_utils/bgp_af.rb +545 -0
- data/lib/cisco_node_utils/bgp_af_aggr_addr.rb +207 -0
- data/lib/cisco_node_utils/bgp_neighbor.rb +527 -0
- data/lib/cisco_node_utils/bgp_neighbor_af.rb +780 -0
- data/lib/cisco_node_utils/bridge_domain.rb +178 -0
- data/lib/cisco_node_utils/bridge_domain_vni.rb +206 -0
- data/lib/cisco_node_utils/cisco_cmn_utils.rb +444 -0
- data/lib/cisco_node_utils/client/client.rb +238 -0
- data/lib/cisco_node_utils/client/grpc/client.rb +395 -0
- data/lib/cisco_node_utils/client/grpc/ems.proto +148 -0
- data/lib/cisco_node_utils/client/grpc/ems.rb +111 -0
- data/lib/cisco_node_utils/client/grpc/ems_services.rb +49 -0
- data/lib/cisco_node_utils/client/grpc.rb +33 -0
- data/lib/cisco_node_utils/client/nxapi/client.rb +368 -0
- data/lib/cisco_node_utils/client/nxapi.rb +31 -0
- data/lib/cisco_node_utils/client/utils.rb +180 -0
- data/lib/cisco_node_utils/client.rb +35 -0
- data/lib/cisco_node_utils/cmd_ref/README_YAML.md +590 -0
- data/lib/cisco_node_utils/cmd_ref/aaa_auth_login_service.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/aaa_authentication_login.yaml +38 -0
- data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +40 -0
- data/lib/cisco_node_utils/cmd_ref/acl.yaml +48 -0
- data/lib/cisco_node_utils/cmd_ref/banner.yaml +11 -0
- data/lib/cisco_node_utils/cmd_ref/bfd_global.yaml +117 -0
- data/lib/cisco_node_utils/cmd_ref/bgp.yaml +383 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +223 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_af_aa.yaml +38 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +174 -0
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +236 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +49 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +33 -0
- data/lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml +128 -0
- data/lib/cisco_node_utils/cmd_ref/dnsclient.yaml +55 -0
- data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_multicast.yaml +12 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_multisite.yaml +18 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_stormcontrol.yaml +18 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_vni.yaml +48 -0
- data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +183 -0
- data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +40 -0
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +126 -0
- data/lib/cisco_node_utils/cmd_ref/hostname.yaml +8 -0
- data/lib/cisco_node_utils/cmd_ref/hsrp_global.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/images.yaml +8 -0
- data/lib/cisco_node_utils/cmd_ref/interface.yaml +781 -0
- data/lib/cisco_node_utils/cmd_ref/interface_channel_group.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/interface_evpn_multisite.yaml +17 -0
- data/lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml +120 -0
- data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +112 -0
- data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +87 -0
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +42 -0
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/ip_multicast.yaml +22 -0
- data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +83 -0
- data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +119 -0
- data/lib/cisco_node_utils/cmd_ref/memory.yaml +24 -0
- data/lib/cisco_node_utils/cmd_ref/ntp_auth_key.yaml +10 -0
- data/lib/cisco_node_utils/cmd_ref/ntp_config.yaml +27 -0
- data/lib/cisco_node_utils/cmd_ref/ntp_server.yaml +34 -0
- data/lib/cisco_node_utils/cmd_ref/object_group.yaml +32 -0
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +91 -0
- data/lib/cisco_node_utils/cmd_ref/ospf_area.yaml +91 -0
- data/lib/cisco_node_utils/cmd_ref/ospf_area_vlink.yaml +88 -0
- data/lib/cisco_node_utils/cmd_ref/overlay_global.yaml +37 -0
- data/lib/cisco_node_utils/cmd_ref/pim.yaml +43 -0
- data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +86 -0
- data/lib/cisco_node_utils/cmd_ref/radius_global.yaml +37 -0
- data/lib/cisco_node_utils/cmd_ref/radius_server.yaml +100 -0
- data/lib/cisco_node_utils/cmd_ref/radius_server_group.yaml +19 -0
- data/lib/cisco_node_utils/cmd_ref/route_map.yaml +601 -0
- data/lib/cisco_node_utils/cmd_ref/show_system.yaml +9 -0
- data/lib/cisco_node_utils/cmd_ref/show_version.yaml +84 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +81 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_group.yaml +9 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_notification_receiver.yaml +74 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +91 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_user.yaml +57 -0
- data/lib/cisco_node_utils/cmd_ref/snmpnotification.yaml +23 -0
- data/lib/cisco_node_utils/cmd_ref/span_session.yaml +65 -0
- data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +235 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_facility.yaml +10 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +34 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/system.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_global.yaml +37 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_server.yaml +63 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_server_group.yaml +45 -0
- data/lib/cisco_node_utils/cmd_ref/tacacs_server_host.yaml +64 -0
- data/lib/cisco_node_utils/cmd_ref/upgrade.yaml +38 -0
- data/lib/cisco_node_utils/cmd_ref/vdc.yaml +52 -0
- data/lib/cisco_node_utils/cmd_ref/virtual_service.yaml +8 -0
- data/lib/cisco_node_utils/cmd_ref/vlan.yaml +106 -0
- data/lib/cisco_node_utils/cmd_ref/vpc.yaml +233 -0
- data/lib/cisco_node_utils/cmd_ref/vrf.yaml +86 -0
- data/lib/cisco_node_utils/cmd_ref/vrf_af.yaml +139 -0
- data/lib/cisco_node_utils/cmd_ref/vtp.yaml +32 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +114 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +71 -0
- data/lib/cisco_node_utils/cmd_ref/yang.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/yum.yaml +68 -0
- data/lib/cisco_node_utils/command_reference.rb +724 -0
- data/lib/cisco_node_utils/configparser_lib.rb +195 -0
- data/lib/cisco_node_utils/constants.rb +40 -0
- data/lib/cisco_node_utils/dhcp_relay_global.rb +302 -0
- data/lib/cisco_node_utils/dns_domain.rb +93 -0
- data/lib/cisco_node_utils/domain_name.rb +82 -0
- data/lib/cisco_node_utils/encapsulation.rb +112 -0
- data/lib/cisco_node_utils/environment.rb +110 -0
- data/lib/cisco_node_utils/evpn_multicast.rb +66 -0
- data/lib/cisco_node_utils/evpn_multisite.rb +96 -0
- data/lib/cisco_node_utils/evpn_stormcontrol.rb +84 -0
- data/lib/cisco_node_utils/evpn_vni.rb +159 -0
- data/lib/cisco_node_utils/exceptions.rb +140 -0
- data/lib/cisco_node_utils/fabricpath_global.rb +405 -0
- data/lib/cisco_node_utils/fabricpath_topology.rb +137 -0
- data/lib/cisco_node_utils/feature.rb +377 -0
- data/lib/cisco_node_utils/hostname.rb +62 -0
- data/lib/cisco_node_utils/hsrp_global.rb +97 -0
- data/lib/cisco_node_utils/interface.rb +2128 -0
- data/lib/cisco_node_utils/interface_channel_group.rb +142 -0
- data/lib/cisco_node_utils/interface_evpn_multisite.rb +72 -0
- data/lib/cisco_node_utils/interface_hsrp_group.rb +557 -0
- data/lib/cisco_node_utils/interface_ospf.rb +378 -0
- data/lib/cisco_node_utils/interface_portchannel.rb +180 -0
- data/lib/cisco_node_utils/interface_service_vni.rb +132 -0
- data/lib/cisco_node_utils/ip_multicast.rb +90 -0
- data/lib/cisco_node_utils/itd_device_group.rb +228 -0
- data/lib/cisco_node_utils/itd_device_group_node.rb +144 -0
- data/lib/cisco_node_utils/itd_service.rb +511 -0
- data/lib/cisco_node_utils/logger.rb +78 -0
- data/lib/cisco_node_utils/name_server.rb +64 -0
- data/lib/cisco_node_utils/node.rb +443 -0
- data/lib/cisco_node_utils/node_util.rb +111 -0
- data/lib/cisco_node_utils/ntp_auth_key.rb +67 -0
- data/lib/cisco_node_utils/ntp_config.rb +83 -0
- data/lib/cisco_node_utils/ntp_server.rb +86 -0
- data/lib/cisco_node_utils/object_group.rb +75 -0
- data/lib/cisco_node_utils/object_group_entry.rb +143 -0
- data/lib/cisco_node_utils/overlay_global.rb +142 -0
- data/lib/cisco_node_utils/pim.rb +131 -0
- data/lib/cisco_node_utils/pim_group_list.rb +109 -0
- data/lib/cisco_node_utils/pim_rp_address.rb +103 -0
- data/lib/cisco_node_utils/platform.rb +217 -0
- data/lib/cisco_node_utils/portchannel_global.rb +347 -0
- data/lib/cisco_node_utils/radius_global.rb +165 -0
- data/lib/cisco_node_utils/radius_server.rb +421 -0
- data/lib/cisco_node_utils/radius_server_group.rb +117 -0
- data/lib/cisco_node_utils/route_map.rb +2540 -0
- data/lib/cisco_node_utils/router_ospf.rb +77 -0
- data/lib/cisco_node_utils/router_ospf_area.rb +416 -0
- data/lib/cisco_node_utils/router_ospf_area_vlink.rb +313 -0
- data/lib/cisco_node_utils/router_ospf_vrf.rb +342 -0
- data/lib/cisco_node_utils/snmp_notification_receiver.rb +176 -0
- data/lib/cisco_node_utils/snmpcommunity.rb +109 -0
- data/lib/cisco_node_utils/snmpgroup.rb +54 -0
- data/lib/cisco_node_utils/snmpnotification.rb +57 -0
- data/lib/cisco_node_utils/snmpserver.rb +132 -0
- data/lib/cisco_node_utils/snmpuser.rb +403 -0
- data/lib/cisco_node_utils/span_session.rb +149 -0
- data/lib/cisco_node_utils/stp_global.rb +676 -0
- data/lib/cisco_node_utils/syslog_facility.rb +64 -0
- data/lib/cisco_node_utils/syslog_server.rb +146 -0
- data/lib/cisco_node_utils/syslog_settings.rb +174 -0
- data/lib/cisco_node_utils/tacacs_global.rb +137 -0
- data/lib/cisco_node_utils/tacacs_server.rb +173 -0
- data/lib/cisco_node_utils/tacacs_server_group.rb +149 -0
- data/lib/cisco_node_utils/tacacs_server_host.rb +216 -0
- data/lib/cisco_node_utils/upgrade.rb +122 -0
- data/lib/cisco_node_utils/vdc.rb +118 -0
- data/lib/cisco_node_utils/version.rb +21 -0
- data/lib/cisco_node_utils/vlan.rb +301 -0
- data/lib/cisco_node_utils/vpc.rb +466 -0
- data/lib/cisco_node_utils/vrf.rb +192 -0
- data/lib/cisco_node_utils/vrf_af.rb +327 -0
- data/lib/cisco_node_utils/vtp.rb +125 -0
- data/lib/cisco_node_utils/vxlan_vtep.rb +286 -0
- data/lib/cisco_node_utils/vxlan_vtep_vni.rb +331 -0
- data/lib/cisco_node_utils/yang.rb +160 -0
- data/lib/cisco_node_utils/yum.rb +213 -0
- data/lib/cisco_node_utils.rb +21 -0
- data/lib/minitest/environment_plugin.rb +31 -0
- data/lib/minitest/log_level_plugin.rb +41 -0
- data/spec/client_spec.rb +7 -0
- data/spec/environment_spec.rb +384 -0
- data/spec/grpc_client_spec.rb +23 -0
- data/spec/isolate/all_clients_spec.rb +9 -0
- data/spec/isolate/grpc_only_spec.rb +16 -0
- data/spec/isolate/no_clients_spec.rb +26 -0
- data/spec/isolate/nxapi_only_spec.rb +16 -0
- data/spec/nxapi_client_spec.rb +42 -0
- data/spec/schema.yaml +82 -0
- data/spec/shared_examples_for_clients.rb +14 -0
- data/spec/spec_helper.rb +91 -0
- data/spec/whitespace_spec.rb +10 -0
- data/spec/yaml_spec.rb +42 -0
- data/tests/.rubocop.yml +18 -0
- data/tests/CSCuxdublin-1.0.0-7.0.3.I3.1.lib32_n9000.rpm +0 -0
- data/tests/basetest.rb +243 -0
- data/tests/ciscotest.rb +577 -0
- data/tests/cmd_config.yaml +75 -0
- data/tests/cmd_config_invalid.yaml +16 -0
- data/tests/n9000_sample-1.0.0-7.0.3.x86_64.rpm +0 -0
- data/tests/noop.rb +7 -0
- data/tests/platform_info.rb +63 -0
- data/tests/tacacs_server.yaml.example +6 -0
- data/tests/test_aaa_authentication_login.rb +243 -0
- data/tests/test_aaa_authentication_login_service.rb +761 -0
- data/tests/test_aaa_authorization_service.rb +874 -0
- data/tests/test_ace.rb +304 -0
- data/tests/test_acl.rb +185 -0
- data/tests/test_banner.rb +85 -0
- data/tests/test_bfd_global.rb +272 -0
- data/tests/test_bgp_af.rb +875 -0
- data/tests/test_bgp_af_aa.rb +108 -0
- data/tests/test_bgp_neighbor.rb +596 -0
- data/tests/test_bgp_neighbor_af.rb +781 -0
- data/tests/test_bridge_domain.rb +198 -0
- data/tests/test_bridge_domain_vni.rb +109 -0
- data/tests/test_client_utils.rb +111 -0
- data/tests/test_cmn_utils.rb +76 -0
- data/tests/test_command_config.rb +206 -0
- data/tests/test_command_reference.rb +669 -0
- data/tests/test_dhcp_relay_global.rb +286 -0
- data/tests/test_dns_domain.rb +123 -0
- data/tests/test_domain_name.rb +96 -0
- data/tests/test_encapsulation.rb +75 -0
- data/tests/test_evpn_multicast.rb +65 -0
- data/tests/test_evpn_multisite.rb +70 -0
- data/tests/test_evpn_stormcontrol.rb +56 -0
- data/tests/test_evpn_vni.rb +131 -0
- data/tests/test_fabricpath_global.rb +246 -0
- data/tests/test_fabricpath_topology.rb +77 -0
- data/tests/test_feature.rb +272 -0
- data/tests/test_grpc.rb +166 -0
- data/tests/test_hostname.rb +64 -0
- data/tests/test_hsrp_global.rb +79 -0
- data/tests/test_interface.rb +1958 -0
- data/tests/test_interface_bdi.rb +80 -0
- data/tests/test_interface_channel_group.rb +131 -0
- data/tests/test_interface_evpn_multisite.rb +94 -0
- data/tests/test_interface_hsrp.rb +134 -0
- data/tests/test_interface_hsrp_group.rb +570 -0
- data/tests/test_interface_ospf.rb +820 -0
- data/tests/test_interface_portchannel.rb +135 -0
- data/tests/test_interface_private_vlan.rb +365 -0
- data/tests/test_interface_service_vni.rb +203 -0
- data/tests/test_interface_svi.rb +210 -0
- data/tests/test_interface_switchport.rb +468 -0
- data/tests/test_ip_multicast.rb +80 -0
- data/tests/test_itd_device_group.rb +145 -0
- data/tests/test_itd_device_group_node.rb +199 -0
- data/tests/test_itd_service.rb +314 -0
- data/tests/test_logger.rb +43 -0
- data/tests/test_name_server.rb +94 -0
- data/tests/test_node.rb +50 -0
- data/tests/test_node_ext.rb +406 -0
- data/tests/test_node_util.rb +119 -0
- data/tests/test_ntp_auth_key.rb +77 -0
- data/tests/test_ntp_config.rb +100 -0
- data/tests/test_ntp_server.rb +146 -0
- data/tests/test_nxapi.rb +236 -0
- data/tests/test_object_group.rb +122 -0
- data/tests/test_overlay_global.rb +108 -0
- data/tests/test_pim.rb +203 -0
- data/tests/test_pim_group_list.rb +147 -0
- data/tests/test_pim_rp_address.rb +155 -0
- data/tests/test_platform.rb +254 -0
- data/tests/test_portchannel_global.rb +322 -0
- data/tests/test_radius_global.rb +108 -0
- data/tests/test_radius_server.rb +377 -0
- data/tests/test_radius_server_group.rb +151 -0
- data/tests/test_route_map.rb +1479 -0
- data/tests/test_router_bgp.rb +1325 -0
- data/tests/test_router_ospf.rb +56 -0
- data/tests/test_router_ospf_area.rb +433 -0
- data/tests/test_router_ospf_area_vlink.rb +298 -0
- data/tests/test_router_ospf_vrf.rb +690 -0
- data/tests/test_snmp_notification_receiver.rb +169 -0
- data/tests/test_snmpcommunity.rb +422 -0
- data/tests/test_snmpgroup.rb +71 -0
- data/tests/test_snmpnotification.rb +91 -0
- data/tests/test_snmpserver.rb +251 -0
- data/tests/test_snmpuser.rb +666 -0
- data/tests/test_span_session.rb +155 -0
- data/tests/test_stp_global.rb +575 -0
- data/tests/test_syslog_facility.rb +80 -0
- data/tests/test_syslog_server.rb +119 -0
- data/tests/test_syslog_settings.rb +123 -0
- data/tests/test_tacacs_global.rb +109 -0
- data/tests/test_tacacs_server.rb +436 -0
- data/tests/test_tacacs_server_group.rb +434 -0
- data/tests/test_tacacs_server_host.rb +427 -0
- data/tests/test_upgrade.rb +105 -0
- data/tests/test_vdc.rb +64 -0
- data/tests/test_vlan.rb +386 -0
- data/tests/test_vlan_private.rb +656 -0
- data/tests/test_vpc.rb +548 -0
- data/tests/test_vrf.rb +248 -0
- data/tests/test_vrf_af.rb +288 -0
- data/tests/test_vtp.rb +278 -0
- data/tests/test_vxlan_vtep.rb +327 -0
- data/tests/test_vxlan_vtep_vni.rb +326 -0
- data/tests/test_yang.rb +369 -0
- data/tests/test_yum.rb +109 -0
- data/tests/upgrade_info.yaml.example +3 -0
- data/tests/yum_package.yaml +94 -0
- metadata +534 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
# IP Multicast Unit Tests
|
2
|
+
#
|
3
|
+
# Rahul Shenoy, January, 2018
|
4
|
+
#
|
5
|
+
# Copyright (c) 2018 Cisco and/or its affiliates.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
require_relative 'ciscotest'
|
20
|
+
require_relative '../lib/cisco_node_utils/ip_multicast'
|
21
|
+
require_relative '../lib/cisco_node_utils/feature'
|
22
|
+
|
23
|
+
# TestIpMulticast - Minitest for IpMulticast class
|
24
|
+
class TestIpMulticast < CiscoTestCase
|
25
|
+
@skip_unless_supported = 'ip_multicast'
|
26
|
+
|
27
|
+
def setup
|
28
|
+
# Disable feature ngmvpn before each test to
|
29
|
+
# ensure we are starting with a clean slate for each test.
|
30
|
+
super
|
31
|
+
skip_incompat_version?('feature', 'ngmvpn')
|
32
|
+
config_no_warn('no feature ngmvpn')
|
33
|
+
end
|
34
|
+
|
35
|
+
def teardown
|
36
|
+
# Disable feature ngmvpn after each test
|
37
|
+
config_no_warn('no feature ngmvpn')
|
38
|
+
super
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_overlay_distributed_dr
|
42
|
+
skip_legacy_defect?('7.0.3.I7.4', 'CSCvk01535')
|
43
|
+
|
44
|
+
ipm = IpMulticast.new
|
45
|
+
|
46
|
+
# Test Defaults
|
47
|
+
have = ipm.overlay_distributed_dr
|
48
|
+
should = ipm.default_overlay_distributed_dr
|
49
|
+
assert_equal(have, should, 'overlay_distributed_dr does not match default value')
|
50
|
+
|
51
|
+
# Test property set
|
52
|
+
ipm.overlay_distributed_dr = true
|
53
|
+
assert_equal(ipm.overlay_distributed_dr, true, 'overlay_distributed_dr was not set')
|
54
|
+
|
55
|
+
# Test property unset
|
56
|
+
ipm.overlay_distributed_dr = false
|
57
|
+
assert_equal(ipm.overlay_distributed_dr, false, 'overlay_distributed_dr was not unset')
|
58
|
+
|
59
|
+
ipm.destroy
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_overlay_spt_only
|
63
|
+
ipm = IpMulticast.new
|
64
|
+
|
65
|
+
# Test Defaults
|
66
|
+
have = ipm.overlay_spt_only
|
67
|
+
should = ipm.default_overlay_spt_only
|
68
|
+
assert_equal(have, should, 'overlay_spt_only does not match default value')
|
69
|
+
|
70
|
+
# Test property set
|
71
|
+
ipm.overlay_spt_only = true
|
72
|
+
assert_equal(ipm.overlay_spt_only, true, 'overlay_spt_only was not set')
|
73
|
+
|
74
|
+
# Test property unset
|
75
|
+
ipm.overlay_spt_only = false
|
76
|
+
assert_equal(ipm.overlay_spt_only, false, 'overlay_spt_only was not unset')
|
77
|
+
|
78
|
+
ipm.destroy
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# Copyright (c) 2016 Cisco and/or its affiliates.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# 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,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require_relative 'ciscotest'
|
16
|
+
require_relative '../lib/cisco_node_utils/itd_device_group'
|
17
|
+
|
18
|
+
include Cisco
|
19
|
+
# TestInterface - Minitest for general functionality
|
20
|
+
# of the ItdDeviceGroup class.
|
21
|
+
class TestItdDevGrp < CiscoTestCase
|
22
|
+
@skip_unless_supported = 'itd_device_group'
|
23
|
+
# Tests
|
24
|
+
|
25
|
+
def setup
|
26
|
+
super
|
27
|
+
config 'no feature itd'
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
config 'no feature itd'
|
32
|
+
super
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_create_destroy
|
36
|
+
skip_nexus_i2_image?
|
37
|
+
i1 = ItdDeviceGroup.new('abc')
|
38
|
+
i2 = ItdDeviceGroup.new('BCD')
|
39
|
+
i3 = ItdDeviceGroup.new('xyzABC')
|
40
|
+
assert_equal(3, ItdDeviceGroup.itds.keys.count)
|
41
|
+
|
42
|
+
i2.destroy
|
43
|
+
assert_equal(2, ItdDeviceGroup.itds.keys.count)
|
44
|
+
|
45
|
+
i1.destroy
|
46
|
+
i3.destroy
|
47
|
+
assert_equal(0, ItdDeviceGroup.itds.keys.count)
|
48
|
+
end
|
49
|
+
|
50
|
+
def probe_helper(props)
|
51
|
+
test_hash = {
|
52
|
+
probe_frequency: 9,
|
53
|
+
probe_retry_down: 5,
|
54
|
+
probe_retry_up: 5,
|
55
|
+
probe_timeout: 6,
|
56
|
+
}.merge!(props)
|
57
|
+
|
58
|
+
idg = ItdDeviceGroup.new('new_group')
|
59
|
+
idg.probe_set(test_hash)
|
60
|
+
idg
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_probe_icmp
|
64
|
+
skip_nexus_i2_image?
|
65
|
+
idg = probe_helper(probe_type: 'icmp')
|
66
|
+
assert_equal('icmp', idg.probe_type)
|
67
|
+
assert_equal(9, idg.probe_frequency)
|
68
|
+
assert_equal(6, idg.probe_timeout)
|
69
|
+
assert_equal(5, idg.probe_retry_up)
|
70
|
+
assert_equal(5, idg.probe_retry_down)
|
71
|
+
idg = probe_helper(probe_type: 'icmp',
|
72
|
+
probe_frequency: idg.default_probe_frequency,
|
73
|
+
probe_retry_up: idg.default_probe_retry_up,
|
74
|
+
probe_retry_down: idg.default_probe_retry_down,
|
75
|
+
probe_timeout: idg.default_probe_timeout)
|
76
|
+
assert_equal(idg.default_probe_frequency, idg.probe_frequency)
|
77
|
+
assert_equal(idg.default_probe_timeout, idg.probe_timeout)
|
78
|
+
assert_equal(idg.default_probe_retry_up, idg.probe_retry_up)
|
79
|
+
assert_equal(idg.default_probe_retry_down, idg.probe_retry_down)
|
80
|
+
idg = probe_helper(probe_type: idg.default_probe_type)
|
81
|
+
assert_equal(idg.default_probe_type, idg.probe_type)
|
82
|
+
idg.destroy
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_probe_dns
|
86
|
+
skip_nexus_i2_image?
|
87
|
+
host = 'resolver1.opendns.com'
|
88
|
+
idg = probe_helper(probe_type: 'dns', probe_dns_host: host)
|
89
|
+
assert_equal('dns', idg.probe_type)
|
90
|
+
assert_equal(host, idg.probe_dns_host)
|
91
|
+
assert_equal(9, idg.probe_frequency)
|
92
|
+
assert_equal(6, idg.probe_timeout)
|
93
|
+
assert_equal(5, idg.probe_retry_up)
|
94
|
+
assert_equal(5, idg.probe_retry_down)
|
95
|
+
host = '208.67.220.222'
|
96
|
+
idg = probe_helper(probe_type: 'dns', probe_dns_host: host,
|
97
|
+
probe_frequency: idg.default_probe_frequency,
|
98
|
+
probe_retry_up: idg.default_probe_retry_up,
|
99
|
+
probe_retry_down: idg.default_probe_retry_down,
|
100
|
+
probe_timeout: idg.default_probe_timeout)
|
101
|
+
assert_equal(host, idg.probe_dns_host)
|
102
|
+
assert_equal(idg.default_probe_frequency, idg.probe_frequency)
|
103
|
+
assert_equal(idg.default_probe_timeout, idg.probe_timeout)
|
104
|
+
assert_equal(idg.default_probe_retry_up, idg.probe_retry_up)
|
105
|
+
assert_equal(idg.default_probe_retry_down, idg.probe_retry_down)
|
106
|
+
host = '2620:0:ccd::2'
|
107
|
+
idg = probe_helper(probe_type: 'dns', probe_dns_host: host,
|
108
|
+
probe_frequency: idg.default_probe_frequency,
|
109
|
+
probe_retry_up: idg.default_probe_retry_up,
|
110
|
+
probe_retry_down: idg.default_probe_retry_down,
|
111
|
+
probe_timeout: idg.default_probe_timeout)
|
112
|
+
assert_equal(host, idg.probe_dns_host)
|
113
|
+
idg.destroy
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_probe_tcp_udp
|
117
|
+
skip_nexus_i2_image?
|
118
|
+
port = 11_111
|
119
|
+
type = 'tcp'
|
120
|
+
idg = probe_helper(probe_type: type, probe_port: port,
|
121
|
+
probe_control: true)
|
122
|
+
assert_equal(type, idg.probe_type)
|
123
|
+
assert_equal(port, idg.probe_port)
|
124
|
+
assert_equal(true, idg.probe_control)
|
125
|
+
assert_equal(9, idg.probe_frequency)
|
126
|
+
assert_equal(6, idg.probe_timeout)
|
127
|
+
assert_equal(5, idg.probe_retry_up)
|
128
|
+
assert_equal(5, idg.probe_retry_down)
|
129
|
+
type = 'udp'
|
130
|
+
idg = probe_helper(probe_type: type, probe_port: port,
|
131
|
+
probe_control: idg.default_probe_control,
|
132
|
+
probe_frequency: idg.default_probe_frequency,
|
133
|
+
probe_retry_up: idg.default_probe_retry_up,
|
134
|
+
probe_retry_down: idg.default_probe_retry_down,
|
135
|
+
probe_timeout: idg.default_probe_timeout)
|
136
|
+
assert_equal(type, idg.probe_type)
|
137
|
+
assert_equal(port, idg.probe_port)
|
138
|
+
assert_equal(idg.default_probe_control, idg.probe_control)
|
139
|
+
assert_equal(idg.default_probe_frequency, idg.probe_frequency)
|
140
|
+
assert_equal(idg.default_probe_timeout, idg.probe_timeout)
|
141
|
+
assert_equal(idg.default_probe_retry_up, idg.probe_retry_up)
|
142
|
+
assert_equal(idg.default_probe_retry_down, idg.probe_retry_down)
|
143
|
+
idg.destroy
|
144
|
+
end
|
145
|
+
end
|
@@ -0,0 +1,199 @@
|
|
1
|
+
# Copyright (c) 2016 Cisco and/or its affiliates.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# 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,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require_relative 'ciscotest'
|
16
|
+
require_relative '../lib/cisco_node_utils/itd_device_group_node'
|
17
|
+
|
18
|
+
include Cisco
|
19
|
+
# TestInterface - Minitest for general functionality
|
20
|
+
# of the ItdDeviceGroup class.
|
21
|
+
class TestItdDevGrpNode < CiscoTestCase
|
22
|
+
@skip_unless_supported = 'itd_device_group'
|
23
|
+
# Tests
|
24
|
+
|
25
|
+
def setup
|
26
|
+
super
|
27
|
+
config 'no feature itd'
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
config 'no feature itd'
|
32
|
+
super
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_create_destroy
|
36
|
+
skip_nexus_i2_image?
|
37
|
+
itddg1 = ItdDeviceGroup.new('abc')
|
38
|
+
n1 = ItdDeviceGroupNode.new(itddg1.name, '1.1.1.1', 'ip')
|
39
|
+
n2 = ItdDeviceGroupNode.new(itddg1.name, '2.2.2.2', 'ip')
|
40
|
+
n3 = ItdDeviceGroupNode.new(itddg1.name, '3.3.3.3', 'ip')
|
41
|
+
assert_includes(ItdDeviceGroupNode.itd_nodes['abc'], '1.1.1.1')
|
42
|
+
assert_includes(ItdDeviceGroupNode.itd_nodes['abc'], '2.2.2.2')
|
43
|
+
assert_includes(ItdDeviceGroupNode.itd_nodes['abc'], '3.3.3.3')
|
44
|
+
itddg2 = ItdDeviceGroup.new('xyz')
|
45
|
+
n4 = ItdDeviceGroupNode.new(itddg2.name, '2000::1', 'IPv6')
|
46
|
+
assert_includes(ItdDeviceGroupNode.itd_nodes['xyz'], '2000::1')
|
47
|
+
itddg3 = ItdDeviceGroup.new('efg')
|
48
|
+
n5 = ItdDeviceGroupNode.new(itddg3.name, '1.1.1.1', 'ip')
|
49
|
+
assert_includes(ItdDeviceGroupNode.itd_nodes['efg'], '1.1.1.1')
|
50
|
+
|
51
|
+
n1.destroy
|
52
|
+
refute_includes(ItdDeviceGroupNode.itd_nodes['abc'], '1.1.1.1')
|
53
|
+
n2.destroy
|
54
|
+
n3.destroy
|
55
|
+
assert_empty(ItdDeviceGroupNode.itd_nodes['abc'])
|
56
|
+
n4.destroy
|
57
|
+
assert_empty(ItdDeviceGroupNode.itd_nodes['xyz'])
|
58
|
+
n5.destroy
|
59
|
+
assert_empty(ItdDeviceGroupNode.itd_nodes['efg'])
|
60
|
+
end
|
61
|
+
|
62
|
+
def probe_helper(props)
|
63
|
+
test_hash = {
|
64
|
+
probe_frequency: 9,
|
65
|
+
probe_retry_down: 5,
|
66
|
+
probe_retry_up: 5,
|
67
|
+
probe_timeout: 6,
|
68
|
+
}.merge!(props)
|
69
|
+
|
70
|
+
ItdDeviceGroup.new('new_group')
|
71
|
+
idg = ItdDeviceGroupNode.new('new_group', '1.1.1.1', 'ip')
|
72
|
+
idg.probe_set(test_hash)
|
73
|
+
idg
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_probe_icmp
|
77
|
+
skip_nexus_i2_image?
|
78
|
+
idg = probe_helper(probe_type: 'icmp')
|
79
|
+
assert_equal('icmp', idg.probe_type)
|
80
|
+
assert_equal(9, idg.probe_frequency)
|
81
|
+
assert_equal(6, idg.probe_timeout)
|
82
|
+
assert_equal(5, idg.probe_retry_up)
|
83
|
+
assert_equal(5, idg.probe_retry_down)
|
84
|
+
idg = probe_helper(probe_type: 'icmp',
|
85
|
+
probe_frequency: idg.default_probe_frequency,
|
86
|
+
probe_retry_up: idg.default_probe_retry_up,
|
87
|
+
probe_retry_down: idg.default_probe_retry_down,
|
88
|
+
probe_timeout: idg.default_probe_timeout)
|
89
|
+
assert_equal(idg.default_probe_frequency, idg.probe_frequency)
|
90
|
+
assert_equal(idg.default_probe_timeout, idg.probe_timeout)
|
91
|
+
assert_equal(idg.default_probe_retry_up, idg.probe_retry_up)
|
92
|
+
assert_equal(idg.default_probe_retry_down, idg.probe_retry_down)
|
93
|
+
idg = probe_helper(probe_type: idg.default_probe_type)
|
94
|
+
assert_equal(idg.default_probe_type, idg.probe_type)
|
95
|
+
idg.destroy
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_probe_dns
|
99
|
+
skip_nexus_i2_image?
|
100
|
+
host = 'resolver1.opendns.com'
|
101
|
+
idg = probe_helper(probe_type: 'dns', probe_dns_host: host)
|
102
|
+
assert_equal('dns', idg.probe_type)
|
103
|
+
assert_equal(host, idg.probe_dns_host)
|
104
|
+
assert_equal(9, idg.probe_frequency)
|
105
|
+
assert_equal(6, idg.probe_timeout)
|
106
|
+
assert_equal(5, idg.probe_retry_up)
|
107
|
+
assert_equal(5, idg.probe_retry_down)
|
108
|
+
host = '208.67.220.222'
|
109
|
+
idg = probe_helper(probe_type: 'dns', probe_dns_host: host,
|
110
|
+
probe_frequency: idg.default_probe_frequency,
|
111
|
+
probe_retry_up: idg.default_probe_retry_up,
|
112
|
+
probe_retry_down: idg.default_probe_retry_down,
|
113
|
+
probe_timeout: idg.default_probe_timeout)
|
114
|
+
assert_equal(host, idg.probe_dns_host)
|
115
|
+
assert_equal(idg.default_probe_frequency, idg.probe_frequency)
|
116
|
+
assert_equal(idg.default_probe_timeout, idg.probe_timeout)
|
117
|
+
assert_equal(idg.default_probe_retry_up, idg.probe_retry_up)
|
118
|
+
assert_equal(idg.default_probe_retry_down, idg.probe_retry_down)
|
119
|
+
host = '2620:0:ccd::2'
|
120
|
+
idg = probe_helper(probe_type: 'dns', probe_dns_host: host,
|
121
|
+
probe_frequency: idg.default_probe_frequency,
|
122
|
+
probe_retry_up: idg.default_probe_retry_up,
|
123
|
+
probe_retry_down: idg.default_probe_retry_down,
|
124
|
+
probe_timeout: idg.default_probe_timeout)
|
125
|
+
assert_equal(host, idg.probe_dns_host)
|
126
|
+
idg.destroy
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_probe_tcp_udp
|
130
|
+
skip_nexus_i2_image?
|
131
|
+
port = 11_111
|
132
|
+
type = 'tcp'
|
133
|
+
idg = probe_helper(probe_type: type, probe_port: port,
|
134
|
+
probe_control: true)
|
135
|
+
assert_equal(type, idg.probe_type)
|
136
|
+
assert_equal(port, idg.probe_port)
|
137
|
+
assert_equal(true, idg.probe_control)
|
138
|
+
assert_equal(9, idg.probe_frequency)
|
139
|
+
assert_equal(6, idg.probe_timeout)
|
140
|
+
assert_equal(5, idg.probe_retry_up)
|
141
|
+
assert_equal(5, idg.probe_retry_down)
|
142
|
+
type = 'udp'
|
143
|
+
idg = probe_helper(probe_type: type, probe_port: port,
|
144
|
+
probe_control: idg.default_probe_control,
|
145
|
+
probe_frequency: idg.default_probe_frequency,
|
146
|
+
probe_retry_up: idg.default_probe_retry_up,
|
147
|
+
probe_retry_down: idg.default_probe_retry_down,
|
148
|
+
probe_timeout: idg.default_probe_timeout)
|
149
|
+
assert_equal(type, idg.probe_type)
|
150
|
+
assert_equal(port, idg.probe_port)
|
151
|
+
assert_equal(idg.default_probe_control, idg.probe_control)
|
152
|
+
assert_equal(idg.default_probe_frequency, idg.probe_frequency)
|
153
|
+
assert_equal(idg.default_probe_timeout, idg.probe_timeout)
|
154
|
+
assert_equal(idg.default_probe_retry_up, idg.probe_retry_up)
|
155
|
+
assert_equal(idg.default_probe_retry_down, idg.probe_retry_down)
|
156
|
+
idg.destroy
|
157
|
+
end
|
158
|
+
|
159
|
+
def test_hot_standby_weight
|
160
|
+
skip_nexus_i2_image?
|
161
|
+
itddg = ItdDeviceGroup.new('new_group')
|
162
|
+
idg = ItdDeviceGroupNode.new('new_group', '1.1.1.1', 'ip')
|
163
|
+
hot_standby = true
|
164
|
+
weight = idg.default_weight
|
165
|
+
idg.hs_weight(hot_standby, weight)
|
166
|
+
assert_equal(true, idg.hot_standby)
|
167
|
+
assert_equal(idg.default_weight,
|
168
|
+
idg.weight)
|
169
|
+
hot_standby = idg.default_hot_standby
|
170
|
+
weight = idg.default_weight
|
171
|
+
idg.hs_weight(hot_standby, weight)
|
172
|
+
assert_equal(idg.default_hot_standby, idg.hot_standby)
|
173
|
+
assert_equal(idg.default_weight,
|
174
|
+
idg.weight)
|
175
|
+
hot_standby = idg.default_hot_standby
|
176
|
+
weight = 150
|
177
|
+
idg.hs_weight(hot_standby, weight)
|
178
|
+
assert_equal(idg.default_hot_standby, idg.hot_standby)
|
179
|
+
assert_equal(150, idg.weight)
|
180
|
+
hot_standby = idg.default_hot_standby
|
181
|
+
weight = 200
|
182
|
+
idg.hs_weight(hot_standby, weight)
|
183
|
+
assert_equal(idg.default_hot_standby, idg.hot_standby)
|
184
|
+
assert_equal(200, idg.weight)
|
185
|
+
hot_standby = true
|
186
|
+
weight = idg.default_weight
|
187
|
+
idg.hs_weight(hot_standby, weight)
|
188
|
+
assert_equal(true, idg.hot_standby)
|
189
|
+
assert_equal(idg.default_weight,
|
190
|
+
idg.weight)
|
191
|
+
hot_standby = idg.default_hot_standby
|
192
|
+
weight = 200
|
193
|
+
idg.hs_weight(hot_standby, weight)
|
194
|
+
assert_equal(idg.default_hot_standby, idg.hot_standby)
|
195
|
+
assert_equal(200, idg.weight)
|
196
|
+
idg.destroy
|
197
|
+
itddg.destroy
|
198
|
+
end
|
199
|
+
end
|