cisco_node_utils 1.9.0 → 1.10.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +14 -0
  4. data/ext/mkrf_conf.rb +1 -1
  5. data/lib/cisco_node_utils/ace.rb +142 -7
  6. data/lib/cisco_node_utils/banner.rb +63 -0
  7. data/lib/cisco_node_utils/bridge_domain.rb +1 -1
  8. data/lib/cisco_node_utils/cisco_cmn_utils.rb +1 -1
  9. data/lib/cisco_node_utils/client/utils.rb +20 -10
  10. data/lib/cisco_node_utils/cmd_ref/acl.yaml +1 -1
  11. data/lib/cisco_node_utils/cmd_ref/banner.yaml +7 -0
  12. data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +2 -2
  13. data/lib/cisco_node_utils/cmd_ref/hostname.yaml +8 -0
  14. data/lib/cisco_node_utils/cmd_ref/interface.yaml +20 -12
  15. data/lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml +3 -3
  16. data/lib/cisco_node_utils/cmd_ref/ip_multicast.yaml +6 -2
  17. data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +4 -1
  18. data/lib/cisco_node_utils/cmd_ref/syslog_facility.yaml +10 -0
  19. data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +3 -3
  20. data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +16 -0
  21. data/lib/cisco_node_utils/cmd_ref/tacacs_server_host.yaml +2 -2
  22. data/lib/cisco_node_utils/environment.rb +8 -1
  23. data/lib/cisco_node_utils/hostname.rb +62 -0
  24. data/lib/cisco_node_utils/interface.rb +59 -2
  25. data/lib/cisco_node_utils/interface_DEPRECATED.rb +5 -0
  26. data/lib/cisco_node_utils/interface_hsrp_group.rb +17 -6
  27. data/lib/cisco_node_utils/ip_multicast.rb +13 -9
  28. data/lib/cisco_node_utils/node.rb +4 -1
  29. data/lib/cisco_node_utils/syslog_facility.rb +64 -0
  30. data/lib/cisco_node_utils/syslog_server.rb +18 -13
  31. data/lib/cisco_node_utils/syslog_settings.rb +43 -1
  32. data/lib/cisco_node_utils/version.rb +1 -1
  33. data/lib/cisco_node_utils/vlan.rb +1 -1
  34. data/lib/cisco_node_utils/vxlan_vtep_vni.rb +21 -8
  35. data/spec/environment_spec.rb +107 -0
  36. data/tests/ciscotest.rb +8 -1
  37. data/tests/test_ace.rb +60 -3
  38. data/tests/test_banner.rb +85 -0
  39. data/tests/test_bgp_af.rb +1 -1
  40. data/tests/test_hostname.rb +64 -0
  41. data/tests/test_interface.rb +22 -1
  42. data/tests/test_interface_hsrp_group.rb +12 -24
  43. data/tests/test_ip_multicast.rb +32 -21
  44. data/tests/test_nxapi.rb +8 -4
  45. data/tests/test_syslog_facility.rb +80 -0
  46. data/tests/test_syslog_server.rb +3 -2
  47. data/tests/test_syslog_settings.rb +16 -1
  48. data/tests/yum_package.yaml +5 -0
  49. metadata +12 -3
@@ -223,8 +223,15 @@ class CiscoTestCase < TestCase
223
223
  end
224
224
 
225
225
  def skip_legacy_defect?(pattern, msg)
226
+ if pattern.is_a?(String)
227
+ pattern = [pattern]
228
+ elsif !pattern.is_a?(Array)
229
+ fail 'Argument: pattern must be a String or Array object'
230
+ end
226
231
  msg = "Defect in legacy image: [#{msg}]"
227
- skip(msg) if Utils.image_version?(Regexp.new(pattern))
232
+ pattern.each do |pat|
233
+ skip(msg) if Utils.image_version?(Regexp.new(pat))
234
+ end
228
235
  end
229
236
 
230
237
  def step_unless_legacy_defect(pattern, msg)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2015-2016 Cisco and/or its affiliates.
1
+ # Copyright (c) 2015-2018 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.
@@ -57,7 +57,7 @@ class TestAce < CiscoTestCase
57
57
  end
58
58
  rescue CliError => e
59
59
  skip('This property is not supported on this platform') if
60
- e.message[/(Invalid parameter detected|Invalid command)/]
60
+ e.message[/(Invalid parameter detected|Invalid command|Invalid number)/]
61
61
  flunk(e.message)
62
62
  end
63
63
 
@@ -83,7 +83,7 @@ class TestAce < CiscoTestCase
83
83
  def test_proto
84
84
  %w(ipv4 ipv6).each do |afi|
85
85
  # Sampling of proto's
86
- %w(ip tcp udp).each do |val|
86
+ %w(ip tcp udp icmp).each do |val|
87
87
  val = 'ipv6' if val[/ip/] && afi[/ipv6/]
88
88
  a = ace_helper(afi, proto: val)
89
89
  assert_equal(val, a.proto)
@@ -149,6 +149,15 @@ class TestAce < CiscoTestCase
149
149
  end
150
150
  end
151
151
 
152
+ def test_vlan
153
+ %w(ipv4 ipv6).each do |afi|
154
+ %w(10 100).each do |val|
155
+ a = ace_helper(afi, proto: 'icmp', vlan: val)
156
+ assert_equal(val, a.vlan)
157
+ end
158
+ end
159
+ end
160
+
152
161
  def test_tcp_flags
153
162
  %w(ipv4 ipv6).each do |afi|
154
163
  %w(ack fin urg syn psh rst) + [
@@ -187,6 +196,34 @@ class TestAce < CiscoTestCase
187
196
  end
188
197
  end
189
198
 
199
+ def test_log_proto_option
200
+ %w(ipv4 ipv6).each do |afi|
201
+ refute(ace_helper(afi).log)
202
+ a = ace_helper(afi, proto: 'icmp', proto_option: 'redirect', log: true)
203
+ assert(a.log)
204
+ end
205
+ end
206
+
207
+ def test_proto_option
208
+ %w(ipv4 ipv6).each do |afi|
209
+ refute(ace_helper(afi).log)
210
+ a = ace_helper(afi, proto: 'icmp', proto_option: 'time-exceeded')
211
+ assert_equal(a.proto_option, 'time-exceeded')
212
+ a = ace_helper(afi, proto: 'icmp', dscp: 'af11', proto_option: 'echo-reply')
213
+ assert_equal(a.proto_option, 'echo-reply')
214
+ assert_equal(a.dscp, 'af11')
215
+ end
216
+ end
217
+
218
+ def test_redirect_proto_option
219
+ afi = 'ipv4'
220
+ val = 'port-channel1,port-channel2'
221
+ a = ace_helper(afi, proto: 'icmp', proto_option: 'redirect',
222
+ redirect: val, log: true, set_erspan_dscp: '3', set_erspan_gre_proto: '33')
223
+ assert_equal(val, a.redirect)
224
+ assert_equal('redirect', a.proto_option)
225
+ end
226
+
190
227
  def test_precedence
191
228
  afi = 'ipv4'
192
229
  %w(critical flash flash-override immediate internet network
@@ -244,4 +281,24 @@ class TestAce < CiscoTestCase
244
281
  'CSCuy47463: access-list ttl does not nvgen') if a.ttl.nil?
245
282
  assert_equal(val, a.ttl)
246
283
  end
284
+
285
+ def test_set_erspan_dscp
286
+ afi = 'ipv4'
287
+ val = 'port-channel1,port-channel2'
288
+ a = ace_helper(afi, proto: 'icmp', proto_option: 'redirect',
289
+ redirect: val, log: true, set_erspan_dscp: '3', set_erspan_gre_proto: '33')
290
+ assert_equal('redirect', a.proto_option)
291
+ assert_equal(val, a.redirect)
292
+ assert_equal('3', a.set_erspan_dscp)
293
+ end
294
+
295
+ def test_set_erspan_gre_proto
296
+ afi = 'ipv4'
297
+ val = 'port-channel1,port-channel2'
298
+ a = ace_helper(afi, proto: 'icmp', proto_option: 'redirect',
299
+ redirect: val, log: true, set_erspan_gre_proto: '33')
300
+ assert_equal('redirect', a.proto_option)
301
+ assert_equal(val, a.redirect)
302
+ assert_equal('33', a.set_erspan_gre_proto)
303
+ end
247
304
  end
@@ -0,0 +1,85 @@
1
+ #
2
+ # Minitest for Banner class
3
+ #
4
+ # Copyright (c) 2014-2018 Cisco and/or its affiliates.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ require_relative 'ciscotest'
19
+ require_relative '../lib/cisco_node_utils/banner'
20
+
21
+ # TestBanner - Minitest for Banner node utility.
22
+ class TestBanner < CiscoTestCase
23
+ def setup
24
+ # setup runs at the beginning of each test
25
+ super
26
+ no_motd
27
+ end
28
+
29
+ def teardown
30
+ # teardown runs at the end of each test
31
+ no_motd
32
+ super
33
+ end
34
+
35
+ def no_motd
36
+ # Turn the feature off for a clean test.
37
+ config('no banner motd')
38
+ end
39
+
40
+ # TESTS
41
+
42
+ def test_single_motd
43
+ id = 'default'
44
+
45
+ banner = Cisco::Banner.new(id)
46
+ assert_includes(Cisco::Banner.banners, id)
47
+ assert_equal(Cisco::Banner.banners[id], banner)
48
+
49
+ assert_equal(banner.default_motd, Cisco::Banner.banners['default'].motd)
50
+ assert_equal(banner.default_motd, banner.motd)
51
+
52
+ banner.motd = 'Test banner!'
53
+ assert_equal(Cisco::Banner.banners['default'].motd,
54
+ 'Test banner!')
55
+ assert_equal(Cisco::Banner.banners['default'].motd,
56
+ banner.motd)
57
+
58
+ banner.motd = nil
59
+ assert_equal(banner.default_motd, Cisco::Banner.banners['default'].motd)
60
+ assert_equal(banner.default_motd, banner.motd)
61
+ end
62
+
63
+ def test_multiline_motd
64
+ skip_versions = ['7.0.3.I[2-6]', '7.0.3.I7.[1-3]', '7.3', '8.[1-3]']
65
+ skip_legacy_defect?(skip_versions, 'multiline banner configuration using nxapi not supported')
66
+ id = 'default'
67
+
68
+ banner = Cisco::Banner.new(id)
69
+ assert_includes(Cisco::Banner.banners, id)
70
+ assert_equal(Cisco::Banner.banners[id], banner)
71
+
72
+ assert_equal(banner.default_motd, Cisco::Banner.banners['default'].motd)
73
+ assert_equal(banner.default_motd, banner.motd)
74
+
75
+ banner.motd = 'This is\na sweet\n\nmultiline\nbanner!\n'
76
+ assert_equal(Cisco::Banner.banners['default'].motd,
77
+ "This is\na sweet\n\nmultiline\nbanner!\n")
78
+ assert_equal(Cisco::Banner.banners['default'].motd,
79
+ banner.motd)
80
+
81
+ banner.motd = nil
82
+ assert_equal(banner.default_motd, Cisco::Banner.banners['default'].motd)
83
+ assert_equal(banner.default_motd, banner.motd)
84
+ end
85
+ end
@@ -175,7 +175,7 @@ class TestBgpAF < CiscoTestCase
175
175
  expect = :runtime if test == :additional_paths_receive && Platform.image_version[/8.0|8.1/]
176
176
  when /I5.2|I5.3|I6/
177
177
  expect = :success if test == :maximum_paths || test == :maximum_paths_ibgp
178
- when /I7/
178
+ when /I7|9\.2/
179
179
  expect = :success if test == :maximum_paths ||
180
180
  test == :maximum_paths_ibgp ||
181
181
  test == :additional_paths_send ||
@@ -0,0 +1,64 @@
1
+ #
2
+ # Minitest for HostName class
3
+ #
4
+ # Copyright (c) 2014-2018 Cisco and/or its affiliates.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ require_relative 'ciscotest'
19
+ require_relative '../lib/cisco_node_utils/hostname'
20
+
21
+ # TestHostname - Minitest for SyslogSetting node utility.
22
+ class TestHostName < CiscoTestCase
23
+ def setup
24
+ # setup runs at the beginning of each test
25
+ super
26
+ hostname_setup
27
+ end
28
+
29
+ def teardown
30
+ # teardown runs at the end of each test
31
+ hostname_teardown
32
+ super
33
+ end
34
+
35
+ @current_hostname = ''
36
+
37
+ def hostname_setup
38
+ hostname_output = Cisco::Client.filter_cli(
39
+ cli_output: config('show running-config | include ^hostname'),
40
+ value: /hostname (.*)/)
41
+ @current_hostname = hostname_output.first unless hostname_output.nil?
42
+ # Turn the feature off for a clean test.
43
+ config('no hostname')
44
+ end
45
+
46
+ def hostname_teardown
47
+ if @current_hostname != ''
48
+ config("hostname #{@current_hostname}")
49
+ else
50
+ config('no hostname')
51
+ end
52
+ end
53
+
54
+ # TESTS
55
+
56
+ def test_hostname_name
57
+ hostname_setting = Cisco::HostName.new('testhost')
58
+ assert_equal(Cisco::HostName.hostname['testhost'], hostname_setting)
59
+ hostname_setting = Cisco::HostName.new('testhost2')
60
+ assert_equal(Cisco::HostName.hostname['testhost2'], hostname_setting)
61
+ hostname_setting.send('hostname=', nil)
62
+ assert_nil(Cisco::HostName.hostname['testhost2'])
63
+ end
64
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2017 Cisco and/or its affiliates.
1
+ # Copyright (c) 2013-2018 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.
@@ -1250,6 +1250,27 @@ class TestInterface < CiscoTestCase
1250
1250
  'Error: ip redirects default get value mismatch')
1251
1251
  end
1252
1252
 
1253
+ def test_ipv6_redirects
1254
+ interface = create_interface
1255
+ interface.switchport_mode = :disabled if platform == :nexus
1256
+
1257
+ # check default value
1258
+ assert_equal(interface.default_ipv6_redirects, interface.ipv6_redirects,
1259
+ 'Error: ipv6 redirects default get value mismatch')
1260
+
1261
+ # set with value false
1262
+ interface.ipv6_redirects = false
1263
+ assert_equal(interface.ipv6_redirects, false)
1264
+
1265
+ # set with value true
1266
+ interface.ipv6_redirects = true
1267
+ assert_equal(interface.ipv6_redirects, true)
1268
+
1269
+ # get default and set
1270
+ interface.ipv6_redirects = interface.default_ipv6_redirects
1271
+ assert_equal(interface.ipv6_redirects, interface.default_ipv6_redirects)
1272
+ end
1273
+
1253
1274
  def config_from_hash(inttype_h)
1254
1275
  inttype_h.each do |k, v|
1255
1276
  config('feature interface-vlan') if (/^Vlan\d./).match(k.to_s)
@@ -109,8 +109,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
109
109
  def test_auth_type_clear
110
110
  skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
111
111
  ihg = create_interface_hsrp_group_ipv4
112
- assert_equal(ihg.default_authentication_string,
113
- ihg.authentication_string)
112
+ assert_nil(ihg.authentication_string)
114
113
  attrs = {}
115
114
  attrs[:authentication_auth_type] = 'cleartext'
116
115
  attrs[:authentication_string] = 'Test'
@@ -119,8 +118,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
119
118
  assert_equal('Test', ihg.authentication_string)
120
119
  attrs[:authentication_string] = ihg.default_authentication_string
121
120
  ihg.authentication_set(attrs)
122
- assert_equal(ihg.default_authentication_string,
123
- ihg.authentication_string)
121
+ assert_nil(ihg.authentication_string)
124
122
 
125
123
  ihg = create_interface_hsrp_group_ipv6
126
124
  attrs[:authentication_auth_type] = 'cleartext'
@@ -130,8 +128,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
130
128
  assert_equal('Test', ihg.authentication_string)
131
129
  attrs[:authentication_string] = ihg.default_authentication_string
132
130
  ihg.authentication_set(attrs)
133
- assert_equal(ihg.default_authentication_string,
134
- ihg.authentication_string)
131
+ assert_nil(ihg.authentication_string)
135
132
  end
136
133
 
137
134
  def test_auth_type_md5
@@ -147,8 +144,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
147
144
  assert_equal('MyMD5Password', ihg.authentication_string)
148
145
  attrs[:authentication_string] = ihg.default_authentication_string
149
146
  ihg.authentication_set(attrs)
150
- assert_equal(ihg.default_authentication_string,
151
- ihg.authentication_string)
147
+ assert_nil(ihg.authentication_string)
152
148
  ihg = create_interface_hsrp_group_ipv6
153
149
  attrs[:authentication_string] = 'MyMD5Password'
154
150
  ihg.authentication_set(attrs)
@@ -157,8 +153,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
157
153
  assert_equal('MyMD5Password', ihg.authentication_string)
158
154
  attrs[:authentication_string] = ihg.default_authentication_string
159
155
  ihg.authentication_set(attrs)
160
- assert_equal(ihg.default_authentication_string,
161
- ihg.authentication_string)
156
+ assert_nil(ihg.authentication_string)
162
157
  end
163
158
 
164
159
  def test_auth_key_string_enc_0
@@ -178,8 +173,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
178
173
  assert_equal('7', ihg.authentication_string)
179
174
  attrs[:authentication_string] = ihg.default_authentication_string
180
175
  ihg.authentication_set(attrs)
181
- assert_equal(ihg.default_authentication_string,
182
- ihg.authentication_string)
176
+ assert_nil(ihg.authentication_string)
183
177
  ihg = create_interface_hsrp_group_ipv6
184
178
  attrs[:authentication_string] = '7'
185
179
  ihg.authentication_set(attrs)
@@ -189,8 +183,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
189
183
  assert_equal('7', ihg.authentication_string)
190
184
  attrs[:authentication_string] = ihg.default_authentication_string
191
185
  ihg.authentication_set(attrs)
192
- assert_equal(ihg.default_authentication_string,
193
- ihg.authentication_string)
186
+ assert_nil(ihg.authentication_string)
194
187
  end
195
188
 
196
189
  def test_auth_key_string_enc_7
@@ -217,8 +210,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
217
210
  assert_equal('12345678901234567890', ihg.authentication_string)
218
211
  attrs[:authentication_string] = ihg.default_authentication_string
219
212
  ihg.authentication_set(attrs)
220
- assert_equal(ihg.default_authentication_string,
221
- ihg.authentication_string)
213
+ assert_nil(ihg.authentication_string)
222
214
  end
223
215
 
224
216
  def test_auth_key_string_enc_7_compat_timeout_ipv4
@@ -250,8 +242,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
250
242
  assert_equal(false, ihg.authentication_compatibility)
251
243
  attrs[:authentication_string] = ihg.default_authentication_string
252
244
  ihg.authentication_set(attrs)
253
- assert_equal(ihg.default_authentication_string,
254
- ihg.authentication_string)
245
+ assert_nil(ihg.authentication_string)
255
246
  end
256
247
 
257
248
  def test_auth_key_string_enc_7_compat_timeout_ipv6
@@ -283,8 +274,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
283
274
  assert_equal(false, ihg.authentication_compatibility)
284
275
  attrs[:authentication_string] = ihg.default_authentication_string
285
276
  ihg.authentication_set(attrs)
286
- assert_equal(ihg.default_authentication_string,
287
- ihg.authentication_string)
277
+ assert_nil(ihg.authentication_string)
288
278
  end
289
279
 
290
280
  def test_auth_key_string_enc_0_compat_timeout_ipv4
@@ -315,8 +305,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
315
305
  assert_equal(3333, ihg.authentication_timeout)
316
306
  attrs[:authentication_string] = ihg.default_authentication_string
317
307
  ihg.authentication_set(attrs)
318
- assert_equal(ihg.default_authentication_string,
319
- ihg.authentication_string)
308
+ assert_nil(ihg.authentication_string)
320
309
  end
321
310
 
322
311
  def test_auth_key_string_enc_0_compat_timeout_ipv6
@@ -347,8 +336,7 @@ class TestInterfaceHsrpGroup < CiscoTestCase
347
336
  assert_equal(3333, ihg.authentication_timeout)
348
337
  attrs[:authentication_string] = ihg.default_authentication_string
349
338
  ihg.authentication_set(attrs)
350
- assert_equal(ihg.default_authentication_string,
351
- ihg.authentication_string)
339
+ assert_nil(ihg.authentication_string)
352
340
  end
353
341
 
354
342
  def test_preempt_ipv4
@@ -38,31 +38,42 @@ class TestIpMulticast < CiscoTestCase
38
38
  super
39
39
  end
40
40
 
41
- def test_ip_multicast
41
+ def test_overlay_distributed_dr
42
+ skip_legacy_defect?('7.0.3.I7.4', 'CSCvk01535')
43
+
44
+ ipm = IpMulticast.new
45
+
46
+ # Test Defaults
47
+ have = ipm.overlay_distributed_dr
48
+ should = ipm.default_overlay_distributed_dr
49
+ assert_equal(have, should, 'overlay_distributed_dr does not match default value')
50
+
51
+ # Test property set
52
+ ipm.overlay_distributed_dr = true
53
+ assert_equal(ipm.overlay_distributed_dr, true, 'overlay_distributed_dr was not set')
54
+
55
+ # Test property unset
56
+ ipm.overlay_distributed_dr = false
57
+ assert_equal(ipm.overlay_distributed_dr, false, 'overlay_distributed_dr was not unset')
58
+
59
+ ipm.destroy
60
+ end
61
+
62
+ def test_overlay_spt_only
42
63
  ipm = IpMulticast.new
43
- opts = %w(overlay_distributed_dr overlay_spt_only)
44
64
 
45
- # test defaults
46
- opts.each do |opt|
47
- have = ipm.send("#{opt}")
48
- should = ipm.send("default_#{opt}")
49
- assert_equal(have, should, "#{opt} doesn't match the default")
50
- end
65
+ # Test Defaults
66
+ have = ipm.overlay_spt_only
67
+ should = ipm.default_overlay_spt_only
68
+ assert_equal(have, should, 'overlay_spt_only does not match default value')
51
69
 
52
- # test property set
53
- opts.each do |opt|
54
- ipm.send("#{opt}=", true)
55
- should = 'ip multicast ' + opt.tr('_', '-')
56
- assert_equal(ipm.send("#{opt}"), should, "#{opt} was not set")
57
- end
70
+ # Test property set
71
+ ipm.overlay_spt_only = true
72
+ assert_equal(ipm.overlay_spt_only, true, 'overlay_spt_only was not set')
58
73
 
59
- # unset property
60
- opts.each do |opt|
61
- ipm.send("#{opt}=", false)
62
- should = false
63
- assert_equal(ipm.send("#{opt}"), should, "#{opt} was not unset")
64
- assert_equal(ipm.send("#{opt}"), ipm.send("default_#{opt}"), "#{opt} doesn't match default")
65
- end
74
+ # Test property unset
75
+ ipm.overlay_spt_only = false
76
+ assert_equal(ipm.overlay_spt_only, false, 'overlay_spt_only was not unset')
66
77
 
67
78
  ipm.destroy
68
79
  end