From ae2df16eac940eb1dfda662970a592fe1ef1e8de Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Wed, 23 Dec 2015 09:47:05 -0500 Subject: [PATCH 1/6] platform exludes for yaml --- lib/cisco_node_utils/cmd_ref/README_YAML.md | 12 +++--- lib/cisco_node_utils/cmd_ref/bgp.yaml | 4 +- .../cmd_ref/bgp_neighbor.yaml | 2 +- lib/cisco_node_utils/cmd_ref/interface.yaml | 10 ++--- .../cmd_ref/interface_service.yaml | 4 +- lib/cisco_node_utils/cmd_ref/inventory.yaml | 2 +- .../cmd_ref/show_version.yaml | 4 +- lib/cisco_node_utils/cmd_ref/vdc.yaml | 9 ++++ lib/cisco_node_utils/cmd_ref/vlan.yaml | 3 +- lib/cisco_node_utils/cmd_ref/vni.yaml | 20 ++++++++- lib/cisco_node_utils/cmd_ref/vrf.yaml | 41 ++++++++----------- lib/cisco_node_utils/cmd_ref/vtp.yaml | 2 +- lib/cisco_node_utils/cmd_ref/vxlan.yaml | 3 +- lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml | 25 +++++++++-- 14 files changed, 88 insertions(+), 53 deletions(-) diff --git a/lib/cisco_node_utils/cmd_ref/README_YAML.md b/lib/cisco_node_utils/cmd_ref/README_YAML.md index 1b2b8ff7..f67578c1 100644 --- a/lib/cisco_node_utils/cmd_ref/README_YAML.md +++ b/lib/cisco_node_utils/cmd_ref/README_YAML.md @@ -206,7 +206,7 @@ for all products that do not match any of the given regexps: ```yaml # show_version.yaml system_image: - /N9K/: + /N9/: config_get_token: "kick_file_name" test_config_get_regex: '/.*NXOS image file is: (.*)$.*/' else: @@ -221,7 +221,7 @@ Related to product variants, an `_exclude` entry can be used to mark an entire f ```yaml # fabricpath.yaml --- -_exclude: [/N3K/, /N9K/] +_exclude: [/N3/, /N9/] _template: ... @@ -232,7 +232,7 @@ Individual feature attributes can also be excluded in this way: ```yaml attribute: _exclude: - - /N7K/ + - /N7/ default_value: true config_get: 'show attribute' config_set: 'attribute' @@ -271,7 +271,7 @@ Using platform variants and product variants together: description: config_get_token: "chassis_id" cli_nexus: - /N7K/: + /N7/: test_config_get_regex: '/.*Hardware\n cisco (\w+ \w+ \(\w+ \w+\) \w+).*/' else: test_config_get_regex: '/Hardware\n cisco (([^(\n]+|\(\d+ Slot\))+\w+)/' @@ -480,7 +480,7 @@ Some attributes may be hard-coded in such a way that they have a meaningful defa negotiate_auto_ethernet: kind: boolean cli_nexus: - /(N7K|C3064)/: + /(N7|C3064)/: # this feature is always off on these platforms and cannot be changed default_only: false else: @@ -571,7 +571,7 @@ Should only be referenced by test scripts, never by a feature provider itself. ```yaml # vtp.yaml version: - /N7K/: + /N7/: test_config_result: 3: 3 else: diff --git a/lib/cisco_node_utils/cmd_ref/bgp.yaml b/lib/cisco_node_utils/cmd_ref/bgp.yaml index cc22df4a..800693dc 100644 --- a/lib/cisco_node_utils/cmd_ref/bgp.yaml +++ b/lib/cisco_node_utils/cmd_ref/bgp.yaml @@ -139,14 +139,14 @@ maxas_limit: default_value: false neighbor_down_fib_accelerate: - _exclude: [/N6K/, /N7K/] + _exclude: [/N6/, /N7/] kind: boolean config_get_token_append: '/^neighbor-down fib-accelerate$/' config_set_append: ' neighbor-down fib-accelerate' default_value: false reconnect_interval: - _exclude: [/N6K/, /N7K/] + _exclude: [/N6/, /N7/] kind: int config_get_token_append: '/^reconnect-interval (\d+)$/' config_set_append: ' reconnect-interval ' diff --git a/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml b/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml index 5babe5b7..d53397b1 100644 --- a/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +++ b/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml @@ -56,7 +56,7 @@ local_as: default_value: 0 log_neighbor_changes: - _exclude: [/N6K/, /N7K/] + _exclude: [/N(6|7)/] multiple: true # not actually, but we get an array of matches auto_default: false config_get_token_append: '/^log-neighbor-changes\s+??(\S+)?\s+??$/' diff --git a/lib/cisco_node_utils/cmd_ref/interface.yaml b/lib/cisco_node_utils/cmd_ref/interface.yaml index 13bbfe42..6ac6aca4 100644 --- a/lib/cisco_node_utils/cmd_ref/interface.yaml +++ b/lib/cisco_node_utils/cmd_ref/interface.yaml @@ -15,7 +15,7 @@ access_vlan: admin_state_ethernet_noswitchport_shutdown: # TODO: is this actually used? cli_nexus: - /N7K/: + /N7/: default_value: "shutdown" all_interfaces: @@ -124,7 +124,7 @@ negotiate_auto_ethernet: '/^\s+no negotiate auto/', '/^\s+negotiate auto/' ] - /(N7K|C3064)/: + /(N7|C3064)/: default_only: false else: config_get_token_append: '/^(no )?negotiate auto$/' @@ -142,7 +142,7 @@ negotiate_auto_portchannel: '/^\s+no negotiate auto/', '/^\s+negotiate auto/' ] - /N7K/: + /N7/: default_only: false else: config_get_token_append: '/^(no )?negotiate auto$/' @@ -259,14 +259,14 @@ system_default_switchport_shutdown: # default_value: n/a. This is a user-configurable system default. vlan_mapping: - _exclude: [/N(3|5|6|9)K/] + _exclude: [/N(3|5|6|9)/] multiple: config_get_token_append: '/^switchport vlan mapping (\d+) (\d+)/' config_set_append: '%s switchport vlan mapping %s %s' default_value: [] vlan_mapping_enable: - _exclude: [/N(3|5|6|9)K/] + _exclude: [/N(3|5|6|9)/] kind: boolean config_get_token_append: '/^(no )?switchport vlan mapping enable/' config_set_append: '%s switchport vlan mapping enable' diff --git a/lib/cisco_node_utils/cmd_ref/interface_service.yaml b/lib/cisco_node_utils/cmd_ref/interface_service.yaml index 9eab32df..e965d7ff 100644 --- a/lib/cisco_node_utils/cmd_ref/interface_service.yaml +++ b/lib/cisco_node_utils/cmd_ref/interface_service.yaml @@ -1,7 +1,7 @@ # interface_service --- _template: - _exclude: [/N3/, /N5K/, /N6K/, /N9K/] + _exclude: [/N(3|5|6|9)/] config_get: 'show running interface all' config_get_token: '/^interface $/i' config_get_token_append: @@ -23,7 +23,7 @@ encapsulation_profile_vni: default_value: '' shutdown: - /N7K/: + /N7/: kind: boolean config_get_token_append: '/^(?:no )?shutdown$/' config_set_append: " shutdown" diff --git a/lib/cisco_node_utils/cmd_ref/inventory.yaml b/lib/cisco_node_utils/cmd_ref/inventory.yaml index 37639332..9ba7156c 100644 --- a/lib/cisco_node_utils/cmd_ref/inventory.yaml +++ b/lib/cisco_node_utils/cmd_ref/inventory.yaml @@ -16,7 +16,7 @@ chassis: inventory: # TODO: clean this up - /N7K/: + /N7/: test_config_get_regex: [ '/.*\nNAME: "(.+)",\s+DESCR: "(.+)"\s+\nPID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/', '/.*NAME: "(.+)",\s+DESCR: "(.+)"\s+PID: (\S+)\s+,\s+VID: (.+) ,\s+SN: (.+)\s+\n/' diff --git a/lib/cisco_node_utils/cmd_ref/show_version.yaml b/lib/cisco_node_utils/cmd_ref/show_version.yaml index 2e6e90da..4c2792a2 100644 --- a/lib/cisco_node_utils/cmd_ref/show_version.yaml +++ b/lib/cisco_node_utils/cmd_ref/show_version.yaml @@ -18,7 +18,7 @@ cpu: description: config_get_token: "chassis_id" cli_nexus: - /N7K/: + /N7/: test_config_get_regex: '/.*Hardware\n cisco (\w+ \w+ \(\w+ \w+\) \w+).*/' else: # Hardware @@ -53,7 +53,7 @@ last_reset_time: system_image: cli_nexus: - /N7K/: + /N7/: config_get_token: "isan_file_name" test_config_get_regex: '/.*system image file is: (.*)$.*/' else: diff --git a/lib/cisco_node_utils/cmd_ref/vdc.yaml b/lib/cisco_node_utils/cmd_ref/vdc.yaml index 8494dfc5..5e0c7519 100644 --- a/lib/cisco_node_utils/cmd_ref/vdc.yaml +++ b/lib/cisco_node_utils/cmd_ref/vdc.yaml @@ -28,3 +28,12 @@ limit_resource_module_type: # check is meaningless and idempotence is not possible for 'default'. config_get_token_append: '/^limit-resource module-type (.*)/' config_set_append: ' limit-resource module-type ' + +vdc_support: + # This is a only used for determining support for VDCs + kind: boolean + /N7/: + default_only: true + else: + # this feature is always off on these platforms and cannot be changed + default_only: false diff --git a/lib/cisco_node_utils/cmd_ref/vlan.yaml b/lib/cisco_node_utils/cmd_ref/vlan.yaml index bdd0fb93..3663074e 100644 --- a/lib/cisco_node_utils/cmd_ref/vlan.yaml +++ b/lib/cisco_node_utils/cmd_ref/vlan.yaml @@ -13,8 +13,7 @@ destroy: mode: _exclude: - - /N9K/ - - /N3/ + - /N(3|9)/ kind: string config_get: "show vlan" config_get_token: '/^%d+\s+enet\s+(\S+)\s/' diff --git a/lib/cisco_node_utils/cmd_ref/vni.yaml b/lib/cisco_node_utils/cmd_ref/vni.yaml index 88218a4b..83c13067 100644 --- a/lib/cisco_node_utils/cmd_ref/vni.yaml +++ b/lib/cisco_node_utils/cmd_ref/vni.yaml @@ -1,6 +1,6 @@ # vni --- -_exclude: [/N5K/, /N6K/] +_exclude: [/N(5|6)/] all_vnis: multiple: /N7/: @@ -61,6 +61,24 @@ mapped_vlan: config_set: ['vlan ', ' vn-segment ; end'] default_value: '' +mt_full_support: + # This is only used for determining support for Multi-Tenancy Full + kind: boolean + /N7/: + default_only: true + else: + # this feature is always off on these platforms and cannot be changed + default_only: false + +mt_lite_support: + # This is only used for determining support for Multi-Tenancy Lite + kind: boolean + /N(3|9)/: + default_only: true + else: + # this feature is always off on these platforms and cannot be changed + default_only: false + shutdown: # MT-Full only /N7/: diff --git a/lib/cisco_node_utils/cmd_ref/vrf.yaml b/lib/cisco_node_utils/cmd_ref/vrf.yaml index 45bcc84a..28bb50d7 100644 --- a/lib/cisco_node_utils/cmd_ref/vrf.yaml +++ b/lib/cisco_node_utils/cmd_ref/vrf.yaml @@ -18,23 +18,14 @@ destroy: config_set: "no vrf context " feature_vn_segment_vlan_based: - _exclude: - - [/N7K/] # Support for multi-tenancy full only - kind: boolean - default_value: false - cli_nexus: - config_get: 'show running section feature' - config_get_token: '/^feature vn-segment-vlan-based$/' - config_set: 'feature vn-segment-vlan-based' - -feature_vni: - _exclude: [/N3K/, /N9K/] # Support for multi-tenancy lite only - kind: boolean - default_value: false - cli_nexus: - config_get: 'show running section feature' - config_get_token: '/^feature vni$/' - config_set: 'feature vni' + # MT-lite only + /N(3|9)/: + kind: boolean + default_value: false + cli_nexus: + config_get: 'show running section feature' + config_get_token: '/^feature vn-segment-vlan-based$/' + config_set: 'feature vn-segment-vlan-based' shutdown: kind: boolean @@ -43,13 +34,13 @@ shutdown: config_set: ["vrf context ", " shutdown"] default_value: false -vni: - _exclude: - - [/N3/] # N3: Support Unknown - kind: int - config_get: "show running | section 'vrf context'" - config_get_token: ['/^vrf context $/i', '/^vni (\d+)$/'] - config_set: ["vrf context ", " vni "] - default_value: false +vni: # TBD Should this move to the vni provider as vrf_vni? + # MT-lite only + /N(3|9)/: + kind: int + config_get: "show running | section 'vrf context'" + config_get_token: ['/^vrf context $/i', '/^vni (\d+)$/'] + config_set: ["vrf context ", " vni "] + default_value: false diff --git a/lib/cisco_node_utils/cmd_ref/vtp.yaml b/lib/cisco_node_utils/cmd_ref/vtp.yaml index 4c84aeb0..d54a06aa 100644 --- a/lib/cisco_node_utils/cmd_ref/vtp.yaml +++ b/lib/cisco_node_utils/cmd_ref/vtp.yaml @@ -30,7 +30,7 @@ version: config_get_token: '/VTP\s+version\s+running\s+:\s+(\d+)/' config_set: "vtp version %s" default_value: 1 - /N7K/: + /N7/: test_config_result: 3: 3 else: diff --git a/lib/cisco_node_utils/cmd_ref/vxlan.yaml b/lib/cisco_node_utils/cmd_ref/vxlan.yaml index 3118869b..37a6b35f 100644 --- a/lib/cisco_node_utils/cmd_ref/vxlan.yaml +++ b/lib/cisco_node_utils/cmd_ref/vxlan.yaml @@ -1,9 +1,8 @@ # vxlan --- -_exclude: [/N(3|5|6|9)/] +_exclude: [/N(5|6)/] feature_nv_overlay: - # This is a multi-use feature, thus enable-only kind: boolean config_get: 'show running nv overlay' config_get_token: '/^feature nv overlay$/' diff --git a/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml b/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml index 95e2bcae..3c11285c 100644 --- a/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +++ b/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml @@ -10,9 +10,28 @@ all_interfaces: config_get_token: '/^interface (.*)$/' host_reachability: - config_get_token_append: '/^host-reachability protocol (\S+)/' - config_set_append: ' host-reachability protocol ' - default_value: 'flood' + /N(7|9)/: + config_get_token_append: '/^host-reachability protocol (\S+)/' + config_set_append: ' host-reachability protocol ' + default_value: 'flood' + +mt_full_support: + # This is only used for determining support for Multi-Tenancy Full + kind: boolean + /N(7)/: + default_only: true + else: + # this feature is always off on these platforms and cannot be changed + default_only: false + +mt_lite_support: + # This is only used for determining support for Multi-Tenancy Lite + kind: boolean + /N(3|9)/: + default_only: true + else: + # this feature is always off on these platforms and cannot be changed + default_only: false shutdown: kind: boolean From 21c3b8d799dd843645045ead50a43267b8b42258 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Wed, 23 Dec 2015 12:32:30 -0500 Subject: [PATCH 2/6] api cleanups Most of these changes are cleanups for enabling features and adding checks for feature support. --- lib/cisco_node_utils/cmd_ref/.#vni.yaml | 1 + lib/cisco_node_utils/cmd_ref/vrf.yaml | 2 +- lib/cisco_node_utils/interface.rb | 3 ++- lib/cisco_node_utils/interface_service.rb | 2 +- lib/cisco_node_utils/vdc.rb | 4 ++++ lib/cisco_node_utils/vni.rb | 15 ++++++++----- lib/cisco_node_utils/vrf.rb | 26 +++-------------------- lib/cisco_node_utils/vxlan_vtep.rb | 21 +++++++++++++----- 8 files changed, 38 insertions(+), 36 deletions(-) create mode 120000 lib/cisco_node_utils/cmd_ref/.#vni.yaml diff --git a/lib/cisco_node_utils/cmd_ref/.#vni.yaml b/lib/cisco_node_utils/cmd_ref/.#vni.yaml new file mode 120000 index 00000000..f051cdbc --- /dev/null +++ b/lib/cisco_node_utils/cmd_ref/.#vni.yaml @@ -0,0 +1 @@ +cvanheuv@rtp-ads-504.27057:1449896458 \ No newline at end of file diff --git a/lib/cisco_node_utils/cmd_ref/vrf.yaml b/lib/cisco_node_utils/cmd_ref/vrf.yaml index 28bb50d7..3ea34038 100644 --- a/lib/cisco_node_utils/cmd_ref/vrf.yaml +++ b/lib/cisco_node_utils/cmd_ref/vrf.yaml @@ -36,7 +36,7 @@ shutdown: vni: # TBD Should this move to the vni provider as vrf_vni? # MT-lite only - /N(3|9)/: + /N9/: kind: int config_get: "show running | section 'vrf context'" config_get_token: ['/^vrf context $/i', '/^vni (\d+)$/'] diff --git a/lib/cisco_node_utils/interface.rb b/lib/cisco_node_utils/interface.rb index 6e4a0f9e..03507431 100644 --- a/lib/cisco_node_utils/interface.rb +++ b/lib/cisco_node_utils/interface.rb @@ -18,6 +18,7 @@ require_relative 'node_util' require_relative 'pim' require_relative 'vrf' +require_relative 'vni' # Add some interface-specific constants to the Cisco namespace module Cisco @@ -567,7 +568,7 @@ def vlan_mapping end def vlan_mapping=(should_list) - Vrf.feature_vni_enable unless Vrf.feature_vni_enabled + Vni.feature_vni_enable unless Vni.feature_vni_enabled # Process a hash of vlan_mapping cmds from delta_add_remove(). # The vlan_mapping cli does not allow commands to be updated, they must diff --git a/lib/cisco_node_utils/interface_service.rb b/lib/cisco_node_utils/interface_service.rb index d0cf6cc7..15a2fdf5 100644 --- a/lib/cisco_node_utils/interface_service.rb +++ b/lib/cisco_node_utils/interface_service.rb @@ -86,7 +86,7 @@ def encapsulation_profile_vni end def encapsulation_profile_vni=(profile) - Vrf.feature_vni_enable unless Vrf.feature_vni_enabled + Vni.feature_vni_enable unless Vni.feature_vni_enabled state = profile.empty? ? 'no' : '' current = encapsulation_profile_vni diff --git a/lib/cisco_node_utils/vdc.rb b/lib/cisco_node_utils/vdc.rb index 38462e57..2d548291 100644 --- a/lib/cisco_node_utils/vdc.rb +++ b/lib/cisco_node_utils/vdc.rb @@ -40,6 +40,10 @@ def self.vdcs hash end + def self.vdc_support + config_get('vdc', 'vdc_support') + end + def self.default_vdc_name vdc = config_get('vdc', 'default_vdc_name') fail RuntimeError if vdc.nil? diff --git a/lib/cisco_node_utils/vni.rb b/lib/cisco_node_utils/vni.rb index 92310451..963fa180 100644 --- a/lib/cisco_node_utils/vni.rb +++ b/lib/cisco_node_utils/vni.rb @@ -84,10 +84,17 @@ def self.feature_nv_overlay_enable config_set('vni', 'feature_nv_overlay') end + def self.mt_full_support + config_get('vni', 'mt_full_support') + end + + def self.mt_lite_support + config_get('vni', 'mt_lite_support') + end + def create Vni.feature_vni_enable unless Vni.feature_vni_enabled - config_set('vni', 'create', vni: @vni_id) if - /N7/.match(node.product_id) + config_set('vni', 'create', vni: @vni_id) if Vni.mt_full_support end def destroy @@ -97,8 +104,7 @@ def destroy # keys for the standalone vni config. keys = { vni: @vni_id } - # TBD: Hardcoding a platform check for now. Remove during refactor. - if /N[39]K/.match(node.product_id) + if Vni.mt_lite_support vlan = mapped_vlan return if vlan.nil? keys[:vlan] = vlan @@ -262,7 +268,6 @@ def shutdown end def shutdown=(state) - # TBD: fail UnsupportedError unless /N7/.match(node.product_id) state = (state) ? '' : 'no' result = config_set('vni', 'shutdown', state: state, vni: @vni_id) cli_error_check(result) diff --git a/lib/cisco_node_utils/vrf.rb b/lib/cisco_node_utils/vrf.rb index 30181f61..91b35a9b 100644 --- a/lib/cisco_node_utils/vrf.rb +++ b/lib/cisco_node_utils/vrf.rb @@ -17,6 +17,7 @@ # limitations under the License. require_relative 'node_util' +require_relative 'vni' module Cisco # Vrf - node utility class for VRF configuration management @@ -74,18 +75,6 @@ def shutdown=(val) raise "[vrf #{@name}] '#{e.command}' : #{e.clierror}" end - def self.feature_vni_enabled - config_get('vrf', 'feature_vni') - rescue Cisco::CliError => e - # cmd will syntax reject when feature is not enabled - raise unless e.clierror =~ /Syntax error/ - return false - end - - def self.feature_vni_enable - config_set('vrf', 'feature_vni') - end - def self.feature_vn_segment_vlan_based_enabled config_get('vrf', 'feature_vn_segment_vlan_based') rescue Cisco::CliError => e @@ -98,23 +87,14 @@ def self.feature_vn_segment_vlan_based_enable config_set('vrf', 'feature_vn_segment_vlan_based') end - def enable_vni_features - # config_get_default returns nil if command is unsupported on a platform - unless config_get_default('vrf', 'feature_vni').nil? - Vrf.feature_vni_enable unless Vrf.feature_vni_enabled - end - return if config_get_default('vrf', 'feature_vn_segment_vlan_based').nil? - Vrf.feature_vn_segment_vlan_based_enable unless - Vrf.feature_vn_segment_vlan_based_enabled - end - # Vni (Getter/Setter/Default) def vni config_get('vrf', 'vni', @args) end def vni=(id) - enable_vni_features + Vrf.feature_vn_segment_vlan_based_enable unless + Vrf.feature_vn_segment_vlan_based_enabled no_cmd = (id) ? '' : 'no' id = (id) ? id : vni config_set('vrf', 'vni', vrf: @name, state: no_cmd, id: id) diff --git a/lib/cisco_node_utils/vxlan_vtep.rb b/lib/cisco_node_utils/vxlan_vtep.rb index 61352b4d..d349770a 100644 --- a/lib/cisco_node_utils/vxlan_vtep.rb +++ b/lib/cisco_node_utils/vxlan_vtep.rb @@ -18,6 +18,7 @@ # limitations under the License. require_relative 'node_util' +require_relative 'vrf' module Cisco # node_utils class for vxlan_vtep @@ -54,17 +55,25 @@ def self.feature_nv_overlay_enabled end def self.feature_nv_overlay_enable - # vdc platforms restrict this feature to F3 linecards - vdc_name = config_get('vdc', 'default_vdc_name') - if vdc_name - config_set('vdc', 'limit_resource_module_type_f3', vdc: vdc_name) - end + # Note: vdc platforms restrict this feature to F3 or newer linecards config_set('vxlan', 'feature_nv_overlay') end + def self.mt_full_support + config_get('vxlan_vtep', 'mt_full_support') + end + + def self.mt_lite_support + config_get('vxlan_vtep', 'mt_lite_support') + end + def create VxlanVtep.feature_nv_overlay_enable unless VxlanVtep.feature_nv_overlay_enabled + if VxlanVtep.mt_lite_support + Vrf.feature_vn_segment_vlan_based_enable unless + Vrf.feature_vn_segment_vlan_based_enabled + end # re-use the "interface command ref hooks" config_set('interface', 'create', @name) end @@ -110,6 +119,8 @@ def host_reachability=(val) set_args[:state] = 'no' elsif val.to_s == 'evpn' set_args[:state] = '' + else + return end config_set('vxlan_vtep', 'host_reachability', set_args) end From 003ce1bfa534a76718d724478c987056a468c71d Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Wed, 23 Dec 2015 12:34:19 -0500 Subject: [PATCH 3/6] Test file cleanups for platform support checks These changes allow for testing on N3,N7,N9. There are still several failures on N7 that are unrelated to my changes, such as the inability to do 'no switchport'. Test results from affected tests: --- test_interface.rb N7: 44 runs, 44 assertions, 10 failures, 14 errors, 1 skips (failures unrelated to my changes) N9: 44 runs, 320 assertions, 0 failures, 0 errors, 2 skips N3: 44 runs, 343 assertions, 0 failures, 0 errors, 5 skips --- test_interface_service.rb N7: 4 runs, 23 assertions, 0 failures, 0 errors, 0 skips N39: 4 runs, 0 assertions, 0 failures, 0 errors, 4 skips --- test_interface_svi.rb N7: N39: 19 runs, 46 assertions, 0 failures, 0 errors, 0 skips --- test_interface_switchport.rb N7: 53 runs, 59 assertions, 5 failures, 6 errors, 0 skips (failures unrelated to my changes) N39:53 runs, 97 assertions, 0 failures, 0 errors, 0 skips --- test_platform.rb N7: 14 runs, 16 assertions, 3 failures, 0 errors, 1 skips (failures unrelated to my changes) N39: 14 runs, 19 assertions, 0 failures, 0 errors, 0 skips --- test_vdc.rb N7: 3 runs, 6 assertions, 0 failures, 0 errors, 0 skips N39:3 runs, 0 assertions, 0 failures, 0 errors, 3 skips --- test_vni.rb N7: 3 runs, 7 assertions, 0 failures, 0 errors, 1 skips N39: 3 runs, 8 assertions, 0 failures, 0 errors, 2 skips --- test_vlan.rb N7: 21 runs, 44 assertions, 0 failures, 3 errors, 0 skips (failures unrelated to my changes) N9: 21 runs, 45 assertions, 0 failures, 0 errors, 1 skips N3: 21 runs, 45 assertions, 0 failures, 0 errors, 1 skips --- test_vtp.rb N7: 31 runs, 123 assertions, 2 failures, 0 errors, 0 skips (failures unrelated to my changes) N39: 31 runs, 123 assertions, 0 failures, 0 errors, 0 skips --- test_vrf.rb N7: 8 runs, 17 assertions, 0 failures, 1 errors, 1 skips (failures unrelated to my changes) N9: 8 runs, 21 assertions, 0 failures, 0 errors, 0 skips N3: 8 runs, 19 assertions, 0 failures, 0 errors, 1 skips --- test_vxlan_vtep.rb N7: 7 runs, 54 assertions, 0 failures, 0 errors, 0 skips N9: 7 runs, 22 assertions, 0 failures, 0 errors, 1 skips N3: 7 runs, 19 assertions, 0 failures, 0 errors, 2 skips --- test_router_bgp.rb N7: 62 runs, 227 assertions, 1 failures, 0 errors, 2 skips N9: 62 runs, 235 assertions, 0 failures, 0 errors, 0 skips N3: 62 runs, 231 assertions, 0 failures, 1 errors, 0 skips (failures unrelated to my changes) --- test_bgp_neighbor.rb N7: 22 runs, 206 assertions, 0 failures, 1 errors, 0 skips (failures unrelated to my changes) N39: 22 runs, 220 assertions, 0 failures, 0 errors, 0 skips --- --- tests/test_interface_service.rb | 107 +++++++++++++++----------------- tests/test_vdc.rb | 24 ++++--- tests/test_vlan.rb | 42 ++++++++++--- tests/test_vni.rb | 49 ++++++++++++--- tests/test_vrf.rb | 2 + tests/test_vxlan_vtep.rb | 97 +++++++++++++++++++++-------- 6 files changed, 210 insertions(+), 111 deletions(-) diff --git a/tests/test_interface_service.rb b/tests/test_interface_service.rb index a79a7df2..3d1b00dc 100755 --- a/tests/test_interface_service.rb +++ b/tests/test_interface_service.rb @@ -15,6 +15,7 @@ require_relative 'ciscotest' require_relative '../lib/cisco_node_utils/interface' require_relative '../lib/cisco_node_utils/interface_service' +require_relative '../lib/cisco_node_utils/vdc' include Cisco @@ -32,29 +33,40 @@ # encapsulation profile vni_600_6000 default # class TestInterfaceService < CiscoTestCase - def setup_encapsulation_profile_vni - # This property has several dependencies: - # - VDC support - # - Specific linecard (F3 or newer) - # - Bridge Domain Configuration - # - Feature vni + def setup + super + end - # Check for supported platform - skip("Test not supported on #{node.product_id}") if - cmd_ref.lookup('vdc', 'all_vdcs').config_get_token.nil? + def teardown + # Reset the vdc module type back to default + v = Vdc.new('default') + v.limit_resource_module_type = '' if v.limit_resource_module_type == 'f3' + end - # This test requires specific linecards; as such we will hard-code the - # module location and skip the test if not found. + def compatible_interface? + # MT-full tests require a specific linecard; either because they need a + # compatible interface or simply to enable the features. Either way + # we will provide an appropriate interface name if the linecard is present. # Example 'show mod' output to match against: - # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' - slot = 9 - pat = Regexp.new("^#{slot}\s.*N7K-F3") - skip("Test requires N7K-F3 linecard in slot #{slot}") unless - @device.cmd('sh mod | i N7K-F').match(pat) + # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' + sh_mod = @device.cmd("sh mod | i '^[0-9]+.*N7K-F3'")[/^(\d+)\s.*N7K-F3/] + slot = sh_mod.nil? ? nil : Regexp.last_match[1] + skip('Unable to find compatible interface in chassis') if slot.nil? - require_relative '../lib/cisco_node_utils/vdc' - Cisco::Vdc.new('default').limit_resource_module_type = 'f3' + "ethernet#{slot}/1" + end + + def mt_full_env_setup + skip('Platform does not support MT-full') unless Vni.mt_full_support + intf = compatible_interface? + v = Vdc.new('default') + v.limit_resource_module_type = 'f3' unless + v.limit_resource_module_type == 'f3' + config("default int #{intf}") + intf + end + def global_setup # Reset feature to clean up switch config('no feature vni', 'feature vni') @@ -64,14 +76,19 @@ def setup_encapsulation_profile_vni 'encapsulation profile vni vni_700_7000', 'dot1q 700 vni 7000', 'encapsulation profile vni vni_800_8000', 'dot1q 800 vni 8000') - # Test interface name - intf = 'ethernet9/1' - config("default int #{intf}") - intf + # Configure a bridge-domain + config('system bridge-domain 100-113', 'bridge-domain 100') end def test_create_destroy - intf = setup_encapsulation_profile_vni + # This property has several dependencies: + # - VDC support + # - Specific linecard (F3 or newer) + # - Bridge Domain Configuration + # - Feature vni + + intf = mt_full_env_setup + global_setup # TEST Create / Destroy and svc_vni_ids hash builder i5 = InterfaceService.new(intf, 5) @@ -86,7 +103,8 @@ def test_create_destroy end def test_shutdown - intf = setup_encapsulation_profile_vni + intf = mt_full_env_setup + global_setup i5 = InterfaceService.new(intf, 5) # Test shutdown @@ -101,7 +119,8 @@ def test_shutdown end def test_encapsulation_profile_vni - intf = setup_encapsulation_profile_vni + intf = mt_full_env_setup + global_setup i5 = InterfaceService.new(intf, 5) @@ -127,44 +146,18 @@ def test_encapsulation_profile_vni # interface vlan_mapping is not technically part of the interface service # but it shares most of the same dependencies so it is tested here instead # of test_interface.rb - def setup_vlan_mapping + def test_vlan_mapping + # This test covers two properties: + # vlan_mapping & vlan_mapping_enabled + # # This property has several dependencies: # - VDC support # - Specific linecard (F3) # - Bridge Domain Configuration # - Feature vni + intf = mt_full_env_setup + global_setup - # Check for supported platform - skip("Test not supported on #{node.product_id}") if - cmd_ref.lookup('vdc', 'all_vdcs').config_get_token.nil? - - # This test requires a specific linecard; as such we will hard-code the - # module location and skip the test if not found. - # Example 'show mod' output to match against: - # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' - slot = 9 - pat = Regexp.new("^#{slot}\s.*N7K-F3") - skip("Test requires N7K-F3 linecard in slot #{slot}") unless - @device.cmd('sh mod | i N7K-F').match(pat) - - require_relative '../lib/cisco_node_utils/vdc' - Cisco::Vdc.new('default').limit_resource_module_type = 'f3' - - # Configure a bridge-domain - config('system bridge-domain 100-113', 'bridge-domain 100') - - # Reset feature to clean up switch - config('no feature vni') - - # Test interface name - 'Ethernet9/1' - end - - def test_vlan_mapping - # This test covers two properties: - # vlan_mapping & vlan_mapping_enabled - - intf = setup_vlan_mapping i = Interface.new(intf) i.switchport_mode = :trunk i.vlan_mapping = [] diff --git a/tests/test_vdc.rb b/tests/test_vdc.rb index 6d4eea75..797fc4e1 100755 --- a/tests/test_vdc.rb +++ b/tests/test_vdc.rb @@ -27,8 +27,7 @@ class TestVdc < CiscoTestCase def setup super # Check for supported platform - skip("Test not supported on #{node.product_id}") if - cmd_ref.lookup('vdc', 'all_vdcs').config_get_token.nil? + skip('Platform does not support VDCs') unless Vdc.vdc_support end def test_all_vdcs @@ -46,16 +45,21 @@ def test_create end end - def test_limit_resource_module_type - # This test requires a specific linecard; as such we will hard-code the - # module location and skip the test if not found. + def compatible_interface? + # MT-full tests require a specific linecard; either because they need a + # compatible interface or simply to enable the features. Either way + # we will provide an appropriate interface name if the linecard is present. # Example 'show mod' output to match against: - # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' - slot = 9 - pat = Regexp.new("^#{slot}\s.*N7K-F3") - skip("Test requires N7K-F3 linecard in slot #{slot}") unless - @device.cmd('sh mod | i N7K-F').match(pat) + # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' + sh_mod = @device.cmd("sh mod | i '^[0-9]+.*N7K-F3'")[/^(\d+)\s.*N7K-F3/] + slot = sh_mod.nil? ? nil : Regexp.last_match[1] + skip('Unable to find compatible interface in chassis') if slot.nil? + + "ethernet#{slot}/1" + end + def test_limit_resource_module_type + compatible_interface? v = Vdc.new('default') # Set limit-resource module-type to default (this is variable for each # device, so the default is for this device only) diff --git a/tests/test_vlan.rb b/tests/test_vlan.rb index 5a839afb..7829b880 100755 --- a/tests/test_vlan.rb +++ b/tests/test_vlan.rb @@ -15,11 +15,20 @@ require_relative 'ciscotest' require_relative '../lib/cisco_node_utils/vlan' require_relative '../lib/cisco_node_utils/interface' +require_relative '../lib/cisco_node_utils/vdc' +require_relative '../lib/cisco_node_utils/vxlan_vtep' include Cisco # TestVlan - Minitest for Vlan node utility class TestVlan < CiscoTestCase + def teardown + return unless Vdc.vdc_support + # Reset the vdc module type back to default + v = Vdc.new('default') + v.limit_resource_module_type = '' if v.limit_resource_module_type == 'f3' + end + def interface_ethernet_default(ethernet_id) config("default interface ethernet #{ethernet_id}") end @@ -148,9 +157,31 @@ def test_vlan_name_duplicate v2.destroy end - def test_vlan_mode - skip("Test not supported on #{node.product_id}") if - cmd_ref.lookup('fabricpath', 'feature').default_value.nil? + def compatible_interface? + # MT-full tests require a specific linecard; either because they need a + # compatible interface or simply to enable the features. Either way + # we will provide an appropriate interface name if the linecard is present. + # Example 'show mod' output to match against: + # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' + sh_mod = @device.cmd("sh mod | i '^[0-9]+.*N7K-F3'")[/^(\d+)\s.*N7K-F3/] + slot = sh_mod.nil? ? nil : Regexp.last_match[1] + skip('Unable to find a compatible interface in chassis') if slot.nil? + + "ethernet#{slot}/1" + end + + def mt_full_env_setup + skip('Platform does not support MT-full') unless VxlanVtep.mt_full_support + compatible_interface? + v = Vdc.new('default') + v.limit_resource_module_type = 'f3' unless + v.limit_resource_module_type == 'f3' + end + + def test_vlan_mode_fabricpath + mt_full_env_setup + + # Test for valid mode v = Vlan.new(2000) assert_equal('ce', v.mode, 'Mode should have been default to ce') @@ -159,11 +190,8 @@ def test_vlan_mode 'Fabricpath feature should have been enabled') assert_equal('fabricpath', v.mode, 'Mode should have been set to fabricpath') - end - def test_vlan_mode_invalid - skip("Test not supported on #{node.product_id}") if - cmd_ref.lookup('fabricpath', 'feature').default_value.nil? + # Test for invalid mode v = Vlan.new(100) assert_equal('ce', v.mode, 'Mode should have been default to ce') diff --git a/tests/test_vni.rb b/tests/test_vni.rb index a1d7ba6c..c0ba309f 100644 --- a/tests/test_vni.rb +++ b/tests/test_vni.rb @@ -14,6 +14,7 @@ require_relative 'ciscotest' require_relative '../lib/cisco_node_utils/vni' +require_relative '../lib/cisco_node_utils/vdc' include Cisco @@ -21,22 +22,48 @@ class TestVni < CiscoTestCase def setup super - skip('Only supported on N3K,N7K,N9K') unless node.product_id[/N[379]K/] - no_vni + skip('Platform does not support MT-full or MT-lite') unless + Vni.mt_full_support || Vni.mt_lite_support end def teardown - no_vni - super + # Reset the vdc module type back to default + v = Vdc.new('default') + v.limit_resource_module_type = '' if v.limit_resource_module_type == 'f3' + end + + def compatible_interface? + # This test requires specific linecards; find a compatible linecard + # and create an appropriate interface name from it. + # Example 'show mod' output to match against: + # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' + sh_mod = @device.cmd("sh mod | i '^[0-9]+.*N7K-F3'")[/^(\d+)\s.*N7K-F3/] + slot = sh_mod.nil? ? nil : Regexp.last_match[1] + skip('Unable to find compatible interface in chassis') if slot.nil? + + "ethernet#{slot}/1" end - def no_vni - config('no feature vni') if node.product_id[/N7K/] - config('no feature vn-segment-vlan-based') if node.product_id[/N(3|9)K/] + def mt_full_env_setup + skip('Platform does not support MT-full') unless Vni.mt_full_support + compatible_interface? + v = Vdc.new('default') + v.limit_resource_module_type = 'f3' unless + v.limit_resource_module_type == 'f3' + config('no feature vni') + config('no feature nv overlay') + end + + def mt_lite_env_setup + skip('Platform does not support MT-lite') unless Vni.mt_lite_support + config('no feature vni') + config('no feature nv overlay') + config('no feature vn-segment-vlan-based') end def test_mt_full_vni_create_destroy - skip('Only supported on N7K') unless node.product_id[/N7K/] + mt_full_env_setup + v1 = Vni.new(10_001) v2 = Vni.new(10_002) v3 = Vni.new(10_003) @@ -52,14 +79,16 @@ def test_mt_full_vni_create_destroy # def test_mt_full_encapsulation_dot1q # TBD + # mt_full_env_setup # end # def test_mt_full_mapped_bd # TBD + # mt_full_env_setup # end def test_mt_full_shutdown - skip('Only supported on N7K') unless node.product_id[/N7K/] + mt_full_env_setup vni = Vni.new(10_000) vni.shutdown = true assert(vni.shutdown) @@ -75,7 +104,7 @@ def test_mt_full_shutdown end def test_mt_lite_mapped_vlan - skip('Only supported on N3K,N9K') unless node.product_id[/N[39]K/] + mt_lite_env_setup # Set the vni vlan mapping v = Vni.new(10_000) v.mapped_vlan = 100 diff --git a/tests/test_vrf.rb b/tests/test_vrf.rb index a87cb72d..e641f931 100755 --- a/tests/test_vrf.rb +++ b/tests/test_vrf.rb @@ -14,6 +14,7 @@ require_relative 'ciscotest' require_relative '../lib/cisco_node_utils/vrf' +require_relative '../lib/cisco_node_utils/vni' include Cisco @@ -91,6 +92,7 @@ def test_vrf_description end def test_vrf_vni + skip('Platform does not support MT-lite') unless Vni.mt_lite_support vrf = Vrf.new('test_vrf_vni') vrf.vni = 4096 assert_equal(4096, vrf.vni, diff --git a/tests/test_vxlan_vtep.rb b/tests/test_vxlan_vtep.rb index 26b8a1b2..9879ea09 100755 --- a/tests/test_vxlan_vtep.rb +++ b/tests/test_vxlan_vtep.rb @@ -14,6 +14,7 @@ require_relative 'ciscotest' require_relative '../lib/cisco_node_utils/vxlan_vtep' +require_relative '../lib/cisco_node_utils/vdc' include Cisco @@ -21,27 +22,49 @@ class TestVxlanVtep < CiscoTestCase def setup super - # Check for supported platform - skip("Test not supported on #{node.product_id}") if - cmd_ref.lookup('vdc', 'all_vdcs').config_get_token.nil? + skip('Platform does not support MT-full or MT-lite') unless + VxlanVtep.mt_full_support || VxlanVtep.mt_lite_support + end - # Check for F3 module, since feature nve requires F3 cards. - skip('Test requires N7K-F3 linecard') unless - @device.cmd('sh mod | i N7K-F').match(/N7K-F3/) + def teardown + # Reset the vdc module type back to default + v = Vdc.new('default') + v.limit_resource_module_type = '' if v.limit_resource_module_type == 'f3' + end - no_vxlan_global + def compatible_interface? + # MT-full tests require a specific linecard; either because they need a + # compatible interface or simply to enable the features. Either way + # we will provide an appropriate interface name if the linecard is present. + # Example 'show mod' output to match against: + # '9 12 10/40 Gbps Ethernet Module N7K-F312FQ-25 ok' + sh_mod = @device.cmd("sh mod | i '^[0-9]+.*N7K-F3'")[/^(\d+)\s.*N7K-F3/] + slot = sh_mod.nil? ? nil : Regexp.last_match[1] + skip('Unable to find a compatible interface in chassis') if slot.nil? + + "ethernet#{slot}/1" end - def teardown - no_vxlan_global - super + def mt_full_env_setup + skip('Platform does not support MT-full') unless VxlanVtep.mt_full_support + compatible_interface? + v = Vdc.new('default') + v.limit_resource_module_type = 'f3' unless + v.limit_resource_module_type == 'f3' + config('no feature nv overlay') end - def no_vxlan_global + def mt_lite_env_setup + skip('Platform does not support MT-lite') unless VxlanVtep.mt_lite_support config('no feature nv overlay') + config('no feature vn-segment-vlan-based') end def test_create_destroy_one + # VxlanVtep.new() will enable 'feature nv overlay' + mt_full_env_setup if VxlanVtep.mt_full_support + mt_lite_env_setup if VxlanVtep.mt_lite_support + id = 'nve1' vtep = VxlanVtep.new(id) @default_show_command = "show running | i 'interface #{id}'" @@ -57,8 +80,12 @@ def test_create_destroy_one msg: "failed to destroy interface #{id}") end - def test_create_destroy_multiple - skip('Only supported on n7k') if node.product_id =~ /N[3|5|9]K/ + def test_mt_full_create_destroy_multiple + if VxlanVtep.mt_full_support + mt_full_env_setup + else + skip('Platform does not support MT-full') + end id1 = 'nve1' id2 = 'nve2' @@ -88,13 +115,16 @@ def test_create_destroy_multiple end end - def test_create_multiple_negative - # N[3|9]K supports a single nve int, N7K supports 4. - case node.product_id - when /N[3|9]K/ + def test_create_negative + # MT-lite supports a single nve int, MT-full supports 4. + mt_full_env_setup if VxlanVtep.mt_full_support + mt_lite_env_setup if VxlanVtep.mt_lite_support + if VxlanVtep.mt_lite_support VxlanVtep.new('nve1') negative_id = 'nve2' - when /N7K/ + + elsif VxlanVtep.mt_full_support + mt_full_env_setup (1..4).each { |n| VxlanVtep.new("nve#{n}") } negative_id = 'nve5' end @@ -105,34 +135,44 @@ def test_create_multiple_negative end def test_description + mt_full_env_setup if VxlanVtep.mt_full_support + mt_lite_env_setup if VxlanVtep.mt_lite_support + vtep = VxlanVtep.new('nve1') # Set description to non-default value and verify desc = 'vxlan interface' vtep.description = desc - assert_equal(vtep.description, desc) + assert_equal(desc, vtep.description) # Set description to default value and verify desc = vtep.default_description vtep.description = desc - assert_equal(vtep.description, desc) + assert_equal(desc, vtep.description) end def test_host_reachability + skip("Test not supported on #{node.product_id}") if + cmd_ref.lookup('vxlan_vtep', 'host_reachability').default_value.nil? + mt_full_env_setup if VxlanVtep.mt_full_support + mt_lite_env_setup if VxlanVtep.mt_lite_support + vtep = VxlanVtep.new('nve1') vtep.host_reachability = 'flood' - assert_equal(vtep.host_reachability, 'flood') - + assert_equal('flood', vtep.host_reachability) vtep.host_reachability = 'evpn' - assert_equal(vtep.host_reachability, 'evpn') + assert_equal('evpn', vtep.host_reachability) # Set value back to flood, currently evpn. vtep.host_reachability = 'flood' - assert_equal(vtep.host_reachability, 'flood') + assert_equal('flood', vtep.host_reachability) end def test_shutdown + mt_full_env_setup if VxlanVtep.mt_full_support + mt_lite_env_setup if VxlanVtep.mt_lite_support + vtep = VxlanVtep.new('nve1') vtep.shutdown = true @@ -146,24 +186,27 @@ def test_shutdown end def test_source_interface + mt_full_env_setup if VxlanVtep.mt_full_support + mt_lite_env_setup if VxlanVtep.mt_lite_support + vtep = VxlanVtep.new('nve1') # Set source_interface to non-default value val = 'loopback55' vtep.source_interface = val - assert_equal(vtep.source_interface, val) + assert_equal(val, vtep.source_interface) # Change source_interface when nve interface is in a 'no shutdown' state vtep.shutdown = false val = 'loopback77' vtep.source_interface = val - assert_equal(vtep.source_interface, val) + assert_equal(val, vtep.source_interface) # source_interface should 'no shutdown' after the change. refute(vtep.shutdown, 'source_interface is shutdown') # Set source_interface to default value val = vtep.default_source_interface vtep.source_interface = val - assert_equal(vtep.source_interface, val) + assert_equal(val, vtep.source_interface) end end From b531b9de530af4967017a2b6e267efcee5677ad2 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Wed, 23 Dec 2015 12:51:25 -0500 Subject: [PATCH 4/6] fix bgp_neighbor fail on N7 --- lib/cisco_node_utils/bgp_neighbor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cisco_node_utils/bgp_neighbor.rb b/lib/cisco_node_utils/bgp_neighbor.rb index 5418ad95..c65f38ce 100644 --- a/lib/cisco_node_utils/bgp_neighbor.rb +++ b/lib/cisco_node_utils/bgp_neighbor.rb @@ -203,7 +203,7 @@ def log_neighbor_changes def default_log_neighbor_changes result = config_get_default('bgp_neighbor', 'log_neighbor_changes') - result.to_sym + result.to_sym unless result.nil? end def low_memory_exempt=(val) From 01cdadc0693853f5a4e4bc693e8e3cdcc0f69e37 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Wed, 23 Dec 2015 15:33:18 -0500 Subject: [PATCH 5/6] remove cruft file, remove no feature vni for mt_lite check --- lib/cisco_node_utils/cmd_ref/.#vni.yaml | 1 - tests/test_vni.rb | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 120000 lib/cisco_node_utils/cmd_ref/.#vni.yaml diff --git a/lib/cisco_node_utils/cmd_ref/.#vni.yaml b/lib/cisco_node_utils/cmd_ref/.#vni.yaml deleted file mode 120000 index f051cdbc..00000000 --- a/lib/cisco_node_utils/cmd_ref/.#vni.yaml +++ /dev/null @@ -1 +0,0 @@ -cvanheuv@rtp-ads-504.27057:1449896458 \ No newline at end of file diff --git a/tests/test_vni.rb b/tests/test_vni.rb index c0ba309f..95a8bc5e 100644 --- a/tests/test_vni.rb +++ b/tests/test_vni.rb @@ -56,9 +56,8 @@ def mt_full_env_setup def mt_lite_env_setup skip('Platform does not support MT-lite') unless Vni.mt_lite_support - config('no feature vni') - config('no feature nv overlay') config('no feature vn-segment-vlan-based') + config('no feature nv overlay') end def test_mt_full_vni_create_destroy From a91818880d36318564e83bce71fb03fb20a9ebb7 Mon Sep 17 00:00:00 2001 From: Chris Van Heuveln Date: Thu, 24 Dec 2015 12:11:07 -0500 Subject: [PATCH 6/6] Add a vdc_support check to teardowns --- tests/test_vni.rb | 1 + tests/test_vxlan_vtep.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/test_vni.rb b/tests/test_vni.rb index 95a8bc5e..0d33dfb1 100644 --- a/tests/test_vni.rb +++ b/tests/test_vni.rb @@ -27,6 +27,7 @@ def setup end def teardown + return unless Vdc.vdc_support # Reset the vdc module type back to default v = Vdc.new('default') v.limit_resource_module_type = '' if v.limit_resource_module_type == 'f3' diff --git a/tests/test_vxlan_vtep.rb b/tests/test_vxlan_vtep.rb index 9879ea09..6379930d 100755 --- a/tests/test_vxlan_vtep.rb +++ b/tests/test_vxlan_vtep.rb @@ -27,6 +27,7 @@ def setup end def teardown + return unless Vdc.vdc_support # Reset the vdc module type back to default v = Vdc.new('default') v.limit_resource_module_type = '' if v.limit_resource_module_type == 'f3'