cisco_node_utils 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +8 -7
- data/docs/README-maintainers.md +0 -1
- data/lib/cisco_node_utils/aaa_authentication_login_service.rb +2 -2
- data/lib/cisco_node_utils/bgp.rb +2 -2
- data/lib/cisco_node_utils/cisco_cmn_utils.rb +16 -0
- data/lib/cisco_node_utils/client/utils.rb +7 -1
- data/lib/cisco_node_utils/cmd_ref/DEPRECATED.yaml +12 -12
- data/lib/cisco_node_utils/cmd_ref/README_YAML.md +35 -7
- data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/bfd_global.yaml +4 -4
- data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml +5 -5
- data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +5 -5
- data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +8 -3
- data/lib/cisco_node_utils/cmd_ref/hsrp_global.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/interface.yaml +65 -14
- data/lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml +117 -0
- data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +4 -8
- data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/pim.yaml +6 -0
- data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +9 -9
- data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +8 -8
- data/lib/cisco_node_utils/cmd_ref/vdc.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/vlan.yaml +16 -8
- data/lib/cisco_node_utils/cmd_ref/vpc.yaml +11 -11
- data/lib/cisco_node_utils/cmd_ref/vrf.yaml +2 -1
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +1 -1
- data/lib/cisco_node_utils/command_reference.rb +8 -1
- data/lib/cisco_node_utils/domain_name.rb +17 -2
- data/lib/cisco_node_utils/feature.rb +14 -0
- data/lib/cisco_node_utils/hsrp_global.rb +97 -0
- data/lib/cisco_node_utils/interface.rb +146 -0
- data/lib/cisco_node_utils/interface_hsrp_group.rb +544 -0
- data/lib/cisco_node_utils/node.rb +93 -4
- data/lib/cisco_node_utils/pim.rb +17 -0
- data/lib/cisco_node_utils/portchannel_global.rb +2 -2
- data/lib/cisco_node_utils/version.rb +1 -1
- data/lib/cisco_node_utils/vlan.rb +2 -5
- data/lib/cisco_node_utils/yum.rb +11 -6
- data/spec/schema.yaml +3 -3
- data/tests/ciscotest.rb +25 -4
- data/tests/cmd_config.yaml +0 -2
- data/tests/test_bgp_af.rb +13 -2
- data/tests/test_feature.rb +5 -0
- data/tests/test_hsrp_global.rb +79 -0
- data/tests/test_interface.rb +23 -0
- data/tests/test_interface_hsrp.rb +134 -0
- data/tests/test_interface_hsrp_group.rb +582 -0
- data/tests/test_node_ext.rb +7 -1
- data/tests/test_pim.rb +27 -3
- data/tests/test_platform.rb +1 -1
- data/tests/test_radius_global.rb +4 -5
- data/tests/test_radius_server.rb +16 -11
- data/tests/test_router_bgp.rb +11 -6
- data/tests/test_router_ospf_area.rb +6 -6
- data/tests/test_tacacs_server.rb +2 -2
- data/tests/test_tacacs_server_host.rb +2 -2
- data/tests/test_vlan.rb +14 -0
- data/tests/test_yum.rb +2 -2
- data/tests/yum_package.yaml +4 -0
- metadata +10 -3
    
        data/tests/test_node_ext.rb
    CHANGED
    
    | @@ -141,9 +141,15 @@ class TestNodeExt < CiscoTestCase | |
| 141 141 | 
             
              end
         | 
| 142 142 |  | 
| 143 143 | 
             
              def test_get_product_id
         | 
| 144 | 
            +
                # N9K Fretta product_id gets a '-F' appended so remove it for this check
         | 
| 145 | 
            +
                if Utils.image_version?(/7.0.3.F/)
         | 
| 146 | 
            +
                  chassis = node.product_id.sub('-F', '')
         | 
| 147 | 
            +
                else
         | 
| 148 | 
            +
                  chassis = node.product_id
         | 
| 149 | 
            +
                end
         | 
| 144 150 | 
             
                assert_output_check(command: 'show inventory',
         | 
| 145 151 | 
             
                                    pattern: /NAME: \"#{@chassis}\".*\nPID: (\S+)/,
         | 
| 146 | 
            -
                                    check:    | 
| 152 | 
            +
                                    check:   chassis,
         | 
| 147 153 | 
             
                                    msg:     'Error, Product id does not match')
         | 
| 148 154 | 
             
              end
         | 
| 149 155 |  | 
    
        data/tests/test_pim.rb
    CHANGED
    
    | @@ -77,6 +77,8 @@ class TestPim < CiscoTestCase | |
| 77 77 | 
             
                p1 = Pim.new(afi, 'default')
         | 
| 78 78 | 
             
                p1.ssm_range = (range)
         | 
| 79 79 | 
             
                assert_equal(p1.ssm_range.split.sort.join(' '), range.split.sort.join(' '))
         | 
| 80 | 
            +
                p1.ssm_range = 'none'
         | 
| 81 | 
            +
                assert_equal('none', p1.ssm_range)
         | 
| 80 82 | 
             
              end
         | 
| 81 83 |  | 
| 82 84 | 
             
              # Tests single ssm range none under default vrf
         | 
| @@ -94,6 +96,8 @@ class TestPim < CiscoTestCase | |
| 94 96 | 
             
                p1 = Pim.new(afi, 'default')
         | 
| 95 97 | 
             
                p1.ssm_range = (range)
         | 
| 96 98 | 
             
                assert_equal(p1.ssm_range.split.sort.join(' '), range.split.sort.join(' '))
         | 
| 99 | 
            +
                p1.ssm_range = 'none'
         | 
| 100 | 
            +
                assert_equal('none', p1.ssm_range)
         | 
| 97 101 | 
             
              end
         | 
| 98 102 |  | 
| 99 103 | 
             
              # Tests single ssm range none under default vrf
         | 
| @@ -119,6 +123,10 @@ class TestPim < CiscoTestCase | |
| 119 123 | 
             
                assert_equal(p1.ssm_range.split.sort.join(' '), range1.split.sort.join(' '))
         | 
| 120 124 | 
             
                assert_equal(p2.ssm_range.split.sort.join(' '), range2.split.sort.join(' '))
         | 
| 121 125 | 
             
                assert_equal(p3.ssm_range.split.sort.join(' '), range3.split.sort.join(' '))
         | 
| 126 | 
            +
                p1.ssm_range = 'none'
         | 
| 127 | 
            +
                assert_equal('none', p1.ssm_range)
         | 
| 128 | 
            +
                p2.ssm_range = 'none'
         | 
| 129 | 
            +
                assert_equal('none', p2.ssm_range)
         | 
| 122 130 | 
             
              end
         | 
| 123 131 |  | 
| 124 132 | 
             
              # Tests multiple ssm ranges under different vrfs
         | 
| @@ -144,11 +152,10 @@ class TestPim < CiscoTestCase | |
| 144 152 | 
             
                p2.ssm_range = (range3)
         | 
| 145 153 | 
             
                assert_equal(p2.ssm_range.split.sort.join(' '), range3.split.sort.join(' '))
         | 
| 146 154 |  | 
| 155 | 
            +
                p1.ssm_range = 'none'
         | 
| 156 | 
            +
                assert_equal('none', p1.ssm_range)
         | 
| 147 157 | 
             
                p1.destroy
         | 
| 148 | 
            -
                assert('none', p1.ssm_range)
         | 
| 149 | 
            -
             | 
| 150 158 | 
             
                p2.destroy
         | 
| 151 | 
            -
                assert('none', p2.ssm_range)
         | 
| 152 159 | 
             
              end
         | 
| 153 160 |  | 
| 154 161 | 
             
              # Tests multiple ssm ranges overwrite under different vrfs
         | 
| @@ -176,4 +183,21 @@ class TestPim < CiscoTestCase | |
| 176 183 | 
             
                  create_single_invalid_ssm_range_single_vrf(afi)
         | 
| 177 184 | 
             
                end
         | 
| 178 185 | 
             
              end
         | 
| 186 | 
            +
             | 
| 187 | 
            +
              def test_bfd
         | 
| 188 | 
            +
                %w(ipv4).each do |afi|
         | 
| 189 | 
            +
                  p1 = Pim.new(afi, 'default')
         | 
| 190 | 
            +
                  p2 = Pim.new(afi, 'red')
         | 
| 191 | 
            +
                  assert_equal(p1.default_bfd, p1.bfd)
         | 
| 192 | 
            +
                  assert_equal(p2.default_bfd, p1.bfd)
         | 
| 193 | 
            +
                  p1.bfd = true
         | 
| 194 | 
            +
                  p2.bfd = true
         | 
| 195 | 
            +
                  assert_equal(true, p1.bfd)
         | 
| 196 | 
            +
                  assert_equal(true, p2.bfd)
         | 
| 197 | 
            +
                  p1.bfd = p1.default_bfd
         | 
| 198 | 
            +
                  p2.bfd = p2.default_bfd
         | 
| 199 | 
            +
                  assert_equal(p1.default_bfd, p1.bfd)
         | 
| 200 | 
            +
                  assert_equal(p2.default_bfd, p1.bfd)
         | 
| 201 | 
            +
                end
         | 
| 202 | 
            +
              end
         | 
| 179 203 | 
             
            end
         | 
    
        data/tests/test_platform.rb
    CHANGED
    
    | @@ -51,7 +51,7 @@ class TestPlatform < CiscoTestCase | |
| 51 51 | 
             
                # [['pack1', 'state1'], ['pack2', 'state2'], ...]
         | 
| 52 52 | 
             
                # 'state' should always be a variant of Active or Inactive
         | 
| 53 53 | 
             
                pkgs = @device.cmd('sh inst patch')
         | 
| 54 | 
            -
                       .scan(/\n(\S+)\s+(\S*[aA]ctive.*) | 
| 54 | 
            +
                       .scan(/\n(\S+)\s+(\S*[aA]ctive.*)/)
         | 
| 55 55 | 
             
                # convert to hash with key pkg_name and value pkg_state
         | 
| 56 56 | 
             
                pkg_hsh = {}
         | 
| 57 57 | 
             
                pkgs.each { |p| pkg_hsh[p[0]] = p[1].downcase }
         | 
    
        data/tests/test_radius_global.rb
    CHANGED
    
    | @@ -66,11 +66,10 @@ class TestRadiusGlobal < CiscoTestCase | |
| 66 66 | 
             
                             2)
         | 
| 67 67 |  | 
| 68 68 | 
             
                if platform == :nexus
         | 
| 69 | 
            -
                   | 
| 70 | 
            -
                   | 
| 71 | 
            -
             | 
| 72 | 
            -
                  assert_equal(Cisco::RadiusGlobal.radius_global[id].key | 
| 73 | 
            -
                               '44444444')
         | 
| 69 | 
            +
                  key = '44444444'
         | 
| 70 | 
            +
                  global.key_set(key, nil)
         | 
| 71 | 
            +
                  assert_equal(Utils.add_quotes(key), global.key)
         | 
| 72 | 
            +
                  assert_equal(Utils.add_quotes(key), Cisco::RadiusGlobal.radius_global[id].key)
         | 
| 74 73 | 
             
                elsif platform == :ios_xr
         | 
| 75 74 | 
             
                  global.key_set('QsEfThUkO', nil)
         | 
| 76 75 | 
             
                  assert(!global.key.nil?)
         | 
    
        data/tests/test_radius_server.rb
    CHANGED
    
    | @@ -96,8 +96,9 @@ class TestRadiusSvr < CiscoTestCase | |
| 96 96 | 
             
                  server.key_set(nil, nil)
         | 
| 97 97 | 
             
                  assert_equal(nil, Cisco::RadiusServer.radiusservers[id].key)
         | 
| 98 98 |  | 
| 99 | 
            -
                   | 
| 100 | 
            -
                   | 
| 99 | 
            +
                  key = '44444444'
         | 
| 100 | 
            +
                  server.key_set(key, nil)
         | 
| 101 | 
            +
                  assert_equal(Utils.add_quotes(key), Cisco::RadiusServer.radiusservers[id].key)
         | 
| 101 102 | 
             
                else
         | 
| 102 103 | 
             
                  assert_nil(server.accounting)
         | 
| 103 104 | 
             
                  assert_raises(Cisco::UnsupportedError) do
         | 
| @@ -159,8 +160,9 @@ class TestRadiusSvr < CiscoTestCase | |
| 159 160 | 
             
                  server.auth_port = 77
         | 
| 160 161 | 
             
                  assert_equal(77, Cisco::RadiusServer.radiusservers[id].auth_port)
         | 
| 161 162 |  | 
| 162 | 
            -
                   | 
| 163 | 
            -
                   | 
| 163 | 
            +
                  key = '44444444'
         | 
| 164 | 
            +
                  server.key_set(key, nil)
         | 
| 165 | 
            +
                  assert_equal(Utils.add_quotes(key), Cisco::RadiusServer.radiusservers[id].key)
         | 
| 164 166 | 
             
                else
         | 
| 165 167 | 
             
                  assert_nil(server.accounting)
         | 
| 166 168 | 
             
                  assert_raises(Cisco::UnsupportedError) do
         | 
| @@ -223,8 +225,9 @@ class TestRadiusSvr < CiscoTestCase | |
| 223 225 | 
             
                  server.auth_port = 77
         | 
| 224 226 | 
             
                  assert_equal(77, Cisco::RadiusServer.radiusservers[id].auth_port)
         | 
| 225 227 |  | 
| 226 | 
            -
                   | 
| 227 | 
            -
                   | 
| 228 | 
            +
                  key = '44444444'
         | 
| 229 | 
            +
                  server.key_set(key, nil)
         | 
| 230 | 
            +
                  assert_equal(Utils.add_quotes(key), Cisco::RadiusServer.radiusservers[id].key)
         | 
| 228 231 | 
             
                else
         | 
| 229 232 | 
             
                  assert_nil(server.accounting)
         | 
| 230 233 | 
             
                  assert_raises(Cisco::UnsupportedError) do
         | 
| @@ -293,9 +296,10 @@ class TestRadiusSvr < CiscoTestCase | |
| 293 296 | 
             
                  server.auth_port = 77
         | 
| 294 297 | 
             
                  assert_equal(77, Cisco::RadiusServer.radiusservers[id].auth_port)
         | 
| 295 298 |  | 
| 296 | 
            -
                   | 
| 297 | 
            -
                   | 
| 298 | 
            -
                  assert_equal( | 
| 299 | 
            +
                  key = '44444444'
         | 
| 300 | 
            +
                  server.key_set(key, nil)
         | 
| 301 | 
            +
                  assert_equal(Utils.add_quotes(key), Cisco::RadiusServer.radiusservers[id].key)
         | 
| 302 | 
            +
                  assert_equal(Utils.add_quotes(key), server.key)
         | 
| 299 303 | 
             
                else
         | 
| 300 304 | 
             
                  assert_nil(server.accounting)
         | 
| 301 305 | 
             
                  assert_raises(Cisco::UnsupportedError) do
         | 
| @@ -327,8 +331,9 @@ class TestRadiusSvr < CiscoTestCase | |
| 327 331 | 
             
                  server2.auth_port = 77
         | 
| 328 332 | 
             
                  assert_equal(77, Cisco::RadiusServer.radiusservers[id2].auth_port)
         | 
| 329 333 |  | 
| 330 | 
            -
                   | 
| 331 | 
            -
                   | 
| 334 | 
            +
                  key = '44444444'
         | 
| 335 | 
            +
                  server2.key_set(key, nil)
         | 
| 336 | 
            +
                  assert_equal(Utils.add_quotes(key), Cisco::RadiusServer.radiusservers[id2].key)
         | 
| 332 337 | 
             
                else
         | 
| 333 338 | 
             
                  assert_nil(server.accounting)
         | 
| 334 339 | 
             
                  assert_raises(Cisco::UnsupportedError) do
         | 
    
        data/tests/test_router_bgp.rb
    CHANGED
    
    | @@ -61,9 +61,11 @@ def setup_vrf | |
| 61 61 | 
             
            end
         | 
| 62 62 |  | 
| 63 63 | 
             
            def newer_image_version?
         | 
| 64 | 
            -
               | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 64 | 
            +
              new = true
         | 
| 65 | 
            +
              new = false if Utils.image_version?(/7.0.3.I2|I3|I4/) ||
         | 
| 66 | 
            +
                             node.product_id[/(N5|N6|N7|N9.*-F)/]
         | 
| 67 | 
            +
              new = true if Utils.image_version?(/8.0/)
         | 
| 68 | 
            +
              new
         | 
| 67 69 | 
             
            end
         | 
| 68 70 |  | 
| 69 71 | 
             
            # TestRouterBgp - Minitest for RouterBgp class
         | 
| @@ -666,7 +668,8 @@ class TestRouterBgp < CiscoTestCase | |
| 666 668 | 
             
                bgp.event_history_errors = 'false'
         | 
| 667 669 | 
             
                assert_equal('false', bgp.event_history_errors)
         | 
| 668 670 | 
             
                bgp.event_history_errors = 'size_small'
         | 
| 669 | 
            -
                assert_equal('size_small', bgp.event_history_errors)
         | 
| 671 | 
            +
                assert_equal('size_small', bgp.event_history_errors) unless
         | 
| 672 | 
            +
                  Utils.image_version?(/8.0/)
         | 
| 670 673 | 
             
                bgp.event_history_errors = 'size_large'
         | 
| 671 674 | 
             
                assert_equal('size_large', bgp.event_history_errors)
         | 
| 672 675 | 
             
                bgp.event_history_errors = 'size_medium'
         | 
| @@ -752,7 +755,8 @@ class TestRouterBgp < CiscoTestCase | |
| 752 755 | 
             
                assert_equal(bgp.default_event_history_periodic,
         | 
| 753 756 | 
             
                             bgp.event_history_periodic)
         | 
| 754 757 | 
             
                bgp.event_history_periodic = 'false'
         | 
| 755 | 
            -
                assert_equal('false', bgp.event_history_periodic)
         | 
| 758 | 
            +
                assert_equal('false', bgp.event_history_periodic) unless
         | 
| 759 | 
            +
                  Utils.image_version?(/8.0/)
         | 
| 756 760 | 
             
                bgp.event_history_periodic = 'size_small'
         | 
| 757 761 | 
             
                assert_equal('size_small', bgp.event_history_periodic)
         | 
| 758 762 | 
             
                bgp.event_history_periodic = 'size_large'
         | 
| @@ -770,7 +774,8 @@ class TestRouterBgp < CiscoTestCase | |
| 770 774 | 
             
                end
         | 
| 771 775 | 
             
                bgp.event_history_periodic = 'true'
         | 
| 772 776 | 
             
                if newer_image_version?
         | 
| 773 | 
            -
                  assert_equal('true', bgp.event_history_periodic)
         | 
| 777 | 
            +
                  assert_equal('true', bgp.event_history_periodic) unless
         | 
| 778 | 
            +
                    Utils.image_version?(/8.0/)
         | 
| 774 779 | 
             
                else
         | 
| 775 780 | 
             
                  assert_equal(bgp.default_event_history_periodic,
         | 
| 776 781 | 
             
                               bgp.event_history_periodic)
         | 
| @@ -52,16 +52,16 @@ class TestRouterOspfArea < CiscoTestCase | |
| 52 52 | 
             
                av.stub = true
         | 
| 53 53 | 
             
                assert_equal(2, RouterOspfArea.areas['Wolfpack'].size)
         | 
| 54 54 | 
             
                av.destroy
         | 
| 55 | 
            -
                # on  | 
| 55 | 
            +
                # on n9k-f (only), we cannot remove "area <area> default-cost 1",
         | 
| 56 56 | 
             
                # unless the entire ospf router is removed. The default value of
         | 
| 57 57 | 
             
                # default_cost is 1 and so this is just a cosmetic issue but
         | 
| 58 58 | 
             
                # need to skip the below test as the size will be wrong.
         | 
| 59 59 | 
             
                # platform as the size will be wrong. bug ID: CSCva04066
         | 
| 60 60 | 
             
                assert_equal(1, RouterOspfArea.areas['Wolfpack'].size) unless
         | 
| 61 | 
            -
                  / | 
| 61 | 
            +
                  /N9K.*-F/ =~ node.product_id
         | 
| 62 62 | 
             
                ad.destroy
         | 
| 63 63 | 
             
                assert_empty(RouterOspfArea.areas) unless
         | 
| 64 | 
            -
                  / | 
| 64 | 
            +
                  /N9K.*-F/ =~ node.product_id
         | 
| 65 65 | 
             
              end
         | 
| 66 66 |  | 
| 67 67 | 
             
              def test_authentication
         | 
| @@ -237,21 +237,21 @@ class TestRouterOspfArea < CiscoTestCase | |
| 237 237 | 
             
                assert_equal(ad.default_nssa_no_redistribution, ad.nssa_no_redistribution)
         | 
| 238 238 | 
             
                assert_equal(ad.default_nssa_no_summary, ad.nssa_no_summary)
         | 
| 239 239 | 
             
                assert_equal(ad.default_nssa_route_map, ad.nssa_route_map)
         | 
| 240 | 
            -
                # on  | 
| 240 | 
            +
                # on n9k-f (only), we cannot configure
         | 
| 241 241 | 
             
                # "area <area> nssa default-information-originate",
         | 
| 242 242 | 
             
                # properly if we reset it first. It is only configuring nssa
         | 
| 243 243 | 
             
                # but not the other parameters. bug ID: CSCva11482
         | 
| 244 244 | 
             
                hash[:nssa_route_map] = 'aaa'
         | 
| 245 245 | 
             
                ad.nssa_set(hash)
         | 
| 246 246 | 
             
                assert_equal(true, ad.nssa)
         | 
| 247 | 
            -
                if node.product_id[/ | 
| 247 | 
            +
                if node.product_id[/N9K-F/]
         | 
| 248 248 | 
             
                  refute(ad.nssa_default_originate)
         | 
| 249 249 | 
             
                else
         | 
| 250 250 | 
             
                  assert(ad.nssa_default_originate)
         | 
| 251 251 | 
             
                end
         | 
| 252 252 | 
             
                assert_equal(ad.default_nssa_no_redistribution, ad.nssa_no_redistribution)
         | 
| 253 253 | 
             
                assert_equal(ad.default_nssa_no_summary, ad.nssa_no_summary)
         | 
| 254 | 
            -
                if node.product_id[/ | 
| 254 | 
            +
                if node.product_id[/N9K-F/]
         | 
| 255 255 | 
             
                  refute_equal('aaa', ad.nssa_route_map)
         | 
| 256 256 | 
             
                else
         | 
| 257 257 | 
             
                  assert_equal('aaa', ad.nssa_route_map)
         | 
    
        data/tests/test_tacacs_server.rb
    CHANGED
    
    | @@ -140,7 +140,7 @@ class TestTacacsServer < CiscoTestCase | |
| 140 140 | 
             
                tacacs = TacacsServer.new
         | 
| 141 141 |  | 
| 142 142 | 
             
                if platform == :nexus
         | 
| 143 | 
            -
                  assert_equal(sh_run_encryption_password,
         | 
| 143 | 
            +
                  assert_equal(Utils.add_quotes(sh_run_encryption_password),
         | 
| 144 144 | 
             
                               tacacs.encryption_password,
         | 
| 145 145 | 
             
                               'Error: Tacacs Server, encryption password incorrect')
         | 
| 146 146 | 
             
                elsif platform == :ios_xr
         | 
| @@ -186,7 +186,7 @@ class TestTacacsServer < CiscoTestCase | |
| 186 186 | 
             
                encrypted_type = md.to_s.split(' ').last.to_i
         | 
| 187 187 | 
             
                assert_equal(encrypted_type, tacacs.encryption_type,
         | 
| 188 188 | 
             
                             'Error: Tacacs Server, encryption type incorrect')
         | 
| 189 | 
            -
                assert_equal(encrypted_password, tacacs.encryption_password,
         | 
| 189 | 
            +
                assert_equal(Utils.add_quotes(encrypted_password), tacacs.encryption_password,
         | 
| 190 190 | 
             
                             'Error: Tacacs Server, encryption password incorrect')
         | 
| 191 191 | 
             
                tacacs.destroy
         | 
| 192 192 | 
             
              end
         | 
| @@ -299,7 +299,7 @@ class TestTacacsSvrHost < CiscoTestCase | |
| 299 299 | 
             
                host.encryption_key_set(0, pass)
         | 
| 300 300 |  | 
| 301 301 | 
             
                if platform != :ios_xr
         | 
| 302 | 
            -
                  assert_equal(sh_run_pass, host.encryption_password,
         | 
| 302 | 
            +
                  assert_equal(Utils.add_quotes(sh_run_pass), host.encryption_password,
         | 
| 303 303 | 
             
                               'Error: Tacacs Host encryption password incorrect')
         | 
| 304 304 | 
             
                else
         | 
| 305 305 | 
             
                  # Only do not-nil checking for IOS XR
         | 
| @@ -339,7 +339,7 @@ class TestTacacsSvrHost < CiscoTestCase | |
| 339 339 | 
             
                  pass_no_quotes = md.captures[1].gsub(/(?:^\")|(?:\"$)/, '')
         | 
| 340 340 | 
             
                  assert_equal(sh_run_pass, pass_no_quotes,
         | 
| 341 341 | 
             
                               'Error: Tacacs Host encryption password mismatch')
         | 
| 342 | 
            -
                  assert_equal(sh_run_pass, host.encryption_password,
         | 
| 342 | 
            +
                  assert_equal(Utils.add_quotes(sh_run_pass), host.encryption_password,
         | 
| 343 343 | 
             
                               'Error: Tacacs Host encryption password incorrect')
         | 
| 344 344 | 
             
                else
         | 
| 345 345 | 
             
                  # Only do not-nil checking for IOS XR
         | 
    
        data/tests/test_vlan.rb
    CHANGED
    
    | @@ -149,6 +149,20 @@ class TestVlan < CiscoTestCase | |
| 149 149 | 
             
                v.destroy
         | 
| 150 150 | 
             
              end
         | 
| 151 151 |  | 
| 152 | 
            +
              def test_name_long
         | 
| 153 | 
            +
                config 'system vlan long-name'
         | 
| 154 | 
            +
                v = Vlan.new(1000)
         | 
| 155 | 
            +
                name = 'LONG_NAME' + ('E' * 119)
         | 
| 156 | 
            +
                v.vlan_name = name
         | 
| 157 | 
            +
                assert_equal(name, v.vlan_name)
         | 
| 158 | 
            +
                name = 'LONG_NAME' + ('E' * 120)
         | 
| 159 | 
            +
                assert_raises(Cisco::CliError) do
         | 
| 160 | 
            +
                  v.vlan_name = name
         | 
| 161 | 
            +
                end
         | 
| 162 | 
            +
                v.destroy
         | 
| 163 | 
            +
                config 'no system vlan long-name'
         | 
| 164 | 
            +
              end
         | 
| 165 | 
            +
             | 
| 152 166 | 
             
              def test_state_invalid
         | 
| 153 167 | 
             
                v = Vlan.new(1000)
         | 
| 154 168 | 
             
                assert_raises(CliError) do
         | 
    
        data/tests/test_yum.rb
    CHANGED
    
    | @@ -122,10 +122,10 @@ class TestYum < CiscoTestCase | |
| 122 122 | 
             
              end
         | 
| 123 123 |  | 
| 124 124 | 
             
              def test_package_does_not_exist_error
         | 
| 125 | 
            -
                assert_raises( | 
| 125 | 
            +
                assert_raises(Cisco::CliError) do
         | 
| 126 126 | 
             
                  Yum.install('bootflash:this_is_not_real.rpm', 'management')
         | 
| 127 127 | 
             
                end
         | 
| 128 | 
            -
                assert_raises( | 
| 128 | 
            +
                assert_raises(Cisco::CliError) do
         | 
| 129 129 | 
             
                  Yum.install('also_not_real', 'management')
         | 
| 130 130 | 
             
                end
         | 
| 131 131 | 
             
              end
         | 
    
        data/tests/yum_package.yaml
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cisco_node_utils
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.5.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Rob Gries
         | 
| @@ -14,7 +14,7 @@ authors: | |
| 14 14 | 
             
            autorequire: 
         | 
| 15 15 | 
             
            bindir: bin
         | 
| 16 16 | 
             
            cert_chain: []
         | 
| 17 | 
            -
            date:  | 
| 17 | 
            +
            date: 2017-01-10 00:00:00.000000000 Z
         | 
| 18 18 | 
             
            dependencies:
         | 
| 19 19 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 20 20 | 
             
              name: bundler
         | 
| @@ -209,9 +209,11 @@ files: | |
| 209 209 | 
             
            - lib/cisco_node_utils/cmd_ref/fabricpath.yaml
         | 
| 210 210 | 
             
            - lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml
         | 
| 211 211 | 
             
            - lib/cisco_node_utils/cmd_ref/feature.yaml
         | 
| 212 | 
            +
            - lib/cisco_node_utils/cmd_ref/hsrp_global.yaml
         | 
| 212 213 | 
             
            - lib/cisco_node_utils/cmd_ref/images.yaml
         | 
| 213 214 | 
             
            - lib/cisco_node_utils/cmd_ref/interface.yaml
         | 
| 214 215 | 
             
            - lib/cisco_node_utils/cmd_ref/interface_channel_group.yaml
         | 
| 216 | 
            +
            - lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml
         | 
| 215 217 | 
             
            - lib/cisco_node_utils/cmd_ref/interface_ospf.yaml
         | 
| 216 218 | 
             
            - lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml
         | 
| 217 219 | 
             
            - lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml
         | 
| @@ -270,9 +272,11 @@ files: | |
| 270 272 | 
             
            - lib/cisco_node_utils/fabricpath_global.rb
         | 
| 271 273 | 
             
            - lib/cisco_node_utils/fabricpath_topology.rb
         | 
| 272 274 | 
             
            - lib/cisco_node_utils/feature.rb
         | 
| 275 | 
            +
            - lib/cisco_node_utils/hsrp_global.rb
         | 
| 273 276 | 
             
            - lib/cisco_node_utils/interface.rb
         | 
| 274 277 | 
             
            - lib/cisco_node_utils/interface_DEPRECATED.rb
         | 
| 275 278 | 
             
            - lib/cisco_node_utils/interface_channel_group.rb
         | 
| 279 | 
            +
            - lib/cisco_node_utils/interface_hsrp_group.rb
         | 
| 276 280 | 
             
            - lib/cisco_node_utils/interface_ospf.rb
         | 
| 277 281 | 
             
            - lib/cisco_node_utils/interface_portchannel.rb
         | 
| 278 282 | 
             
            - lib/cisco_node_utils/interface_service_vni.rb
         | 
| @@ -372,9 +376,12 @@ files: | |
| 372 376 | 
             
            - tests/test_fabricpath_topology.rb
         | 
| 373 377 | 
             
            - tests/test_feature.rb
         | 
| 374 378 | 
             
            - tests/test_grpc.rb
         | 
| 379 | 
            +
            - tests/test_hsrp_global.rb
         | 
| 375 380 | 
             
            - tests/test_interface.rb
         | 
| 376 381 | 
             
            - tests/test_interface_bdi.rb
         | 
| 377 382 | 
             
            - tests/test_interface_channel_group.rb
         | 
| 383 | 
            +
            - tests/test_interface_hsrp.rb
         | 
| 384 | 
            +
            - tests/test_interface_hsrp_group.rb
         | 
| 378 385 | 
             
            - tests/test_interface_ospf.rb
         | 
| 379 386 | 
             
            - tests/test_interface_portchannel.rb
         | 
| 380 387 | 
             
            - tests/test_interface_private_vlan.rb
         | 
| @@ -451,7 +458,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 451 458 | 
             
                  version: 2.1.0
         | 
| 452 459 | 
             
            requirements: []
         | 
| 453 460 | 
             
            rubyforge_project: 
         | 
| 454 | 
            -
            rubygems_version: 2. | 
| 461 | 
            +
            rubygems_version: 2.4.6
         | 
| 455 462 | 
             
            signing_key: 
         | 
| 456 463 | 
             
            specification_version: 4
         | 
| 457 464 | 
             
            summary: Utilities for management of Cisco network nodes
         |