cisco_node_utils 1.7.0 → 1.8.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/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +2 -1
- data/cisco_node_utils.gemspec +1 -0
- data/docs/README-develop-node-utils-APIs.md +2 -1
- data/lib/cisco_node_utils/aaa_authentication_login_service.rb +2 -2
- data/lib/cisco_node_utils/ace.rb +2 -0
- data/lib/cisco_node_utils/bgp.rb +34 -91
- data/lib/cisco_node_utils/bridge_domain.rb +8 -13
- data/lib/cisco_node_utils/client/nxapi/client.rb +10 -3
- data/lib/cisco_node_utils/cmd_ref/DEPRECATED.yaml +12 -12
- data/lib/cisco_node_utils/cmd_ref/README_YAML.md +2 -1
- data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/bfd_global.yaml +3 -3
- data/lib/cisco_node_utils/cmd_ref/bgp.yaml +5 -15
- data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +14 -36
- data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/dhcp_relay_global.yaml +5 -3
- data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +3 -3
- data/lib/cisco_node_utils/cmd_ref/interface.yaml +25 -15
- data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +5 -0
- data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +6 -0
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +9 -0
- data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/object_group.yaml +32 -0
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +9 -7
- data/lib/cisco_node_utils/cmd_ref/radius_global.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/route_map.yaml +26 -25
- data/lib/cisco_node_utils/cmd_ref/show_version.yaml +11 -3
- data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +4 -0
- data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +5 -1
- data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +8 -8
- data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +3 -2
- data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +21 -1
- data/lib/cisco_node_utils/cmd_ref/tacacs_global.yaml +7 -0
- data/lib/cisco_node_utils/cmd_ref/vdc.yaml +1 -1
- data/lib/cisco_node_utils/cmd_ref/vlan.yaml +5 -4
- data/lib/cisco_node_utils/cmd_ref/vpc.yaml +9 -9
- data/lib/cisco_node_utils/cmd_ref/vrf.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +1 -0
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +3 -5
- data/lib/cisco_node_utils/command_reference.rb +11 -1
- data/lib/cisco_node_utils/interface.rb +46 -8
- data/lib/cisco_node_utils/interface_ospf.rb +2 -2
- data/lib/cisco_node_utils/interface_portchannel.rb +2 -2
- data/lib/cisco_node_utils/node.rb +9 -0
- data/lib/cisco_node_utils/ntp_auth_key.rb +1 -1
- data/lib/cisco_node_utils/object_group.rb +75 -0
- data/lib/cisco_node_utils/object_group_entry.rb +143 -0
- data/lib/cisco_node_utils/portchannel_global.rb +2 -2
- data/lib/cisco_node_utils/radius_global.rb +25 -1
- data/lib/cisco_node_utils/router_ospf.rb +3 -3
- data/lib/cisco_node_utils/syslog_server.rb +38 -42
- data/lib/cisco_node_utils/syslog_settings.rb +74 -3
- data/lib/cisco_node_utils/tacacs_global.rb +47 -14
- data/lib/cisco_node_utils/tacacs_server.rb +1 -5
- data/lib/cisco_node_utils/version.rb +1 -1
- data/lib/cisco_node_utils/vpc.rb +1 -4
- data/lib/cisco_node_utils/vtp.rb +4 -2
- data/spec/schema.yaml +3 -0
- data/tests/ciscotest.rb +16 -9
- data/tests/test_ace.rb +2 -0
- data/tests/test_bgp_af.rb +10 -2
- data/tests/test_bgp_neighbor_af.rb +6 -2
- data/tests/test_bridge_domain.rb +7 -0
- data/tests/test_feature.rb +2 -2
- data/tests/test_interface.rb +30 -4
- data/tests/test_node_ext.rb +2 -2
- data/tests/test_object_group.rb +122 -0
- data/tests/test_platform.rb +1 -1
- data/tests/test_portchannel_global.rb +1 -0
- data/tests/test_radius_global.rb +22 -2
- data/tests/test_route_map.rb +11 -8
- data/tests/test_router_bgp.rb +7 -132
- data/tests/test_router_ospf_area.rb +6 -6
- data/tests/test_snmpuser.rb +19 -11
- data/tests/test_syslog_server.rb +11 -31
- data/tests/test_syslog_settings.rb +46 -5
- data/tests/test_tacacs_global.rb +42 -18
- data/tests/test_vpc.rb +3 -0
- data/tests/test_vxlan_vtep_vni.rb +0 -3
- data/tests/yum_package.yaml +5 -0
- metadata +21 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# Jonathan Tripathy et al., September 2015
|
|
4
4
|
#
|
|
5
|
-
# Copyright (c) 2014-
|
|
5
|
+
# Copyright (c) 2014-2017 Cisco and/or its affiliates.
|
|
6
6
|
#
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -42,14 +42,82 @@ module Cisco
|
|
|
42
42
|
name == other.name
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def default_console
|
|
46
|
+
config_get_default('syslog_settings', 'console')
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def console
|
|
50
|
+
console = config_get('syslog_settings', 'console')
|
|
51
|
+
if console.is_a?(Array)
|
|
52
|
+
console = console[0] == 'no' ? 'unset' : console[1]
|
|
53
|
+
end
|
|
54
|
+
console
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def console=(severity)
|
|
58
|
+
if severity
|
|
59
|
+
config_set(
|
|
60
|
+
'syslog_settings', 'console',
|
|
61
|
+
state: '', severity: severity)
|
|
62
|
+
else
|
|
63
|
+
config_set(
|
|
64
|
+
'syslog_settings', 'console',
|
|
65
|
+
state: 'no', severity: '')
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def default_monitor
|
|
70
|
+
config_get_default('syslog_settings', 'monitor')
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def monitor
|
|
74
|
+
monitor = config_get('syslog_settings', 'monitor')
|
|
75
|
+
if monitor.is_a?(Array)
|
|
76
|
+
monitor = monitor[0] == 'no' ? 'unset' : monitor[1]
|
|
77
|
+
end
|
|
78
|
+
monitor
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def monitor=(severity)
|
|
82
|
+
if severity
|
|
83
|
+
config_set(
|
|
84
|
+
'syslog_settings', 'monitor',
|
|
85
|
+
state: '', severity: severity)
|
|
86
|
+
else
|
|
87
|
+
config_set(
|
|
88
|
+
'syslog_settings', 'monitor',
|
|
89
|
+
state: 'no', severity: '')
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def default_source_interface
|
|
94
|
+
config_get_default('syslog_settings', 'source_interface')
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def source_interface
|
|
98
|
+
i = config_get('syslog_settings', 'source_interface')
|
|
99
|
+
i.nil? ? default_source_interface : i.downcase
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def source_interface=(name)
|
|
103
|
+
if name
|
|
104
|
+
config_set(
|
|
105
|
+
'syslog_settings', 'source_interface',
|
|
106
|
+
state: '', source_interface: name)
|
|
107
|
+
else
|
|
108
|
+
config_set(
|
|
109
|
+
'syslog_settings', 'source_interface',
|
|
110
|
+
state: 'no', source_interface: '')
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
45
114
|
def timestamp
|
|
46
115
|
config_get('syslog_settings', 'timestamp')
|
|
47
116
|
end
|
|
48
117
|
|
|
49
118
|
def timestamp=(val)
|
|
50
|
-
fail TypeError unless val.is_a?(String)
|
|
51
119
|
fail TypeError \
|
|
52
|
-
unless %w(seconds milliseconds).include?(val)
|
|
120
|
+
unless %w(seconds milliseconds).include?(val.to_s)
|
|
53
121
|
|
|
54
122
|
# There is no unset version as timestamp has a default value
|
|
55
123
|
config_set('syslog_settings',
|
|
@@ -57,5 +125,8 @@ module Cisco
|
|
|
57
125
|
state: '',
|
|
58
126
|
units: val)
|
|
59
127
|
end
|
|
128
|
+
|
|
129
|
+
alias_method :time_stamp_units, :timestamp
|
|
130
|
+
alias_method :time_stamp_units=, :timestamp=
|
|
60
131
|
end # class
|
|
61
132
|
end # module
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Tacacs Global provider class
|
|
2
2
|
|
|
3
|
-
# TP HONEY et al., June 2014-
|
|
3
|
+
# TP HONEY et al., June 2014-2017
|
|
4
4
|
|
|
5
|
-
# Copyright (c) 2014-
|
|
5
|
+
# Copyright (c) 2014-2017 Cisco and/or its affiliates.
|
|
6
6
|
|
|
7
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
# you may not use this file except in compliance with the License.
|
|
@@ -20,10 +20,6 @@ require_relative 'node_util'
|
|
|
20
20
|
|
|
21
21
|
# Tacacs Global configuration management
|
|
22
22
|
module Cisco
|
|
23
|
-
TACACS_GLOVAL_ENC_NONE = 0
|
|
24
|
-
TACACS_GLOBAL_ENC_CISCO_TYPE_7 = 7
|
|
25
|
-
TACACS_GLOBAL_ENC_UNKNOWN = 8
|
|
26
|
-
|
|
27
23
|
# TacacsGlobal - node utility class for
|
|
28
24
|
class TacacsGlobal < NodeUtil
|
|
29
25
|
attr_reader :name
|
|
@@ -33,7 +29,6 @@ module Cisco
|
|
|
33
29
|
fail ArgumentError,
|
|
34
30
|
"This provider only accepts an id of 'default'" \
|
|
35
31
|
unless name.eql?('default')
|
|
36
|
-
Feature.tacacs_enable unless Feature.tacacs_enabled?
|
|
37
32
|
@name = name
|
|
38
33
|
end
|
|
39
34
|
|
|
@@ -48,6 +43,7 @@ module Cisco
|
|
|
48
43
|
end
|
|
49
44
|
|
|
50
45
|
def timeout
|
|
46
|
+
return nil unless Feature.tacacs_enabled?
|
|
51
47
|
config_get('tacacs_global', 'timeout')
|
|
52
48
|
end
|
|
53
49
|
|
|
@@ -62,11 +58,11 @@ module Cisco
|
|
|
62
58
|
end
|
|
63
59
|
|
|
64
60
|
if val.nil?
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
timeout: timeout)
|
|
61
|
+
fail ArgumentError, 'timeout cannot be unset if TACACS enabled - ' \
|
|
62
|
+
"use default value #{default_timeout}" \
|
|
63
|
+
if Feature.tacacs_enabled?
|
|
69
64
|
else
|
|
65
|
+
Feature.tacacs_enable
|
|
70
66
|
config_set('tacacs_global',
|
|
71
67
|
'timeout',
|
|
72
68
|
state: '',
|
|
@@ -80,6 +76,7 @@ module Cisco
|
|
|
80
76
|
end
|
|
81
77
|
|
|
82
78
|
def key
|
|
79
|
+
return nil unless Feature.tacacs_enabled?
|
|
83
80
|
str = config_get('tacacs_global', 'key')
|
|
84
81
|
return TacacsGlobal.default_key if str.empty?
|
|
85
82
|
str = str[1].strip
|
|
@@ -92,14 +89,50 @@ module Cisco
|
|
|
92
89
|
end
|
|
93
90
|
|
|
94
91
|
def encryption_key_set(key_format, key)
|
|
95
|
-
key
|
|
96
|
-
if
|
|
92
|
+
# If we get an empty key - remove default if configured
|
|
93
|
+
if key.nil? || key.to_s.empty?
|
|
94
|
+
key = self.key
|
|
95
|
+
return if key.empty?
|
|
96
|
+
key_format = self.key_format
|
|
97
97
|
config_set('tacacs_server', 'encryption', state: 'no',
|
|
98
98
|
option: key_format, key: key)
|
|
99
99
|
else
|
|
100
|
-
|
|
100
|
+
Feature.tacacs_enable
|
|
101
|
+
key = Utils.add_quotes(key)
|
|
102
|
+
if key_format.nil? || key_format.to_s.empty?
|
|
103
|
+
config_set('tacacs_server', 'encryption', state: '', option: '',
|
|
101
104
|
key: key)
|
|
105
|
+
else
|
|
106
|
+
config_set('tacacs_server', 'encryption', state: '',
|
|
107
|
+
option: key_format, key: key)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Get default source interface
|
|
113
|
+
def default_source_interface
|
|
114
|
+
config_get_default('tacacs_global', 'source_interface')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Set source interface
|
|
118
|
+
def source_interface=(name)
|
|
119
|
+
if name
|
|
120
|
+
Feature.tacacs_enable
|
|
121
|
+
config_set(
|
|
122
|
+
'tacacs_global', 'source_interface',
|
|
123
|
+
state: '', source_interface: name)
|
|
124
|
+
else
|
|
125
|
+
config_set(
|
|
126
|
+
'tacacs_global', 'source_interface',
|
|
127
|
+
state: 'no', source_interface: '')
|
|
102
128
|
end
|
|
103
129
|
end
|
|
130
|
+
|
|
131
|
+
# Get source interface
|
|
132
|
+
def source_interface
|
|
133
|
+
return nil unless Feature.tacacs_enabled?
|
|
134
|
+
i = config_get('tacacs_global', 'source_interface')
|
|
135
|
+
i.nil? ? default_source_interface : i.downcase
|
|
136
|
+
end
|
|
104
137
|
end # class
|
|
105
138
|
end # module
|
|
@@ -30,11 +30,7 @@ module Cisco
|
|
|
30
30
|
|
|
31
31
|
# Check feature enablement
|
|
32
32
|
def self.enabled
|
|
33
|
-
|
|
34
|
-
rescue Cisco::CliError => e
|
|
35
|
-
# cmd will syntax reject when feature is not enabled
|
|
36
|
-
raise unless e.clierror =~ /Syntax error/
|
|
37
|
-
return false
|
|
33
|
+
Feature.tacacs_enabled?
|
|
38
34
|
end
|
|
39
35
|
|
|
40
36
|
# Enable tacacs_server feature
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
# Container module for version number only.
|
|
16
16
|
module CiscoNodeUtils
|
|
17
|
-
VERSION = '1.
|
|
17
|
+
VERSION = '1.8.0'
|
|
18
18
|
gem_version = Gem::Version.new(Gem::VERSION)
|
|
19
19
|
min_gem_version = Gem::Version.new('2.1.0')
|
|
20
20
|
fail 'Required rubygems version >= 2.1.0' if gem_version < min_gem_version
|
data/lib/cisco_node_utils/vpc.rb
CHANGED
|
@@ -35,13 +35,10 @@ module Cisco
|
|
|
35
35
|
|
|
36
36
|
def self.domains
|
|
37
37
|
hash = {}
|
|
38
|
+
return hash unless Vpc.enabled
|
|
38
39
|
my_domain = config_get('vpc', 'domain')
|
|
39
40
|
hash[my_domain] = Vpc.new(my_domain, false) unless my_domain.nil?
|
|
40
41
|
hash
|
|
41
|
-
rescue Cisco::CliError => e
|
|
42
|
-
# cmd will syntax reject when feature is not enabled
|
|
43
|
-
raise unless e.clierror =~ /Syntax error/
|
|
44
|
-
return {}
|
|
45
42
|
end
|
|
46
43
|
|
|
47
44
|
def self.enabled
|
data/lib/cisco_node_utils/vtp.rb
CHANGED
|
@@ -32,10 +32,12 @@ module Cisco
|
|
|
32
32
|
|
|
33
33
|
# Get vtp domain name
|
|
34
34
|
def self.domain
|
|
35
|
+
dom_def = config_get_default('vtp', 'domain')
|
|
35
36
|
if Feature.vtp_enabled?
|
|
36
|
-
config_get('vtp', 'domain')
|
|
37
|
+
dom = config_get('vtp', 'domain')
|
|
38
|
+
return dom == '-' ? dom_def : dom
|
|
37
39
|
else
|
|
38
|
-
|
|
40
|
+
dom_def
|
|
39
41
|
end
|
|
40
42
|
end
|
|
41
43
|
|
data/spec/schema.yaml
CHANGED
|
@@ -15,7 +15,9 @@ mapping:
|
|
|
15
15
|
- 'C3064'
|
|
16
16
|
- 'C3132'
|
|
17
17
|
- 'C3172'
|
|
18
|
+
- 'N35'
|
|
18
19
|
- 'N3k'
|
|
20
|
+
- 'N3k-F'
|
|
19
21
|
- 'N5k'
|
|
20
22
|
- 'N6k'
|
|
21
23
|
- 'N7k'
|
|
@@ -33,6 +35,7 @@ mapping:
|
|
|
33
35
|
C3132: *base
|
|
34
36
|
C3172: *base
|
|
35
37
|
N3k: *base
|
|
38
|
+
N3k-F: *base
|
|
36
39
|
N5k: *base
|
|
37
40
|
N6k: *base
|
|
38
41
|
N7k: *base
|
data/tests/ciscotest.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2013-
|
|
1
|
+
# Copyright (c) 2013-2017 Cisco and/or its affiliates.
|
|
2
2
|
#
|
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
# you may not use this file except in compliance with the License.
|
|
@@ -185,8 +185,12 @@ class CiscoTestCase < TestCase
|
|
|
185
185
|
key_values = e.split(':')
|
|
186
186
|
larr = key_values[0].split(',')
|
|
187
187
|
larr.each do |lkey|
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
if lkey.to_s == 'C3548'
|
|
189
|
+
# Special case N3k Platform
|
|
190
|
+
else
|
|
191
|
+
fail "Unrecognized product_id: #{lkey}" unless
|
|
192
|
+
lkey.downcase[/n(3|5|6|7|9)/]
|
|
193
|
+
end
|
|
190
194
|
next unless lkey.downcase.strip == product_tag
|
|
191
195
|
ver = key_values[1]
|
|
192
196
|
break if ver
|
|
@@ -219,7 +223,7 @@ class CiscoTestCase < TestCase
|
|
|
219
223
|
|
|
220
224
|
def skip_legacy_defect?(pattern, msg)
|
|
221
225
|
msg = "Defect in legacy image: [#{msg}]"
|
|
222
|
-
skip(msg) if
|
|
226
|
+
skip(msg) if Utils.image_version?(Regexp.new(pattern))
|
|
223
227
|
end
|
|
224
228
|
|
|
225
229
|
def interfaces
|
|
@@ -296,7 +300,8 @@ class CiscoTestCase < TestCase
|
|
|
296
300
|
Vrf.vrfs.each do |vrf, obj|
|
|
297
301
|
next if vrf[/management/]
|
|
298
302
|
# TBD: Remove vrf workaround below after CSCuz56697 is resolved
|
|
299
|
-
config 'vrf context ' + vrf if
|
|
303
|
+
config 'vrf context ' + vrf if
|
|
304
|
+
node.product_id[/N9K.*-F/] || node.product_id[/N3K.*-F/]
|
|
300
305
|
obj.destroy
|
|
301
306
|
end
|
|
302
307
|
end
|
|
@@ -460,7 +465,7 @@ class CiscoTestCase < TestCase
|
|
|
460
465
|
# Returns the output of the command.
|
|
461
466
|
def shell_command(command, context='bash')
|
|
462
467
|
fail "shell_command api not supported on #{node.product_id}" unless
|
|
463
|
-
node.product_id[/N3K|N9K.*-F|N9K/]
|
|
468
|
+
node.product_id[/N3K|N3K.*-F|N9K.*-F|N9K/]
|
|
464
469
|
unless context == 'bash' || context == 'guestshell'
|
|
465
470
|
fail "Context must be either 'bash' or 'guestshell'"
|
|
466
471
|
end
|
|
@@ -470,7 +475,7 @@ class CiscoTestCase < TestCase
|
|
|
470
475
|
def backup_resolv_file(context='bash')
|
|
471
476
|
# Configuration bleeding is only a problem on some platforms, so
|
|
472
477
|
# only backup the resolv.conf file on required plaforms.
|
|
473
|
-
return unless node.product_id[/N3K|N9K.*-F|N9K/]
|
|
478
|
+
return unless node.product_id[/N3K|N3K.*-F|N9K.*-F|N9K/]
|
|
474
479
|
time_stamp = Time.now.strftime('%Y-%m-%d_%H-%M-%S')
|
|
475
480
|
backup_filename = "/tmp/resolv.conf.#{time_stamp}"
|
|
476
481
|
shell_command("cp /etc/resolv.conf #{backup_filename}", context)
|
|
@@ -478,7 +483,7 @@ class CiscoTestCase < TestCase
|
|
|
478
483
|
end
|
|
479
484
|
|
|
480
485
|
def restore_resolv_file(filename, context='bash')
|
|
481
|
-
return unless node.product_id[/N3K|N9K.*-F|N9K/]
|
|
486
|
+
return unless node.product_id[/N3K|N3K.*-F|N9K.*-F|N9K/]
|
|
482
487
|
shell_command("sudo cp #{filename} /etc/resolv.conf", context)
|
|
483
488
|
shell_command("rm #{filename}", context)
|
|
484
489
|
end
|
|
@@ -502,8 +507,10 @@ class CiscoTestCase < TestCase
|
|
|
502
507
|
def product_tag
|
|
503
508
|
@product_id ||= node.product_id
|
|
504
509
|
case @product_id
|
|
510
|
+
when /N3K-C35/
|
|
511
|
+
tag = 'n35'
|
|
505
512
|
when /N3/
|
|
506
|
-
tag = 'n3k'
|
|
513
|
+
tag = Utils.image_version?(/7.0.3.F/) ? 'n3k-f' : 'n3k'
|
|
507
514
|
when /N5/
|
|
508
515
|
tag = 'n5k'
|
|
509
516
|
when /N6/
|
data/tests/test_ace.rb
CHANGED
data/tests/test_bgp_af.rb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# Richard Wellum, August, 2015
|
|
6
6
|
#
|
|
7
|
-
# Copyright (c) 2015-
|
|
7
|
+
# Copyright (c) 2015-2017 Cisco and/or its affiliates.
|
|
8
8
|
#
|
|
9
9
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
10
|
# you may not use this file except in compliance with the License.
|
|
@@ -124,6 +124,7 @@ class TestBgpAF < CiscoTestCase
|
|
|
124
124
|
# Tests that are successful even though a rule below says otherwise
|
|
125
125
|
[:next_hop_route_map, :nexus, 'default', %w(l2vpn evpn), :success],
|
|
126
126
|
[:additional_paths_send, :nexus, 'default', %w(l2vpn evpn), :runtime],
|
|
127
|
+
[:additional_paths_receive, :nexus, 'default', %w(l2vpn evpn), :runtime],
|
|
127
128
|
[:additional_paths_selection, :nexus, 'default', %w(l2vpn evpn), :runtime],
|
|
128
129
|
[:maximum_paths, :nexus, 'default', %w(l2vpn evpn), :runtime],
|
|
129
130
|
[:maximum_paths_ibgp, :nexus, 'default', %w(l2vpn evpn), :runtime],
|
|
@@ -169,10 +170,17 @@ class TestBgpAF < CiscoTestCase
|
|
|
169
170
|
# triggers a version check below.
|
|
170
171
|
if expect == :runtime
|
|
171
172
|
case Platform.image_version
|
|
172
|
-
when /8.0|8.1/
|
|
173
|
+
when /8.0|8.1|8.2|F3.2/
|
|
173
174
|
expect = :success
|
|
175
|
+
expect = :runtime if test == :additional_paths_receive && Platform.image_version[/8.0|8.1/]
|
|
174
176
|
when /I5.2|I5.3|I6/
|
|
175
177
|
expect = :success if test == :maximum_paths || test == :maximum_paths_ibgp
|
|
178
|
+
when /I7/
|
|
179
|
+
expect = :success if test == :maximum_paths ||
|
|
180
|
+
test == :maximum_paths_ibgp ||
|
|
181
|
+
test == :additional_paths_send ||
|
|
182
|
+
test == :additional_paths_receive ||
|
|
183
|
+
test == :additional_paths_selection
|
|
176
184
|
else
|
|
177
185
|
expect = :CliError
|
|
178
186
|
end
|
|
@@ -429,8 +429,10 @@ class TestBgpNeighborAF < CiscoTestCase
|
|
|
429
429
|
|
|
430
430
|
# Test false with value
|
|
431
431
|
af.allowas_in_set(false)
|
|
432
|
+
# skip setting this to false due to bug CSCve58319
|
|
432
433
|
refute(af.allowas_in,
|
|
433
|
-
"Test 3. #{dbg} Failed to set state to False")
|
|
434
|
+
"Test 3. #{dbg} Failed to set state to False") unless
|
|
435
|
+
Platform.image_version[/I5|I6|F3.3/]
|
|
434
436
|
|
|
435
437
|
# Test true with value, from false
|
|
436
438
|
af.allowas_in_set(true, 4)
|
|
@@ -440,8 +442,10 @@ class TestBgpNeighborAF < CiscoTestCase
|
|
|
440
442
|
|
|
441
443
|
# Test default_state
|
|
442
444
|
af.allowas_in_set(af.default_allowas_in)
|
|
445
|
+
# skip setting this to false due to bug CSCve58319
|
|
443
446
|
refute(af.allowas_in,
|
|
444
|
-
"Test 5. #{dbg} Failed to set state to default")
|
|
447
|
+
"Test 5. #{dbg} Failed to set state to default") unless
|
|
448
|
+
Platform.image_version[/I5|I6|F3.3/]
|
|
445
449
|
|
|
446
450
|
# Test true with value set to default
|
|
447
451
|
af.allowas_in_set(true, af.default_allowas_in_max)
|
data/tests/test_bridge_domain.rb
CHANGED
|
@@ -101,6 +101,8 @@ class TestBridgeDomain < CiscoTestCase
|
|
|
101
101
|
refute(bd.shutdown)
|
|
102
102
|
bd.shutdown = true
|
|
103
103
|
assert(bd.shutdown)
|
|
104
|
+
bd.shutdown = false
|
|
105
|
+
refute(bd.shutdown)
|
|
104
106
|
bd.destroy
|
|
105
107
|
end
|
|
106
108
|
|
|
@@ -114,6 +116,11 @@ class TestBridgeDomain < CiscoTestCase
|
|
|
114
116
|
assert_equal(name, bd.bd_name,
|
|
115
117
|
'Error: Bridge-Domain name not updated to #{name}')
|
|
116
118
|
|
|
119
|
+
name = ''
|
|
120
|
+
bd.bd_name = name
|
|
121
|
+
assert_equal(bd.default_bd_name, bd.default_bd_name,
|
|
122
|
+
'Error: Bridge-Domain name not updated to default')
|
|
123
|
+
|
|
117
124
|
bd.bd_name = bd.default_bd_name
|
|
118
125
|
assert_equal(bd.default_bd_name, bd.bd_name,
|
|
119
126
|
'Error: Bridge-Domain name not restored to default')
|