cisco_node_utils 1.10.0 → 2.0.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/.travis.yml +2 -0
- data/CHANGELOG.md +25 -0
- data/lib/cisco_node_utils/bgp.rb +1 -1
- data/lib/cisco_node_utils/cisco_cmn_utils.rb +11 -3
- data/lib/cisco_node_utils/client/nxapi/client.rb +40 -6
- data/lib/cisco_node_utils/cmd_ref/acl.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/banner.yaml +5 -1
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +8 -1
- data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +5 -0
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/route_map.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/vtp.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +30 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +9 -2
- data/lib/cisco_node_utils/command_reference.rb +2 -2
- data/lib/cisco_node_utils/dhcp_relay_global.rb +1 -5
- data/lib/cisco_node_utils/feature.rb +30 -4
- data/lib/cisco_node_utils/interface.rb +3 -3
- data/lib/cisco_node_utils/interface_service_vni.rb +1 -1
- data/lib/cisco_node_utils/node.rb +11 -22
- data/lib/cisco_node_utils/node_util.rb +1 -1
- data/lib/cisco_node_utils/radius_global.rb +3 -3
- data/lib/cisco_node_utils/radius_server.rb +1 -2
- data/lib/cisco_node_utils/route_map.rb +1 -1
- data/lib/cisco_node_utils/router_ospf_vrf.rb +49 -5
- data/lib/cisco_node_utils/tacacs_global.rb +1 -2
- data/lib/cisco_node_utils/tacacs_server.rb +1 -2
- data/lib/cisco_node_utils/tacacs_server_host.rb +1 -2
- data/lib/cisco_node_utils/version.rb +1 -1
- data/lib/cisco_node_utils/vlan.rb +1 -1
- data/lib/cisco_node_utils/vxlan_vtep.rb +89 -4
- data/lib/cisco_node_utils/vxlan_vtep_vni.rb +32 -1
- data/spec/schema.yaml +2 -0
- data/tests/basetest.rb +40 -4
- data/tests/ciscotest.rb +15 -5
- data/tests/cmd_config.yaml +0 -2
- data/tests/test_acl.rb +1 -1
- data/tests/test_bgp_af.rb +6 -0
- data/tests/test_feature.rb +30 -4
- data/tests/test_interface.rb +5 -7
- data/tests/test_interface_ospf.rb +5 -1
- data/tests/test_interface_private_vlan.rb +18 -1
- data/tests/test_interface_svi.rb +1 -1
- data/tests/test_interface_switchport.rb +4 -7
- data/tests/test_node_ext.rb +1 -1
- data/tests/test_nxapi.rb +18 -8
- data/tests/test_radius_global.rb +3 -2
- data/tests/test_route_map.rb +2 -4
- data/tests/test_router_bgp.rb +10 -14
- data/tests/test_router_ospf_vrf.rb +61 -0
- data/tests/test_snmpserver.rb +1 -1
- data/tests/test_tacacs_global.rb +4 -2
- data/tests/test_upgrade.rb +1 -1
- data/tests/test_vrf.rb +2 -0
- data/tests/test_vrf_af.rb +2 -0
- data/tests/test_vtp.rb +6 -4
- data/tests/test_vxlan_vtep.rb +93 -1
- data/tests/test_vxlan_vtep_vni.rb +35 -1
- data/tests/yum_package.yaml +5 -0
- metadata +3 -3
data/tests/ciscotest.rb
CHANGED
@@ -153,12 +153,16 @@ class CiscoTestCase < TestCase
|
|
153
153
|
# Some NXOS hardware is not capable of supporting certain features even
|
154
154
|
# though the platform family in general includes support. In these cases
|
155
155
|
# the NU feature setter will raise a RuntimeError.
|
156
|
-
|
156
|
+
# Default behavior is to skip/flunk.
|
157
|
+
def hardware_supports_feature?(message, status_only: false)
|
157
158
|
patterns = ['Hardware is not capable of supporting',
|
158
159
|
'is unsupported on this node',
|
160
|
+
'Feature NOT supported on this Platform',
|
159
161
|
]
|
160
|
-
|
161
|
-
|
162
|
+
if message[Regexp.union(patterns)]
|
163
|
+
return true if status_only
|
164
|
+
skip('Skip test: Feature is unsupported on this device')
|
165
|
+
end
|
162
166
|
flunk(message)
|
163
167
|
end
|
164
168
|
|
@@ -213,6 +217,12 @@ class CiscoTestCase < TestCase
|
|
213
217
|
Gem::Version.new(lim) < Gem::Version.new(ver)
|
214
218
|
end
|
215
219
|
|
220
|
+
def skip_if_UnsupportedCmdRef(feature_name, attribute_name) # rubocop:disable Style/MethodName
|
221
|
+
# Check if attr is excluded by the cmd_ref yaml
|
222
|
+
skip("UnsupportedCmdRef attribute: '#{attribute_name}'") if
|
223
|
+
cmd_ref.lookup(feature_name, attribute_name).is_a?(UnsupportedCmdRef)
|
224
|
+
end
|
225
|
+
|
216
226
|
def skip_nexus_i2_image?
|
217
227
|
skip("This property is not supported on Nexus 'I2' images") if
|
218
228
|
Utils.nexus_i2_image
|
@@ -550,7 +560,7 @@ class CiscoTestCase < TestCase
|
|
550
560
|
when /N3K-C35/
|
551
561
|
tag = 'n35'
|
552
562
|
when /N3/
|
553
|
-
tag = Utils.
|
563
|
+
tag = Utils.fretta? ? 'n3k-f' : 'n3k'
|
554
564
|
when /N5/
|
555
565
|
tag = 'n5k'
|
556
566
|
when /N6/
|
@@ -558,7 +568,7 @@ class CiscoTestCase < TestCase
|
|
558
568
|
when /N7/
|
559
569
|
tag = 'n7k'
|
560
570
|
when /N9/
|
561
|
-
tag = Utils.
|
571
|
+
tag = Utils.fretta? ? 'n9k-f' : 'n9k'
|
562
572
|
else
|
563
573
|
fail "Unrecognized product_id: #{@product_id}"
|
564
574
|
end
|
data/tests/cmd_config.yaml
CHANGED
@@ -12,7 +12,6 @@ nexus:
|
|
12
12
|
feature hsrp
|
13
13
|
feature lacp
|
14
14
|
feature dhcp
|
15
|
-
feature vtp
|
16
15
|
|
17
16
|
feature-disable:
|
18
17
|
command: |
|
@@ -25,7 +24,6 @@ nexus:
|
|
25
24
|
no feature hsrp
|
26
25
|
no feature lacp
|
27
26
|
no feature dhcp
|
28
|
-
no feature vtp
|
29
27
|
nvgen: false
|
30
28
|
|
31
29
|
feature-snmp-comm-acl-ro:
|
data/tests/test_acl.rb
CHANGED
data/tests/test_bgp_af.rb
CHANGED
@@ -170,6 +170,12 @@ class TestBgpAF < CiscoTestCase
|
|
170
170
|
# triggers a version check below.
|
171
171
|
if expect == :runtime
|
172
172
|
case Platform.image_version
|
173
|
+
when /7\.3/
|
174
|
+
expect = :success if test == :additional_paths_send ||
|
175
|
+
test == :additional_paths_receive ||
|
176
|
+
test == :additional_paths_selection ||
|
177
|
+
test == :maximum_paths ||
|
178
|
+
test == :maximum_paths_ibgp
|
173
179
|
when /8.0|8.1|8.2|8.3|F3.2/
|
174
180
|
expect = :success
|
175
181
|
expect = :runtime if test == :additional_paths_receive && Platform.image_version[/8.0|8.1/]
|
data/tests/test_feature.rb
CHANGED
@@ -84,6 +84,8 @@ class TestFeature < CiscoTestCase
|
|
84
84
|
|
85
85
|
# Return testbed to pre-clean state
|
86
86
|
config("no feature #{feat_str}") unless pre_clean_enabled
|
87
|
+
rescue RuntimeError => e
|
88
|
+
hardware_supports_feature?(e.message)
|
87
89
|
end
|
88
90
|
|
89
91
|
###################
|
@@ -171,20 +173,22 @@ class TestFeature < CiscoTestCase
|
|
171
173
|
|
172
174
|
def test_vn_segment_vlan_based
|
173
175
|
vxlan_linecard?
|
174
|
-
Feature.
|
176
|
+
Feature.fabricpath_enable if node.product_id[/N(5|6)/]
|
177
|
+
Feature.nv_overlay_enable unless node.product_id[/N(3|5|6)/]
|
175
178
|
feature('vn_segment_vlan_based')
|
176
179
|
rescue RuntimeError => e
|
177
180
|
hardware_supports_feature?(e.message)
|
178
181
|
end
|
179
182
|
|
180
183
|
def test_vni
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
+
# 7k: 'feature vni'; All others: 'feature vn-segment-vlan-based'.
|
185
|
+
# Dependencies: 5/6k: feature-set fabricpath; 3/9k: feature nv overlay
|
186
|
+
if node.product_id[/N7/]
|
184
187
|
# vni can't be removed if nv overlay is present
|
185
188
|
config_no_warn('no feature nv overlay')
|
186
189
|
vdc_limit_f3_no_intf_needed(:set)
|
187
190
|
end
|
191
|
+
Feature.fabricpath_enable if node.product_id[/N(5|6)/]
|
188
192
|
feature('vni')
|
189
193
|
rescue RuntimeError => e
|
190
194
|
hardware_supports_feature?(e.message)
|
@@ -220,6 +224,28 @@ class TestFeature < CiscoTestCase
|
|
220
224
|
assert(Feature.fabric_enabled?, "(#{fs}) is not enabled")
|
221
225
|
end
|
222
226
|
|
227
|
+
def test_feature_set_fabricpath
|
228
|
+
if node.product_id[/N(3|8|9)/]
|
229
|
+
assert_nil(Feature.fabricpath_enabled?)
|
230
|
+
assert_raises(Cisco::UnsupportedError) { Feature.fabricpath_enable }
|
231
|
+
return
|
232
|
+
end
|
233
|
+
vdc_limit_f3_no_intf_needed(:set)
|
234
|
+
fs = 'feature-set fabricpath'
|
235
|
+
# Get current state of the feature-set
|
236
|
+
feature_set_installed = Feature.fabricpath_installed?
|
237
|
+
|
238
|
+
config("no #{fs} ; no install #{fs}") if feature_set_installed
|
239
|
+
refute_show_match(
|
240
|
+
command: "show running | i '^install #{fs}$'",
|
241
|
+
pattern: /^install #{fs}$/,
|
242
|
+
msg: "(#{fs}) is still configured",
|
243
|
+
)
|
244
|
+
|
245
|
+
Feature.fabricpath_enable
|
246
|
+
assert(Feature.fabricpath_enabled?, "(#{fs}) is not enabled")
|
247
|
+
end
|
248
|
+
|
223
249
|
def test_feature_set_fex
|
224
250
|
if validate_property_excluded?('feature', 'fex')
|
225
251
|
assert_nil(Feature.fex_enabled?)
|
data/tests/test_interface.rb
CHANGED
@@ -346,6 +346,8 @@ class TestInterface < CiscoTestCase
|
|
346
346
|
# Validate the collection
|
347
347
|
inttype_h.each_value do |v|
|
348
348
|
interface = v[:interface]
|
349
|
+
next if interface.name[/vlan|loopback/]
|
350
|
+
interface.switchport_mode = :access
|
349
351
|
|
350
352
|
assert_equal(v[:access_vlan], interface.access_vlan,
|
351
353
|
'Error: Access vlan value not correct')
|
@@ -353,6 +355,7 @@ class TestInterface < CiscoTestCase
|
|
353
355
|
# get_default check
|
354
356
|
assert_equal(v[:default_access_vlan], interface.default_access_vlan,
|
355
357
|
'Error: Access vlan, default, value not correct')
|
358
|
+
interface.switchport_mode = :disabled
|
356
359
|
end
|
357
360
|
end
|
358
361
|
|
@@ -856,8 +859,7 @@ class TestInterface < CiscoTestCase
|
|
856
859
|
config("interface #{int}")
|
857
860
|
interface = Interface.new(int)
|
858
861
|
|
859
|
-
|
860
|
-
"Error: #{int} negotiate auto value mismatch")
|
862
|
+
assert_nil(interface.negotiate_auto)
|
861
863
|
|
862
864
|
assert_raises(Cisco::UnsupportedError) do
|
863
865
|
interface.negotiate_auto = true
|
@@ -1328,8 +1330,6 @@ class TestInterface < CiscoTestCase
|
|
1328
1330
|
default_shutdown: true,
|
1329
1331
|
switchport: :disabled,
|
1330
1332
|
default_switchport: :disabled,
|
1331
|
-
access_vlan: DEFAULT_IF_ACCESS_VLAN,
|
1332
|
-
default_access_vlan: DEFAULT_IF_ACCESS_VLAN,
|
1333
1333
|
vrf_new: 'test2',
|
1334
1334
|
default_vrf: DEFAULT_IF_VRF,
|
1335
1335
|
}
|
@@ -1362,8 +1362,6 @@ class TestInterface < CiscoTestCase
|
|
1362
1362
|
default_shutdown: false,
|
1363
1363
|
switchport: platform == :ios_xr ? nil : :disabled,
|
1364
1364
|
default_switchport: platform == :ios_xr ? nil : :disabled,
|
1365
|
-
access_vlan: DEFAULT_IF_ACCESS_VLAN,
|
1366
|
-
default_access_vlan: DEFAULT_IF_ACCESS_VLAN,
|
1367
1365
|
vrf_new: 'test2',
|
1368
1366
|
default_vrf: DEFAULT_IF_VRF,
|
1369
1367
|
}
|
@@ -1411,12 +1409,12 @@ class TestInterface < CiscoTestCase
|
|
1411
1409
|
validate_interfaces_not_empty
|
1412
1410
|
validate_get_switchport(inttype_h)
|
1413
1411
|
validate_description(inttype_h)
|
1414
|
-
validate_get_access_vlan(inttype_h) unless platform == :ios_xr
|
1415
1412
|
validate_ipv4_address(inttype_h)
|
1416
1413
|
validate_ipv4_proxy_arp(inttype_h)
|
1417
1414
|
validate_ipv4_redirects(inttype_h)
|
1418
1415
|
validate_interface_shutdown(inttype_h)
|
1419
1416
|
validate_vrf(inttype_h)
|
1417
|
+
validate_get_access_vlan(inttype_h) unless platform == :ios_xr
|
1420
1418
|
config(*cfg)
|
1421
1419
|
interface_ethernet_default(interfaces[1])
|
1422
1420
|
rescue Minitest::Assertion
|
@@ -597,7 +597,11 @@ class TestInterfaceOspf < CiscoTestCase
|
|
597
597
|
msg: "Error: ip router ospf #{name} area #{hv[:area]} "\
|
598
598
|
"not found under #{ifname}")
|
599
599
|
|
600
|
-
|
600
|
+
if hv[:bfd].nil?
|
601
|
+
assert_nil(interface.bfd, 'Error: get bfd is not nil')
|
602
|
+
else
|
603
|
+
assert_equal(hv[:bfd], interface.bfd, 'Error: get bfd failed')
|
604
|
+
end
|
601
605
|
assert_equal(hv[:cost], interface.cost, 'Error: get cost failed')
|
602
606
|
assert_equal(hv[:hello], interface.hello_interval,
|
603
607
|
'Error: get hello interval failed')
|
@@ -88,6 +88,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
88
88
|
return
|
89
89
|
end
|
90
90
|
|
91
|
+
i.switchport_mode = :access
|
91
92
|
assert_equal(i.default_switchport_pvlan_host,
|
92
93
|
i.switchport_pvlan_host)
|
93
94
|
|
@@ -96,6 +97,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
96
97
|
|
97
98
|
i.switchport_pvlan_host = false
|
98
99
|
refute(i.switchport_pvlan_host)
|
100
|
+
i.switchport_mode = :disabled
|
99
101
|
end
|
100
102
|
|
101
103
|
def test_sw_pvlan_promiscuous
|
@@ -107,6 +109,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
107
109
|
return
|
108
110
|
end
|
109
111
|
|
112
|
+
i.switchport_mode = :access
|
110
113
|
assert_equal(i.default_switchport_pvlan_promiscuous,
|
111
114
|
i.switchport_pvlan_promiscuous)
|
112
115
|
|
@@ -115,6 +118,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
115
118
|
|
116
119
|
i.switchport_pvlan_promiscuous = false
|
117
120
|
refute(i.switchport_pvlan_promiscuous)
|
121
|
+
i.switchport_mode = :disabled
|
118
122
|
end
|
119
123
|
|
120
124
|
def test_sw_pvlan_trunk_promiscuous
|
@@ -126,6 +130,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
126
130
|
return
|
127
131
|
end
|
128
132
|
|
133
|
+
i.switchport_mode = :access
|
129
134
|
assert_equal(i.default_switchport_pvlan_trunk_promiscuous,
|
130
135
|
i.switchport_pvlan_trunk_promiscuous)
|
131
136
|
|
@@ -134,6 +139,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
134
139
|
|
135
140
|
i.switchport_pvlan_trunk_promiscuous = false
|
136
141
|
refute(i.switchport_pvlan_trunk_promiscuous)
|
142
|
+
i.switchport_mode = :disabled
|
137
143
|
end
|
138
144
|
|
139
145
|
def test_sw_pvlan_trunk_secondary
|
@@ -145,6 +151,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
145
151
|
return
|
146
152
|
end
|
147
153
|
|
154
|
+
i.switchport_mode = :access
|
148
155
|
assert_equal(i.default_switchport_pvlan_trunk_secondary,
|
149
156
|
i.switchport_pvlan_trunk_secondary)
|
150
157
|
|
@@ -153,6 +160,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
153
160
|
|
154
161
|
i.switchport_pvlan_trunk_secondary = false
|
155
162
|
refute(i.switchport_pvlan_trunk_secondary)
|
163
|
+
i.switchport_mode = :disabled
|
156
164
|
end
|
157
165
|
|
158
166
|
# Helper to setup vlan associations
|
@@ -188,6 +196,9 @@ class TestInterfacePVlan < CiscoTestCase
|
|
188
196
|
end
|
189
197
|
|
190
198
|
def test_sw_pvlan_trunk_association
|
199
|
+
# N6k trunk association does not update primary-secondary associations automatically
|
200
|
+
skip('Test behavior not supported on device') if node.product_id[/N(5|6)/]
|
201
|
+
|
191
202
|
# Supports multiple instances of [[pri, sec], [pri2, sec2]]
|
192
203
|
if validate_property_excluded?('interface',
|
193
204
|
'switchport_pvlan_trunk_association')
|
@@ -246,6 +257,9 @@ class TestInterfacePVlan < CiscoTestCase
|
|
246
257
|
end
|
247
258
|
|
248
259
|
def test_sw_pvlan_mapping_trunk
|
260
|
+
# N6k mapping trunk does not update primary-secondary associations automatically
|
261
|
+
skip('Test behavior not supported on device') if node.product_id[/N(5|6)/]
|
262
|
+
|
249
263
|
if validate_property_excluded?('interface',
|
250
264
|
'switchport_pvlan_mapping_trunk')
|
251
265
|
assert_raises(Cisco::UnsupportedError) do
|
@@ -261,7 +275,6 @@ class TestInterfacePVlan < CiscoTestCase
|
|
261
275
|
assert_equal([['2', '4-8,10-11']], i.switchport_pvlan_mapping_trunk)
|
262
276
|
|
263
277
|
# Same primary, but change range
|
264
|
-
|
265
278
|
i.switchport_pvlan_mapping_trunk = ['2', '11,4-6,8']
|
266
279
|
assert_equal([['2', '4-6,8,11']], i.switchport_pvlan_mapping_trunk)
|
267
280
|
|
@@ -309,6 +322,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
309
322
|
return
|
310
323
|
end
|
311
324
|
|
325
|
+
i.switchport_mode = :access
|
312
326
|
default = i.default_switchport_pvlan_trunk_allowed_vlan
|
313
327
|
assert_equal(default, i.switchport_pvlan_trunk_allowed_vlan)
|
314
328
|
|
@@ -325,6 +339,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
325
339
|
vlans = '500-528,530,532,534,587,590-593,597-598,600,602,604'
|
326
340
|
i.switchport_pvlan_trunk_allowed_vlan = vlans
|
327
341
|
assert_equal(vlans, i.switchport_pvlan_trunk_allowed_vlan)
|
342
|
+
i.switchport_mode = :disabled
|
328
343
|
end
|
329
344
|
|
330
345
|
def test_sw_pvlan_trunk_native_vlan
|
@@ -336,6 +351,7 @@ class TestInterfacePVlan < CiscoTestCase
|
|
336
351
|
return
|
337
352
|
end
|
338
353
|
|
354
|
+
i.switchport_mode = :access
|
339
355
|
default = i.default_switchport_pvlan_trunk_native_vlan
|
340
356
|
assert_equal(default, i.switchport_pvlan_trunk_native_vlan)
|
341
357
|
|
@@ -344,5 +360,6 @@ class TestInterfacePVlan < CiscoTestCase
|
|
344
360
|
|
345
361
|
i.switchport_pvlan_trunk_native_vlan = default
|
346
362
|
assert_equal(default, i.switchport_pvlan_trunk_native_vlan)
|
363
|
+
i.switchport_mode = :disabled
|
347
364
|
end
|
348
365
|
end
|
data/tests/test_interface_svi.rb
CHANGED
@@ -195,7 +195,7 @@ class TestSvi < CiscoTestCase
|
|
195
195
|
|
196
196
|
def test_sys_def_svi_autostate
|
197
197
|
skip_autostate_test?
|
198
|
-
skip_legacy_defect?('8.0.1|8.1.1', 'CSC: Behavior change after helsinki')
|
198
|
+
skip_legacy_defect?('8.0.1|8.1.1|8\.3', 'CSC: Behavior change after helsinki')
|
199
199
|
interface = Interface.new(interfaces[0])
|
200
200
|
|
201
201
|
system_default_svi_autostate('no ')
|
@@ -80,11 +80,7 @@ class TestSwitchport < TestInterfaceSwitchport
|
|
80
80
|
|
81
81
|
def test_access_vlan_sw_disabled
|
82
82
|
interface.switchport_mode = :disabled
|
83
|
-
|
84
|
-
assert_nil(interface.access_vlan)
|
85
|
-
else
|
86
|
-
assert_equal(DEFAULT_IF_ACCESS_VLAN, interface.access_vlan)
|
87
|
-
end
|
83
|
+
assert_nil(interface.access_vlan)
|
88
84
|
end
|
89
85
|
|
90
86
|
def test_access_vlan_sw_trunk
|
@@ -414,12 +410,13 @@ class TestInterfaceSwVtp < TestInterfaceSwitchport
|
|
414
410
|
|
415
411
|
def setup
|
416
412
|
super
|
417
|
-
skip('VTP is not supported on IOS XR') if
|
413
|
+
skip('VTP is not supported on IOS XR or fretta') if
|
414
|
+
platform == :ios_xr || product_tag[/n(3|9)k-f/]
|
418
415
|
@vtp = Vtp.new(true)
|
419
416
|
end
|
420
417
|
|
421
418
|
def teardown
|
422
|
-
vtp.destroy unless platform == :ios_xr
|
419
|
+
vtp.destroy unless platform == :ios_xr || product_tag[/n(3|9)k-f/]
|
423
420
|
super
|
424
421
|
end
|
425
422
|
|
data/tests/test_node_ext.rb
CHANGED
@@ -142,7 +142,7 @@ class TestNodeExt < CiscoTestCase
|
|
142
142
|
|
143
143
|
def test_get_product_id
|
144
144
|
# N3|9K Fretta product_id gets a '-F' appended so remove it for this check
|
145
|
-
if
|
145
|
+
if product_tag[/n(3|9)k-f/]
|
146
146
|
chassis = node.product_id.sub('-F', '')
|
147
147
|
else
|
148
148
|
chassis = node.product_id
|
data/tests/test_nxapi.rb
CHANGED
@@ -14,11 +14,11 @@
|
|
14
14
|
# See the License for the specific language governing permissions and
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
|
-
require_relative '
|
17
|
+
require_relative 'ciscotest'
|
18
18
|
require_relative '../lib/cisco_node_utils/node'
|
19
19
|
|
20
20
|
# TestNxapi - NXAPI client unit tests
|
21
|
-
class TestNxapi <
|
21
|
+
class TestNxapi < CiscoTestCase
|
22
22
|
@@client = nil # rubocop:disable Style/ClassVars
|
23
23
|
|
24
24
|
def self.runnable_methods
|
@@ -161,7 +161,7 @@ class TestNxapi < TestCase
|
|
161
161
|
cmd = { command: 'show snmp internal globals',
|
162
162
|
data_format: :nxapi_structured }
|
163
163
|
if @product_id[/N(5|6)/]
|
164
|
-
assert_empty(client.get(cmd))
|
164
|
+
assert_empty(client.get(cmd).to_s)
|
165
165
|
else
|
166
166
|
assert_raises(Cisco::RequestNotSupported) { client.get(cmd) }
|
167
167
|
end
|
@@ -207,12 +207,22 @@ class TestNxapi < TestCase
|
|
207
207
|
|
208
208
|
def test_unsupported
|
209
209
|
# Add a method to the NXAPI that sends a request of invalid type
|
210
|
-
|
211
|
-
|
212
|
-
|
210
|
+
if !product_tag[/n(3|9)k-f/]
|
211
|
+
def client.hello
|
212
|
+
req('hello', 'world')
|
213
|
+
end
|
214
|
+
|
215
|
+
assert_raises Cisco::RequestNotSupported do
|
216
|
+
client.hello
|
217
|
+
end
|
218
|
+
else
|
219
|
+
def client.hello
|
220
|
+
req('hello', 'world')
|
221
|
+
end
|
213
222
|
|
214
|
-
|
215
|
-
|
223
|
+
assert_raises Cisco::ClientError do
|
224
|
+
client.hello
|
225
|
+
end
|
216
226
|
end
|
217
227
|
end
|
218
228
|
|
data/tests/test_radius_global.rb
CHANGED
@@ -66,8 +66,8 @@ class TestRadiusGlobal < CiscoTestCase
|
|
66
66
|
2)
|
67
67
|
|
68
68
|
if platform == :nexus
|
69
|
-
key = '44444444'
|
70
|
-
global.key_set(key,
|
69
|
+
key = 'aaaAAAGGTTYTYY 44444444 72'
|
70
|
+
global.key_set(key, 7)
|
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)
|
@@ -93,6 +93,7 @@ class TestRadiusGlobal < CiscoTestCase
|
|
93
93
|
assert_nil(global.key)
|
94
94
|
|
95
95
|
# Default source interface
|
96
|
+
global.source_interface = global.default_source_interface
|
96
97
|
assert_nil(global.source_interface)
|
97
98
|
|
98
99
|
# Set source interface
|