Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/cmd_ref/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ versionid:
nexus:
get_value: ["name \"Chassis\"", "vendorid"]
N5k: &vendorid5k
get_value: ["name Chassis", "serialnum"]
get_value: ["name Chassis", "vendorid"]
N6k: *vendorid5k
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/vlan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def mapped_vni=(vni)
Feature.vn_segment_vlan_based_enable
# Remove the existing mapping first as cli doesn't support overwriting.
config_set('vlan', 'mapped_vni', vlan: @vlan_id,
state: 'no', vni: vni)
state: 'no', vni: vni) unless mapped_vni.to_s.empty?
# Configure the new mapping
state = vni == default_mapped_vni ? 'no' : ''
config_set('vlan', 'mapped_vni', vlan: @vlan_id,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def test_vn_segment_vlan_based
end

def test_vni
if node.product_id[/N(5|6)/]
Feature.nv_overlay_enable
else
# 7k: 'feature vni'; All others: 'feature vn-segment-vlan-based'.
# Dependencies: 5/6k: feature-set fabricpath; 3/9k: feature nv overlay
if node.product_id[/N7/]
# vni can't be removed if nv overlay is present
config_no_warn('no feature nv overlay')
vdc_limit_f3_no_intf_needed(:set)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nxapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_get_nxapi_structured_unsupported
cmd = { command: 'show snmp internal globals',
data_format: :nxapi_structured }
if @product_id[/N(5|6)/]
assert_empty(client.get(cmd))
assert_empty(client.get(cmd).to_s)
else
assert_raises(Cisco::RequestNotSupported) { client.get(cmd) }
end
Expand Down
6 changes: 4 additions & 2 deletions tests/test_vtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ def test_password_valid
def test_password_special_characters
skip_legacy_defect?('7.3.[012].(N1|D1)',
'CSCuy87970: NXAPI incorrect backslash escape')
# N6k output may triple-escape forward slashes. For now simplify pattern.
test_pass = node.product_id[/N[56]/] ? 'hello!//#%$x' : 'hello!//\\#%$x'
vtp = vtp_domain('password')
vtp.password = 'hello!//\\#%$x'
assert_equal('hello!//\\#%$x', vtp.password)
vtp.password = test_pass
assert_equal(test_pass, vtp.password)
end

def test_filename_valid
Expand Down