From b2d5f397d419637d86613c7d2178c4e0cb0aad4c Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Mon, 4 Feb 2019 15:56:12 -0500 Subject: [PATCH 1/7] New def values for n6k banner yaml --- lib/cisco_node_utils/cmd_ref/banner.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cisco_node_utils/cmd_ref/banner.yaml b/lib/cisco_node_utils/cmd_ref/banner.yaml index 149b0b11..45591298 100644 --- a/lib/cisco_node_utils/cmd_ref/banner.yaml +++ b/lib/cisco_node_utils/cmd_ref/banner.yaml @@ -1,7 +1,11 @@ # banner --- motd: - default_value: "User Access Verification\n" + N5k: &N6000 + default_value: "Nexus 6000 Switch\n" + N6k: *N6000 + else: + default_value: "User Access Verification\n" get_command: 'show banner motd' get_value: '/^.*$/m' set_value: ' banner motd ' From e5c93e09e562409256f0aee7cf6f2b2743a85621 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Tue, 5 Feb 2019 09:41:15 -0500 Subject: [PATCH 2/7] test_vlan: check for existing mapped_vni before deleting --- lib/cisco_node_utils/vlan.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cisco_node_utils/vlan.rb b/lib/cisco_node_utils/vlan.rb index d00d73fc..deb860a6 100644 --- a/lib/cisco_node_utils/vlan.rb +++ b/lib/cisco_node_utils/vlan.rb @@ -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, From 800a2eb3342230e6cb86d3f670f09212b7ed8f00 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Tue, 5 Feb 2019 10:32:02 -0500 Subject: [PATCH 3/7] test_vtp: n6k doesn't handle slashes well --- tests/test_vtp.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_vtp.rb b/tests/test_vtp.rb index 84dd4f61..6c92de16 100755 --- a/tests/test_vtp.rb +++ b/tests/test_vtp.rb @@ -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 From 2677d208dbbe040d547d85849038b5e9d51d8eb5 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Tue, 5 Feb 2019 13:29:09 -0500 Subject: [PATCH 4/7] test_feature: n6k fix for vni --- tests/test_feature.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_feature.rb b/tests/test_feature.rb index 14026b94..07c141ba 100755 --- a/tests/test_feature.rb +++ b/tests/test_feature.rb @@ -178,14 +178,14 @@ 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) end - feature('vni') + Feature.vni_enable rescue RuntimeError => e hardware_supports_feature?(e.message) end From 08523231828b10a1faf22ce98d37307adff76e6c Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Tue, 5 Feb 2019 13:52:19 -0500 Subject: [PATCH 5/7] restore the feature('vni') call in test_feature.rb --- tests/test_feature.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_feature.rb b/tests/test_feature.rb index 07c141ba..90e77500 100755 --- a/tests/test_feature.rb +++ b/tests/test_feature.rb @@ -185,7 +185,7 @@ def test_vni config_no_warn('no feature nv overlay') vdc_limit_f3_no_intf_needed(:set) end - Feature.vni_enable + feature('vni') rescue RuntimeError => e hardware_supports_feature?(e.message) end From 84acb1558fcbb618c4e9c29d7f4cf1ab51d7059d Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Tue, 5 Feb 2019 14:13:12 -0500 Subject: [PATCH 6/7] n6k show inventory versionid (yaml) fix --- lib/cisco_node_utils/cmd_ref/inventory.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cisco_node_utils/cmd_ref/inventory.yaml b/lib/cisco_node_utils/cmd_ref/inventory.yaml index d7a5905c..f4589e83 100644 --- a/lib/cisco_node_utils/cmd_ref/inventory.yaml +++ b/lib/cisco_node_utils/cmd_ref/inventory.yaml @@ -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 From a6b31a1fb504f740d0e7696e9b532da35445d582 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Tue, 5 Feb 2019 14:22:55 -0500 Subject: [PATCH 7/7] test_nxapi: n6k: fix test_get_nxapi_structured_unsupported --- tests/test_nxapi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_nxapi.rb b/tests/test_nxapi.rb index 17c2c2e1..e36b2980 100644 --- a/tests/test_nxapi.rb +++ b/tests/test_nxapi.rb @@ -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