cisco_node_utils 1.8.0 → 1.9.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -1
  3. data/README.md +4 -4
  4. data/docs/README-maintainers.md +1 -0
  5. data/lib/cisco_node_utils/bgp_neighbor.rb +20 -0
  6. data/lib/cisco_node_utils/bgp_neighbor_af.rb +20 -0
  7. data/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +7 -0
  8. data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +7 -0
  9. data/lib/cisco_node_utils/cmd_ref/evpn_multicast.yaml +12 -0
  10. data/lib/cisco_node_utils/cmd_ref/evpn_multisite.yaml +18 -0
  11. data/lib/cisco_node_utils/cmd_ref/evpn_stormcontrol.yaml +18 -0
  12. data/lib/cisco_node_utils/cmd_ref/feature.yaml +7 -0
  13. data/lib/cisco_node_utils/cmd_ref/interface_evpn_multisite.yaml +17 -0
  14. data/lib/cisco_node_utils/cmd_ref/ip_multicast.yaml +18 -0
  15. data/lib/cisco_node_utils/cmd_ref/vrf_af.yaml +21 -0
  16. data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +6 -0
  17. data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +7 -0
  18. data/lib/cisco_node_utils/evpn_multicast.rb +66 -0
  19. data/lib/cisco_node_utils/evpn_multisite.rb +96 -0
  20. data/lib/cisco_node_utils/evpn_stormcontrol.rb +84 -0
  21. data/lib/cisco_node_utils/feature.rb +19 -0
  22. data/lib/cisco_node_utils/interface.rb +2 -1
  23. data/lib/cisco_node_utils/interface_evpn_multisite.rb +63 -0
  24. data/lib/cisco_node_utils/ip_multicast.rb +86 -0
  25. data/lib/cisco_node_utils/version.rb +2 -2
  26. data/lib/cisco_node_utils/vrf_af.rb +56 -5
  27. data/lib/cisco_node_utils/vxlan_vtep.rb +24 -0
  28. data/lib/cisco_node_utils/vxlan_vtep_vni.rb +21 -0
  29. data/tests/ciscotest.rb +36 -3
  30. data/tests/tacacs_server.yaml.example +1 -1
  31. data/tests/test_bgp_af.rb +1 -1
  32. data/tests/test_bgp_neighbor.rb +15 -0
  33. data/tests/test_bgp_neighbor_af.rb +27 -0
  34. data/tests/test_evpn_multicast.rb +65 -0
  35. data/tests/test_evpn_multisite.rb +70 -0
  36. data/tests/test_evpn_stormcontrol.rb +56 -0
  37. data/tests/test_feature.rb +6 -1
  38. data/tests/test_interface_evpn_multisite.rb +59 -0
  39. data/tests/test_ip_multicast.rb +69 -0
  40. data/tests/test_node_ext.rb +3 -2
  41. data/tests/test_radius_global.rb +7 -5
  42. data/tests/test_router_ospf_vrf.rb +2 -0
  43. data/tests/test_stp_global.rb +7 -0
  44. data/tests/test_tacacs_global.rb +10 -7
  45. data/tests/test_vrf_af.rb +52 -1
  46. data/tests/test_vxlan_vtep.rb +23 -0
  47. data/tests/test_vxlan_vtep_vni.rb +31 -0
  48. data/tests/yum_package.yaml +10 -0
  49. metadata +18 -3
@@ -333,7 +333,7 @@ class TestNodeExt < CiscoTestCase
333
333
  if validate_property_excluded?('show_version', 'last_reset_time')
334
334
  assert_nil(node.last_reset_time)
335
335
  else
336
- refute_nil(node.last_reset_time)
336
+ refute_nil(node.last_reset_time) unless virtual_platform?
337
337
  end
338
338
  end
339
339
 
@@ -345,7 +345,8 @@ class TestNodeExt < CiscoTestCase
345
345
  assert_output_check(command: 'show version',
346
346
  pattern: /.*\nLast reset.*\n\n? Reason: (.*)\n/,
347
347
  check: node.last_reset_reason,
348
- msg: 'Error, Last reset reason does not match')
348
+ msg: 'Error, Last reset reason does not match') unless
349
+ virtual_platform?
349
350
  end
350
351
 
351
352
  def test_get_system_cpu_utilization
@@ -71,11 +71,13 @@ class TestRadiusGlobal < CiscoTestCase
71
71
  assert_match(/#{key}/, global.key)
72
72
  assert_match(/#{key}/, Cisco::RadiusGlobal.radius_global[id].key)
73
73
  assert_equal(7, global.key_format)
74
- # Change to type 6
75
- key = 'JDYkqyIFWeBvzpljSfWmRZrmRSRE8'
76
- global.key_set(key, 6)
77
- assert_match(/#{key}/, global.key)
78
- assert_equal(6, global.key_format)
74
+ unless Platform.image_version[/I2|I4/] # legacy defect CSCvb57180
75
+ # Change to type 6
76
+ key = 'JDYkqyIFWeBvzpljSfWmRZrmRSRE8'
77
+ global.key_set(key, 6)
78
+ assert_match(/#{key}/, global.key)
79
+ assert_equal(6, global.key_format)
80
+ end
79
81
  elsif platform == :ios_xr
80
82
  global.key_set('QsEfThUkO', nil)
81
83
  assert(!global.key.nil?)
@@ -300,6 +300,8 @@ class TestRouterOspfVrf < CiscoTestCase
300
300
  assert_equal(metric, vrf.default_metric,
301
301
  "Error: #{vrf.name} vrf, default-metric get value mismatch")
302
302
 
303
+ skip_versions = ['7.0.3.I7.3']
304
+ return unless step_unless_legacy_defect(skip_versions, 'CSCvi74876: Cannot remove default metric')
303
305
  vrf.default_metric = vrf.default_default_metric
304
306
  refute_match_vrf_line(vrf.parent.name, vrf.name, pattern)
305
307
  vrf.parent.destroy
@@ -492,6 +492,13 @@ class TestStpGlobal < CiscoTestCase
492
492
  @intf.stp_port_type = @intf.default_stp_port_type
493
493
  assert_equal(@intf.default_stp_port_type,
494
494
  @intf.stp_port_type)
495
+ # Set default again and check. This is needed since
496
+ # we query the stp_port_type to use with the 'no'
497
+ # form of the command and false is not a valid
498
+ # stp_port_type
499
+ @intf.stp_port_type = @intf.default_stp_port_type
500
+ assert_equal(@intf.default_stp_port_type,
501
+ @intf.stp_port_type)
495
502
  end
496
503
 
497
504
  def test_intf_stp_mst_cost_change
@@ -77,13 +77,16 @@ class TestTacacsGlobal < CiscoTestCase
77
77
  assert_equal(7, global.key_format)
78
78
  assert_equal('"WAWY_NZB"', global.key)
79
79
 
80
- # second key change - modify key to type6
81
- key_format = 6
82
- # Must use a valid type6 password: CSCvb36266
83
- key = 'JDYkqyIFWeBvzpljSfWmRZrmRSRE8'
84
- global.encryption_key_set(key_format, key)
85
- assert_equal(key_format, global.key_format)
86
- assert_equal("\"#{key}\"", global.key)
80
+ skip_versions = ['7.0.3.(I2|I3)', '7.0.3.I4.[1-7]']
81
+ if step_unless_legacy_defect(skip_versions, 'CSCvh72911: Cannot configure tacacs-server key 6')
82
+ # second key change - modify key to type6
83
+ key_format = 6
84
+ # Must use a valid type6 password: CSCvb36266
85
+ key = 'JDYkqyIFWeBvzpljSfWmRZrmRSRE8'
86
+ global.encryption_key_set(key_format, key)
87
+ assert_equal(key_format, global.key_format)
88
+ assert_equal("\"#{key}\"", global.key)
89
+ end
87
90
 
88
91
  # Remove global key
89
92
  global.encryption_key_set('', '')
data/tests/test_vrf_af.rb CHANGED
@@ -116,14 +116,21 @@ class TestVrfAf < CiscoTestCase
116
116
  vdc_limit_f3_no_intf_needed(:clear)
117
117
  end
118
118
 
119
- def route_target(af)
119
+ def route_target(af, _test_mvpn=false)
120
120
  # Common tester for route-target properties. Tests evpn and non-evpn.
121
121
  # route_target_both_auto
122
122
  # route_target_both_auto_evpn
123
+ # route_target_both_auto_mvpn
123
124
  # route_target_export
124
125
  # route_target_export_evpn
126
+ # route_target_export_mvpn
125
127
  # route_target_import
126
128
  # route_target_import_evpn
129
+ # route_target_import_mvpn
130
+
131
+ # mvpn tests are only supported on 7.0.3.I7.1 and later
132
+ mvpn_skip_versions = ['7.0.3.(I2|I3|I4|I5|I6)']
133
+
127
134
  vrf = 'orange'
128
135
  v = VrfAF.new(vrf, af)
129
136
 
@@ -134,6 +141,11 @@ class TestVrfAf < CiscoTestCase
134
141
  refute(v.default_route_target_both_auto_evpn,
135
142
  'default value for route target both auto evpn should be false')
136
143
 
144
+ if step_unless_version_unsupported(mvpn_skip_versions)
145
+ refute(v.default_route_target_both_auto_mvpn,
146
+ 'default value for route target both auto mvpn should be false')
147
+ end
148
+
137
149
  if validate_property_excluded?('vrf_af', 'route_target_both_auto')
138
150
  assert_raises(Cisco::UnsupportedError) { v.route_target_both_auto = true }
139
151
  else
@@ -160,6 +172,22 @@ class TestVrfAf < CiscoTestCase
160
172
  'v route-target both auto evpn should be disabled')
161
173
  end
162
174
 
175
+ if step_unless_version_unsupported(mvpn_skip_versions)
176
+ if validate_property_excluded?('vrf_af', 'route_target_both_auto_mvpn')
177
+ assert_raises(Cisco::UnsupportedError) do
178
+ v.route_target_both_auto_mvpn = true
179
+ end
180
+ else
181
+ v.route_target_both_auto_mvpn = true
182
+ assert(v.route_target_both_auto_mvpn, "vrf context #{vrf} af #{af}: "\
183
+ 'v route-target both auto mvpn should be enabled')
184
+
185
+ v.route_target_both_auto_mvpn = false
186
+ refute(v.route_target_both_auto_mvpn, "vrf context #{vrf} af #{af}: "\
187
+ 'v route-target both auto mvpn should be disabled')
188
+ end
189
+ end
190
+
163
191
  opts = [:import, :export]
164
192
 
165
193
  # Master list of communities to test against
@@ -185,6 +213,9 @@ class TestVrfAf < CiscoTestCase
185
213
  end
186
214
 
187
215
  def route_target_tester(v, af, opts, should, test_id)
216
+ # mvpn tests are only supported on 7.0.3.I7.1 and later
217
+ mvpn_skip_versions = ['7.0.3.(I2|I3|I4|I5|I6)']
218
+
188
219
  # First configure all four property types
189
220
  opts.each do |opt|
190
221
  # non-evpn
@@ -197,6 +228,16 @@ class TestVrfAf < CiscoTestCase
197
228
  else
198
229
  v.send("route_target_#{opt}_evpn=", should)
199
230
  end
231
+ # mvpn
232
+ if step_unless_version_unsupported(mvpn_skip_versions)
233
+ if validate_property_excluded?('vrf_af', "route_target_#{opt}_mvpn")
234
+ assert_raises(Cisco::UnsupportedError, "route_target_#{opt}_mvpn=") do
235
+ v.send("route_target_#{opt}_mvpn=", should)
236
+ end
237
+ else
238
+ v.send("route_target_#{opt}_mvpn=", should)
239
+ end
240
+ end
200
241
  # stitching
201
242
  if platform == :nexus
202
243
  assert_raises(Cisco::UnsupportedError,
@@ -222,6 +263,16 @@ class TestVrfAf < CiscoTestCase
222
263
  assert_equal(should, result,
223
264
  "#{test_id} : #{af} : route_target_#{opt}_evpn")
224
265
  end
266
+ # mvpn
267
+ if step_unless_version_unsupported(mvpn_skip_versions)
268
+ result = v.send("route_target_#{opt}_mvpn")
269
+ if validate_property_excluded?('vrf_af', "route_target_#{opt}_mvpn")
270
+ assert_nil(result)
271
+ else
272
+ assert_equal(should, result,
273
+ "#{test_id} : #{af} : route_target_#{opt}_mvpn")
274
+ end
275
+ end
225
276
  # stitching
226
277
  result = v.send("route_target_#{opt}_stitching")
227
278
  if platform == :nexus
@@ -16,6 +16,7 @@ require_relative 'ciscotest'
16
16
  require_relative '../lib/cisco_node_utils/feature'
17
17
  require_relative '../lib/cisco_node_utils/vxlan_vtep'
18
18
  require_relative '../lib/cisco_node_utils/vdc'
19
+ require_relative '../lib/cisco_node_utils/evpn_multisite'
19
20
 
20
21
  include Cisco
21
22
 
@@ -182,6 +183,28 @@ class TestVxlanVtep < CiscoTestCase
182
183
  assert_equal(val, vtep.source_interface)
183
184
  end
184
185
 
186
+ def test_multisite_bg_interface
187
+ skip("#{node.product_id} doesn't support this feature") unless
188
+ node.product_id[/N9K.*EX/]
189
+ vtep = VxlanVtep.new('nve1')
190
+
191
+ # Set multisite_bg_interface to non-default value
192
+ val = 'loopback55'
193
+ ms = EvpnMultisite.new(100)
194
+ vtep.multisite_border_gateway_interface = val
195
+ assert_equal(val, vtep.multisite_border_gateway_interface)
196
+
197
+ vtep.multisite_border_gateway_interface = vtep.default_multisite_border_gateway_interface
198
+ assert_equal(vtep.default_multisite_border_gateway_interface,
199
+ vtep.multisite_border_gateway_interface)
200
+
201
+ # Should Error when no 'evpn multisite border-gateway' set
202
+ ms.destroy
203
+ assert_raises(Cisco::CliError) do
204
+ vtep.multisite_border_gateway_interface = val
205
+ end
206
+ end
207
+
185
208
  def test_source_interface_hold_down_time
186
209
  vtep = VxlanVtep.new('nve1')
187
210
  if validate_property_excluded?('vxlan_vtep', 'source_intf_hold_down_time')
@@ -15,6 +15,7 @@
15
15
  require_relative 'ciscotest'
16
16
  require_relative '../lib/cisco_node_utils/vxlan_vtep'
17
17
  require_relative '../lib/cisco_node_utils/vxlan_vtep_vni'
18
+ require_relative '../lib/cisco_node_utils/evpn_multisite'
18
19
 
19
20
  include Cisco
20
21
 
@@ -258,4 +259,34 @@ class TestVxlanVtepVni < CiscoTestCase
258
259
  vni.suppress_uuc = vni.default_suppress_uuc
259
260
  refute(vni.suppress_uuc, 'suppress_uuc should be disabled')
260
261
  end
262
+
263
+ def test_multisite_ingress_replication
264
+ skip("#{node.product_id} doesn't support this feature") unless
265
+ node.product_id[/N9K.*EX/]
266
+
267
+ vni = VxlanVtepVni.new('nve1', '6000')
268
+ ms = EvpnMultisite.new(100)
269
+
270
+ # Test: Default
271
+ vni.multisite_ingress_replication =
272
+ vni.default_multisite_ingress_replication
273
+ refute(vni.multisite_ingress_replication,
274
+ 'multisite ingress-replication should be disabled')
275
+
276
+ # Test: Enable multisite_ingress_replication
277
+ vni.multisite_ingress_replication = true
278
+ assert(vni.multisite_ingress_replication,
279
+ 'multisite ingress-replication should be enabled')
280
+
281
+ # Test: Disable multisite_ingress_replication
282
+ vni.multisite_ingress_replication = false
283
+ refute(vni.multisite_ingress_replication,
284
+ 'multisite ingress-replication should be disabled')
285
+
286
+ ms.destroy
287
+ # Test: enabling multisite ingress-replication without a multisite bg errors
288
+ assert_raises(Cisco::CliError) do
289
+ vni.multisite_ingress_replication = true
290
+ end
291
+ end
261
292
  end
@@ -68,6 +68,16 @@
68
68
  name: 'nxos.sample-n9k_ALL'
69
69
  version: '1.0.0-7.0.3.I7.1'
70
70
 
71
+ 7_0_3_I7_2_:
72
+ filename: 'nxos.sample-n9k_ALL-1.0.0-7.0.3.I7.2.lib32_n9000.rpm'
73
+ name: 'nxos.sample-n9k_ALL'
74
+ version: '1.0.0-7.0.3.I7.2'
75
+
76
+ 7_0_3_I7_3_:
77
+ filename: 'nxos.sample-n9k_ALL-1.0.0-7.0.3.I7.3.lib32_n9000.rpm'
78
+ name: 'nxos.sample-n9k_ALL'
79
+ version: '1.0.0-7.0.3.I7.3'
80
+
71
81
  7_0_3_F1_1_:
72
82
  filename: 'nxos.sample-n8k_EOR-1.0.0-7.0.3.F1.1.lib32_nxos.rpm'
73
83
  name: 'nxos.sample-n8k_EOR'
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.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Gries
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-12-13 00:00:00.000000000 Z
18
+ date: 2018-04-19 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler
@@ -222,6 +222,9 @@ files:
222
222
  - lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml
223
223
  - lib/cisco_node_utils/cmd_ref/dnsclient.yaml
224
224
  - lib/cisco_node_utils/cmd_ref/encapsulation.yaml
225
+ - lib/cisco_node_utils/cmd_ref/evpn_multicast.yaml
226
+ - lib/cisco_node_utils/cmd_ref/evpn_multisite.yaml
227
+ - lib/cisco_node_utils/cmd_ref/evpn_stormcontrol.yaml
225
228
  - lib/cisco_node_utils/cmd_ref/evpn_vni.yaml
226
229
  - lib/cisco_node_utils/cmd_ref/fabricpath.yaml
227
230
  - lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml
@@ -230,11 +233,13 @@ files:
230
233
  - lib/cisco_node_utils/cmd_ref/images.yaml
231
234
  - lib/cisco_node_utils/cmd_ref/interface.yaml
232
235
  - lib/cisco_node_utils/cmd_ref/interface_channel_group.yaml
236
+ - lib/cisco_node_utils/cmd_ref/interface_evpn_multisite.yaml
233
237
  - lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml
234
238
  - lib/cisco_node_utils/cmd_ref/interface_ospf.yaml
235
239
  - lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml
236
240
  - lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml
237
241
  - lib/cisco_node_utils/cmd_ref/inventory.yaml
242
+ - lib/cisco_node_utils/cmd_ref/ip_multicast.yaml
238
243
  - lib/cisco_node_utils/cmd_ref/itd_device_group.yaml
239
244
  - lib/cisco_node_utils/cmd_ref/itd_service.yaml
240
245
  - lib/cisco_node_utils/cmd_ref/memory.yaml
@@ -289,6 +294,9 @@ files:
289
294
  - lib/cisco_node_utils/domain_name.rb
290
295
  - lib/cisco_node_utils/encapsulation.rb
291
296
  - lib/cisco_node_utils/environment.rb
297
+ - lib/cisco_node_utils/evpn_multicast.rb
298
+ - lib/cisco_node_utils/evpn_multisite.rb
299
+ - lib/cisco_node_utils/evpn_stormcontrol.rb
292
300
  - lib/cisco_node_utils/evpn_vni.rb
293
301
  - lib/cisco_node_utils/exceptions.rb
294
302
  - lib/cisco_node_utils/fabricpath_global.rb
@@ -298,10 +306,12 @@ files:
298
306
  - lib/cisco_node_utils/interface.rb
299
307
  - lib/cisco_node_utils/interface_DEPRECATED.rb
300
308
  - lib/cisco_node_utils/interface_channel_group.rb
309
+ - lib/cisco_node_utils/interface_evpn_multisite.rb
301
310
  - lib/cisco_node_utils/interface_hsrp_group.rb
302
311
  - lib/cisco_node_utils/interface_ospf.rb
303
312
  - lib/cisco_node_utils/interface_portchannel.rb
304
313
  - lib/cisco_node_utils/interface_service_vni.rb
314
+ - lib/cisco_node_utils/ip_multicast.rb
305
315
  - lib/cisco_node_utils/itd_device_group.rb
306
316
  - lib/cisco_node_utils/itd_device_group_node.rb
307
317
  - lib/cisco_node_utils/itd_service.rb
@@ -400,6 +410,9 @@ files:
400
410
  - tests/test_dns_domain.rb
401
411
  - tests/test_domain_name.rb
402
412
  - tests/test_encapsulation.rb
413
+ - tests/test_evpn_multicast.rb
414
+ - tests/test_evpn_multisite.rb
415
+ - tests/test_evpn_stormcontrol.rb
403
416
  - tests/test_evpn_vni.rb
404
417
  - tests/test_fabricpath_global.rb
405
418
  - tests/test_fabricpath_topology.rb
@@ -409,6 +422,7 @@ files:
409
422
  - tests/test_interface.rb
410
423
  - tests/test_interface_bdi.rb
411
424
  - tests/test_interface_channel_group.rb
425
+ - tests/test_interface_evpn_multisite.rb
412
426
  - tests/test_interface_hsrp.rb
413
427
  - tests/test_interface_hsrp_group.rb
414
428
  - tests/test_interface_ospf.rb
@@ -417,6 +431,7 @@ files:
417
431
  - tests/test_interface_service_vni.rb
418
432
  - tests/test_interface_svi.rb
419
433
  - tests/test_interface_switchport.rb
434
+ - tests/test_ip_multicast.rb
420
435
  - tests/test_itd_device_group.rb
421
436
  - tests/test_itd_device_group_node.rb
422
437
  - tests/test_itd_service.rb
@@ -493,7 +508,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
493
508
  version: 2.1.0
494
509
  requirements: []
495
510
  rubyforge_project:
496
- rubygems_version: 2.4.6
511
+ rubygems_version: 2.5.2.1
497
512
  signing_key:
498
513
  specification_version: 4
499
514
  summary: Utilities for management of Cisco network nodes