@@ -26,18 +26,6 @@ class TestFeature < CiscoTestCase
26
26
# Helpers #
27
27
###########
28
28
29
- # VDC helper for features that require a specific linecard.
30
- # Allows caller to get current state or change it to a new value.
31
- def vdc_lc_state ( type = nil )
32
- v = Vdc . new ( 'default' )
33
- if type
34
- # This action may be time consuming, use only if necessary.
35
- v . limit_resource_module_type = type
36
- else
37
- v . limit_resource_module_type
38
- end
39
- end
40
-
41
29
# feature test helper
42
30
def feature ( feat )
43
31
# Get the feature name string from the yaml
@@ -97,8 +85,12 @@ def test_nv_overlay
97
85
assert_raises ( Cisco ::UnsupportedError ) { Feature . nv_overlay_enable }
98
86
return
99
87
end
88
+
89
+ # Dependency setup
100
90
vxlan_linecard?
91
+ vdc_lc_state ( 'f3' )
101
92
config_no_warn ( 'no feature-set fabricpath' )
93
+
102
94
feature ( 'nv_overlay' )
103
95
end
104
96
@@ -108,8 +100,8 @@ def test_nv_overlay_evpn
108
100
assert_raises ( Cisco ::UnsupportedError ) { Feature . nv_overlay_evpn_enable }
109
101
return
110
102
end
111
- vdc_current = node . product_id [ /N7/ ] ? vdc_lc_state : nil
112
- vdc_lc_state ( 'f3' ) if vdc_current
103
+ vxlan_linecard?
104
+ vdc_lc_state ( 'f3' )
113
105
114
106
# nv_overlay_evpn can't use the 'feature' helper so test it explicitly here
115
107
# Get current state of feature, then disable it
@@ -125,10 +117,6 @@ def test_nv_overlay_evpn
125
117
Feature . nv_overlay_evpn_enable
126
118
assert ( Feature . nv_overlay_evpn_enabled? ,
127
119
"(#{ feat_str } ) is not enabled" )
128
-
129
- # Return testbed to pre-clean state
130
- config ( "no #{ feat_str } " ) unless pre_clean_enabled
131
- vdc_lc_state ( vdc_current ) if vdc_current
132
120
end
133
121
134
122
def test_ospf
@@ -156,9 +144,9 @@ def test_vn_segment_vlan_based
156
144
end
157
145
158
146
def test_vni
147
+ # Dependency setup
159
148
vxlan_linecard?
160
- vdc_current = node . product_id [ /N7/ ] ? vdc_lc_state : nil
161
- vdc_lc_state ( 'f3' ) if vdc_current
149
+ vdc_lc_state ( 'f3' )
162
150
163
151
if node . product_id [ /N(5|6)/ ]
164
152
Feature . nv_overlay_enable
@@ -167,7 +155,6 @@ def test_vni
167
155
config_no_warn ( 'no feature nv overlay' )
168
156
end
169
157
feature ( 'vni' )
170
- vdc_lc_state ( vdc_current ) if vdc_current
171
158
rescue RuntimeError => e
172
159
hardware_supports_feature? ( e . message )
173
160
end
@@ -190,10 +177,7 @@ def test_feature_set_fabric
190
177
# Get current state of the feature-set
191
178
feature_set_installed = Feature . fabric_installed?
192
179
feature_enabled = Feature . fabric_enabled?
193
- vdc_current = node . product_id [ /N7/ ] ? vdc_lc_state : nil
194
180
195
- # clean
196
- vdc_lc_state ( 'f3' ) if vdc_current
197
181
config ( "no #{ fs } ; no install #{ fs } " ) if feature_set_installed
198
182
refute_show_match (
199
183
command : "show running | i '^install #{ fs } $'" ,
@@ -207,7 +191,6 @@ def test_feature_set_fabric
207
191
# Return testbed to pre-clean state
208
192
config ( "no #{ fs } " ) unless feature_enabled
209
193
config ( "no install #{ fs } " ) unless feature_set_installed
210
- vdc_lc_state ( vdc_current ) if vdc_current
211
194
end
212
195
213
196
def test_feature_set_fex
0 commit comments