cisco_node_utils 1.2.0 → 1.3.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/.gitignore +2 -0
- data/.rspec +2 -0
- data/.rubocop.yml +13 -0
- data/.travis.yml +4 -1
- data/CHANGELOG.md +81 -2
- data/CONTRIBUTING.md +2 -17
- data/Gemfile +5 -0
- data/README.md +92 -47
- data/Rakefile +23 -1
- data/bin/git/hooks/hook_lib +7 -0
- data/bin/git/hooks/pre-commit/check_unstaged_changes +18 -0
- data/bin/git/hooks/pre-commit/rubocop +7 -2
- data/bin/git/hooks/pre-commit/validate-diffs +18 -4
- data/bin/git/hooks/pre-commit/validate-yaml +18 -0
- data/bin/git/update-hooks +64 -6
- data/cisco_node_utils.gemspec +9 -6
- data/docs/README-develop-best-practices.md +149 -50
- data/docs/README-develop-node-utils-APIs.md +92 -42
- data/docs/README-maintainers.md +7 -4
- data/docs/README-test-execution.md +57 -0
- data/docs/cisco_node_utils.yaml.example +30 -0
- data/docs/template-router.rb +4 -0
- data/ext/mkrf_conf.rb +63 -0
- data/lib/.rubocop.yml +2 -2
- data/lib/cisco_node_utils.rb +5 -0
- data/lib/cisco_node_utils/aaa_authentication_login.rb +5 -6
- data/lib/cisco_node_utils/aaa_authorization_service.rb +1 -1
- data/lib/cisco_node_utils/ace.rb +165 -12
- data/lib/cisco_node_utils/acl.rb +2 -1
- data/lib/cisco_node_utils/bgp.rb +184 -21
- data/lib/cisco_node_utils/bgp_af.rb +94 -249
- data/lib/cisco_node_utils/bgp_neighbor.rb +94 -14
- data/lib/cisco_node_utils/bgp_neighbor_af.rb +75 -8
- data/lib/cisco_node_utils/bridge_domain.rb +183 -0
- data/lib/cisco_node_utils/bridge_domain_vni.rb +206 -0
- data/lib/cisco_node_utils/cisco_cmn_utils.rb +85 -2
- data/lib/cisco_node_utils/client.rb +35 -0
- data/lib/cisco_node_utils/client/client.rb +234 -0
- data/lib/cisco_node_utils/client/grpc.rb +33 -0
- data/lib/cisco_node_utils/client/grpc/client.rb +311 -0
- data/lib/cisco_node_utils/client/grpc/ems.proto +148 -0
- data/lib/cisco_node_utils/client/grpc/ems.rb +111 -0
- data/lib/cisco_node_utils/client/grpc/ems_services.rb +49 -0
- data/lib/cisco_node_utils/client/nxapi.rb +31 -0
- data/lib/cisco_node_utils/client/nxapi/client.rb +305 -0
- data/lib/cisco_node_utils/client/utils.rb +164 -0
- data/lib/cisco_node_utils/cmd_ref/README_YAML.md +222 -254
- data/lib/cisco_node_utils/cmd_ref/aaa_auth_login_service.yaml +11 -8
- data/lib/cisco_node_utils/cmd_ref/aaa_authentication_login.yaml +22 -15
- data/lib/cisco_node_utils/cmd_ref/aaa_authorization_service.yaml +11 -8
- data/lib/cisco_node_utils/cmd_ref/acl.yaml +21 -16
- data/lib/cisco_node_utils/cmd_ref/bgp.yaml +239 -109
- data/lib/cisco_node_utils/cmd_ref/bgp_af.yaml +114 -55
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor.yaml +76 -52
- data/lib/cisco_node_utils/cmd_ref/bgp_neighbor_af.yaml +106 -62
- data/lib/cisco_node_utils/cmd_ref/bridge_domain.yaml +71 -0
- data/lib/cisco_node_utils/cmd_ref/bridge_domain_vni.yaml +33 -0
- data/lib/cisco_node_utils/cmd_ref/dnsclient.yaml +35 -14
- data/lib/cisco_node_utils/cmd_ref/encapsulation.yaml +25 -0
- data/lib/cisco_node_utils/cmd_ref/evpn_vni.yaml +23 -17
- data/lib/cisco_node_utils/cmd_ref/fabricpath.yaml +94 -83
- data/lib/cisco_node_utils/cmd_ref/fabricpath_topology.yaml +22 -17
- data/lib/cisco_node_utils/cmd_ref/feature.yaml +76 -26
- data/lib/cisco_node_utils/cmd_ref/images.yaml +3 -2
- data/lib/cisco_node_utils/cmd_ref/interface.yaml +381 -153
- data/lib/cisco_node_utils/cmd_ref/interface_channel_group.yaml +21 -11
- data/lib/cisco_node_utils/cmd_ref/interface_ospf.yaml +21 -21
- data/lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml +30 -21
- data/lib/cisco_node_utils/cmd_ref/interface_service_vni.yaml +18 -13
- data/lib/cisco_node_utils/cmd_ref/inventory.yaml +26 -31
- data/lib/cisco_node_utils/cmd_ref/itd_device_group.yaml +83 -0
- data/lib/cisco_node_utils/cmd_ref/itd_service.yaml +119 -0
- data/lib/cisco_node_utils/cmd_ref/memory.yaml +17 -6
- data/lib/cisco_node_utils/cmd_ref/ntp_config.yaml +10 -3
- data/lib/cisco_node_utils/cmd_ref/ntp_server.yaml +17 -5
- data/lib/cisco_node_utils/cmd_ref/ospf.yaml +33 -29
- data/lib/cisco_node_utils/cmd_ref/overlay_global.yaml +12 -10
- data/lib/cisco_node_utils/cmd_ref/pim.yaml +16 -19
- data/lib/cisco_node_utils/cmd_ref/portchannel_global.yaml +40 -25
- data/lib/cisco_node_utils/cmd_ref/radius_global.yaml +17 -12
- data/lib/cisco_node_utils/cmd_ref/radius_server.yaml +71 -35
- data/lib/cisco_node_utils/cmd_ref/radius_server_group.yaml +10 -5
- data/lib/cisco_node_utils/cmd_ref/show_system.yaml +6 -2
- data/lib/cisco_node_utils/cmd_ref/show_version.yaml +47 -43
- data/lib/cisco_node_utils/cmd_ref/snmp_community.yaml +13 -11
- data/lib/cisco_node_utils/cmd_ref/snmp_group.yaml +4 -2
- data/lib/cisco_node_utils/cmd_ref/snmp_notification_receiver.yaml +23 -21
- data/lib/cisco_node_utils/cmd_ref/snmp_server.yaml +26 -22
- data/lib/cisco_node_utils/cmd_ref/snmp_user.yaml +19 -17
- data/lib/cisco_node_utils/cmd_ref/snmpnotification.yaml +18 -6
- data/lib/cisco_node_utils/cmd_ref/stp_global.yaml +234 -0
- data/lib/cisco_node_utils/cmd_ref/syslog_server.yaml +24 -9
- data/lib/cisco_node_utils/cmd_ref/syslog_settings.yaml +5 -3
- data/lib/cisco_node_utils/cmd_ref/system.yaml +4 -3
- data/lib/cisco_node_utils/cmd_ref/tacacs_server.yaml +22 -20
- data/lib/cisco_node_utils/cmd_ref/tacacs_server_group.yaml +27 -15
- data/lib/cisco_node_utils/cmd_ref/tacacs_server_host.yaml +45 -16
- data/lib/cisco_node_utils/cmd_ref/vdc.yaml +21 -11
- data/lib/cisco_node_utils/cmd_ref/virtual_service.yaml +3 -2
- data/lib/cisco_node_utils/cmd_ref/vlan.yaml +60 -32
- data/lib/cisco_node_utils/cmd_ref/vpc.yaml +118 -101
- data/lib/cisco_node_utils/cmd_ref/vrf.yaml +54 -58
- data/lib/cisco_node_utils/cmd_ref/vrf_af.yaml +118 -0
- data/lib/cisco_node_utils/cmd_ref/vtp.yaml +19 -25
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep.yaml +28 -18
- data/lib/cisco_node_utils/cmd_ref/vxlan_vtep_vni.yaml +34 -17
- data/lib/cisco_node_utils/cmd_ref/yum.yaml +6 -4
- data/lib/cisco_node_utils/command_reference.rb +261 -142
- data/lib/cisco_node_utils/constants.rb +33 -0
- data/lib/cisco_node_utils/encapsulation.rb +112 -0
- data/lib/cisco_node_utils/environment.rb +102 -0
- data/lib/cisco_node_utils/evpn_vni.rb +5 -3
- data/lib/cisco_node_utils/exceptions.rb +111 -0
- data/lib/cisco_node_utils/fabricpath_global.rb +52 -35
- data/lib/cisco_node_utils/fabricpath_topology.rb +44 -57
- data/lib/cisco_node_utils/feature.rb +165 -3
- data/lib/cisco_node_utils/interface.rb +1051 -260
- data/lib/cisco_node_utils/interface_channel_group.rb +11 -10
- data/lib/cisco_node_utils/interface_ospf.rb +1 -2
- data/lib/cisco_node_utils/interface_portchannel.rb +4 -12
- data/lib/cisco_node_utils/interface_service_vni.rb +7 -7
- data/lib/cisco_node_utils/itd_device_group.rb +248 -0
- data/lib/cisco_node_utils/itd_device_group_node.rb +144 -0
- data/lib/cisco_node_utils/itd_service.rb +523 -0
- data/lib/cisco_node_utils/logger.rb +75 -0
- data/lib/cisco_node_utils/node.rb +62 -192
- data/lib/cisco_node_utils/node_util.rb +56 -10
- data/lib/cisco_node_utils/overlay_global.rb +2 -2
- data/lib/cisco_node_utils/pim.rb +2 -13
- data/lib/cisco_node_utils/pim_group_list.rb +1 -1
- data/lib/cisco_node_utils/pim_rp_address.rb +1 -1
- data/lib/cisco_node_utils/platform.rb +52 -21
- data/lib/cisco_node_utils/portchannel_global.rb +89 -19
- data/lib/cisco_node_utils/radius_server.rb +168 -37
- data/lib/cisco_node_utils/router_ospf.rb +20 -35
- data/lib/cisco_node_utils/router_ospf_vrf.rb +4 -4
- data/lib/cisco_node_utils/snmpserver.rb +1 -6
- data/lib/cisco_node_utils/snmpuser.rb +6 -4
- data/lib/cisco_node_utils/stp_global.rb +676 -0
- data/lib/cisco_node_utils/syslog_server.rb +77 -18
- data/lib/cisco_node_utils/syslog_settings.rb +1 -1
- data/lib/cisco_node_utils/tacacs_server_group.rb +8 -4
- data/lib/cisco_node_utils/tacacs_server_host.rb +115 -25
- data/lib/cisco_node_utils/vdc.rb +12 -0
- data/lib/cisco_node_utils/version.rb +1 -1
- data/lib/cisco_node_utils/vlan.rb +147 -29
- data/lib/cisco_node_utils/vpc.rb +55 -3
- data/lib/cisco_node_utils/vrf.rb +72 -11
- data/lib/cisco_node_utils/vrf_af.rb +114 -29
- data/lib/cisco_node_utils/vtp.rb +34 -52
- data/lib/cisco_node_utils/vxlan_vtep.rb +34 -8
- data/lib/cisco_node_utils/vxlan_vtep_vni.rb +36 -4
- data/lib/minitest/environment_plugin.rb +31 -0
- data/lib/minitest/log_level_plugin.rb +41 -0
- data/spec/client_spec.rb +7 -0
- data/spec/environment_spec.rb +263 -0
- data/spec/grpc_client_spec.rb +23 -0
- data/spec/isolate/all_clients_spec.rb +9 -0
- data/spec/isolate/grpc_only_spec.rb +16 -0
- data/spec/isolate/no_clients_spec.rb +26 -0
- data/spec/isolate/nxapi_only_spec.rb +16 -0
- data/spec/nxapi_client_spec.rb +42 -0
- data/spec/schema.yaml +75 -0
- data/spec/shared_examples_for_clients.rb +14 -0
- data/spec/spec_helper.rb +91 -0
- data/spec/whitespace_spec.rb +10 -0
- data/spec/yaml_spec.rb +42 -0
- data/tests/.rubocop.yml +2 -2
- data/tests/CSCuxdublin-1.0.0-7.0.3.I3.1.lib32_n9000.rpm +0 -0
- data/tests/basetest.rb +96 -36
- data/tests/ciscotest.rb +220 -12
- data/tests/cmd_config.yaml +71 -49
- data/tests/cmd_config_invalid.yaml +1 -1
- data/tests/test_aaa_authentication_login.rb +1 -0
- data/tests/test_aaa_authentication_login_service.rb +9 -0
- data/tests/test_aaa_authorization_service.rb +173 -367
- data/tests/test_ace.rb +171 -100
- data/tests/test_acl.rb +10 -1
- data/tests/test_bgp_af.rb +395 -728
- data/tests/test_bgp_neighbor.rb +274 -115
- data/tests/test_bgp_neighbor_af.rb +178 -77
- data/tests/test_bridge_domain.rb +191 -0
- data/tests/test_bridge_domain_vni.rb +116 -0
- data/tests/test_client_utils.rb +111 -0
- data/tests/test_command_config.rb +9 -5
- data/tests/test_command_reference.rb +380 -102
- data/tests/test_dns_domain.rb +13 -3
- data/tests/test_domain_name.rb +13 -3
- data/tests/test_encapsulation.rb +77 -0
- data/tests/test_evpn_vni.rb +25 -7
- data/tests/test_fabricpath_global.rb +167 -163
- data/tests/test_fabricpath_topology.rb +12 -33
- data/tests/test_feature.rb +215 -0
- data/tests/test_grpc.rb +166 -0
- data/tests/test_interface.rb +585 -344
- data/tests/test_interface_bdi.rb +80 -0
- data/tests/test_interface_channel_group.rb +6 -3
- data/tests/test_interface_ospf.rb +26 -24
- data/tests/test_interface_portchannel.rb +1 -0
- data/tests/test_interface_private_vlan.rb +724 -0
- data/tests/test_interface_service_vni.rb +37 -66
- data/tests/test_interface_svi.rb +98 -101
- data/tests/test_interface_switchport.rb +419 -549
- data/tests/test_itd_device_group.rb +145 -0
- data/tests/test_itd_device_group_node.rb +199 -0
- data/tests/test_itd_service.rb +298 -0
- data/tests/test_logger.rb +43 -0
- data/tests/test_name_server.rb +11 -2
- data/tests/test_node.rb +16 -75
- data/tests/test_node_ext.rb +174 -163
- data/tests/test_node_util.rb +119 -0
- data/tests/test_ntp_config.rb +5 -1
- data/tests/test_ntp_server.rb +2 -2
- data/tests/test_nxapi.rb +221 -0
- data/tests/test_overlay_global.rb +47 -38
- data/tests/test_pim.rb +2 -0
- data/tests/test_pim_group_list.rb +2 -0
- data/tests/test_pim_rp_address.rb +2 -0
- data/tests/test_platform.rb +86 -39
- data/tests/test_portchannel_global.rb +211 -135
- data/tests/test_radius_global.rb +13 -5
- data/tests/test_radius_server.rb +256 -104
- data/tests/test_radius_server_group.rb +2 -0
- data/tests/test_router_bgp.rb +781 -485
- data/tests/test_router_ospf.rb +26 -103
- data/tests/test_router_ospf_vrf.rb +52 -57
- data/tests/test_snmp_notification_receiver.rb +2 -0
- data/tests/test_snmpcommunity.rb +2 -0
- data/tests/test_snmpgroup.rb +2 -0
- data/tests/test_snmpnotification.rb +40 -21
- data/tests/test_snmpserver.rb +2 -0
- data/tests/test_snmpuser.rb +2 -0
- data/tests/test_stp_global.rb +563 -0
- data/tests/test_syslog_server.rb +32 -8
- data/tests/test_syslog_settings.rb +22 -9
- data/tests/test_tacacs_server.rb +32 -27
- data/tests/test_tacacs_server_group.rb +100 -45
- data/tests/test_tacacs_server_host.rb +135 -43
- data/tests/test_vdc.rb +2 -16
- data/tests/test_vlan.rb +106 -54
- data/tests/test_vlan_mt_full.rb +11 -21
- data/tests/test_vlan_private.rb +669 -0
- data/tests/test_vpc.rb +312 -159
- data/tests/test_vrf.rb +122 -113
- data/tests/test_vrf_af.rb +238 -0
- data/tests/test_vtp.rb +58 -102
- data/tests/test_vxlan_vtep.rb +38 -17
- data/tests/test_vxlan_vtep_vni.rb +61 -9
- data/tests/test_yum.rb +49 -25
- metadata +122 -36
- data/lib/cisco_node_utils/cmd_ref/fex.yaml +0 -9
- data/lib/cisco_node_utils/cmd_ref/vni.yaml +0 -76
- data/lib/cisco_node_utils/vni.rb +0 -227
- data/tests/test_vni.rb +0 -106
data/tests/test_vpc.rb
CHANGED
|
@@ -15,39 +15,34 @@ require_relative 'ciscotest'
|
|
|
15
15
|
require_relative '../lib/cisco_node_utils/vpc'
|
|
16
16
|
require_relative '../lib/cisco_node_utils/interface'
|
|
17
17
|
require_relative '../lib/cisco_node_utils/interface_channel_group'
|
|
18
|
+
require_relative '../lib/cisco_node_utils/platform'
|
|
18
19
|
|
|
19
20
|
include Cisco
|
|
20
21
|
|
|
21
22
|
# TestVpc - Minitest for Vpc node utility class
|
|
22
23
|
class TestVpc < CiscoTestCase
|
|
24
|
+
@skip_unless_supported = 'vpc'
|
|
25
|
+
|
|
23
26
|
def setup
|
|
24
27
|
super
|
|
25
28
|
no_feature_vpc
|
|
26
29
|
end
|
|
27
30
|
|
|
28
31
|
def teardown
|
|
29
|
-
no_feature_vpc
|
|
30
32
|
super
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
def no_feature_vpc
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def n5k6k_platforms?
|
|
38
|
-
/N[56]K/ =~ node.product_id
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def n3k9k_platforms?
|
|
42
|
-
/N[39]K/ =~ node.product_id
|
|
36
|
+
domains = Vpc.domains
|
|
37
|
+
domains.each { |_key, elem| elem.destroy } unless domains.empty?
|
|
43
38
|
end
|
|
44
39
|
|
|
45
40
|
# TESTS
|
|
46
41
|
|
|
47
42
|
def test_vpc_create
|
|
48
|
-
|
|
49
|
-
assert(
|
|
50
|
-
"VPC domain not set correctly #{
|
|
43
|
+
vpc = Vpc.new(100)
|
|
44
|
+
assert(vpc.domain == 100,
|
|
45
|
+
"VPC domain not set correctly #{vpc.domain}")
|
|
51
46
|
assert(Vpc.enabled,
|
|
52
47
|
'VPC feature should have been enabled')
|
|
53
48
|
refute(Vpc.domains.empty?,
|
|
@@ -56,265 +51,295 @@ class TestVpc < CiscoTestCase
|
|
|
56
51
|
|
|
57
52
|
def test_vpc_destroy
|
|
58
53
|
# create and test again
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
vpc = Vpc.new(100)
|
|
55
|
+
vpc.destroy
|
|
61
56
|
refute(Vpc.enabled, 'VPC feature should have been disabled')
|
|
62
57
|
end
|
|
63
58
|
|
|
64
59
|
def test_auto_recovery
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
vpc = Vpc.new(100)
|
|
61
|
+
if validate_property_excluded?('vpc', 'auto_recovery')
|
|
62
|
+
assert_raises(Cisco::UnsupportedError) { vpc.auto_recovery = true }
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
default_val = vpc.auto_recovery
|
|
67
|
+
assert_equal(default_val, vpc.auto_recovery,
|
|
70
68
|
"Auto recovery should be #{default_val} by default")
|
|
71
|
-
|
|
72
|
-
refute(
|
|
73
|
-
|
|
74
|
-
assert(
|
|
69
|
+
vpc.auto_recovery = false
|
|
70
|
+
refute(vpc.auto_recovery, 'Auto recovery not getting disabled')
|
|
71
|
+
vpc.auto_recovery = true
|
|
72
|
+
assert(vpc.auto_recovery, 'Auto recovery not getting set')
|
|
75
73
|
end
|
|
76
74
|
|
|
77
75
|
def test_auto_recovery_reload_delay
|
|
78
|
-
|
|
79
|
-
default_value =
|
|
80
|
-
assert_equal(default_value,
|
|
76
|
+
vpc = Vpc.new(100)
|
|
77
|
+
default_value = vpc.default_auto_recovery_reload_delay
|
|
78
|
+
assert_equal(default_value, vpc.auto_recovery_reload_delay,
|
|
81
79
|
"Auto recovery delay should be #{default_value}")
|
|
82
|
-
|
|
83
|
-
assert_equal(300,
|
|
80
|
+
vpc.auto_recovery_reload_delay = 300
|
|
81
|
+
assert_equal(300, vpc.auto_recovery_reload_delay,
|
|
84
82
|
'Auto recovery delay should be 300')
|
|
85
83
|
end
|
|
86
84
|
|
|
87
85
|
def test_delay_restore
|
|
88
|
-
|
|
89
|
-
default_value =
|
|
90
|
-
assert_equal(default_value,
|
|
86
|
+
vpc = Vpc.new(100)
|
|
87
|
+
default_value = vpc.default_delay_restore
|
|
88
|
+
assert_equal(default_value, vpc.delay_restore,
|
|
91
89
|
"delay_restore should be #{default_value}")
|
|
92
|
-
|
|
93
|
-
assert_equal(1000,
|
|
90
|
+
vpc.delay_restore = 1000
|
|
91
|
+
assert_equal(1000, vpc.delay_restore,
|
|
94
92
|
'delay restore should be 1000')
|
|
95
93
|
end
|
|
96
94
|
|
|
97
95
|
def test_delay_restore_interface_vlan
|
|
98
|
-
|
|
99
|
-
default_value =
|
|
100
|
-
assert_equal(default_value,
|
|
96
|
+
vpc = Vpc.new(100)
|
|
97
|
+
default_value = vpc.default_delay_restore_interface_vlan
|
|
98
|
+
assert_equal(default_value, vpc.delay_restore_interface_vlan,
|
|
101
99
|
"delay_restore should be #{default_value}")
|
|
102
|
-
|
|
103
|
-
assert_equal(2000,
|
|
100
|
+
vpc.delay_restore_interface_vlan = 2000
|
|
101
|
+
assert_equal(2000, vpc.delay_restore_interface_vlan,
|
|
104
102
|
'delay restore should be 2000')
|
|
105
103
|
end
|
|
106
104
|
|
|
107
105
|
def test_dual_active_exclude_interface_vlan_bridge_domain
|
|
108
|
-
|
|
106
|
+
vpc = Vpc.new(100)
|
|
109
107
|
default_value =
|
|
110
|
-
|
|
108
|
+
vpc.default_dual_active_exclude_interface_vlan_bridge_domain
|
|
111
109
|
assert_equal(default_value,
|
|
112
|
-
|
|
110
|
+
vpc.dual_active_exclude_interface_vlan_bridge_domain,
|
|
113
111
|
"delay_restore should be #{default_value}")
|
|
114
|
-
|
|
112
|
+
vpc.dual_active_exclude_interface_vlan_bridge_domain = '2-20,900'
|
|
115
113
|
assert_equal('2-20,900',
|
|
116
|
-
|
|
114
|
+
vpc.dual_active_exclude_interface_vlan_bridge_domain,
|
|
117
115
|
'exclude vlan/bd should be 2-20,900')
|
|
118
116
|
end
|
|
119
117
|
|
|
120
118
|
def test_graceful_consistency_check
|
|
121
|
-
|
|
122
|
-
default_val =
|
|
123
|
-
assert_equal(default_val,
|
|
119
|
+
vpc = Vpc.new(100)
|
|
120
|
+
default_val = vpc.default_graceful_consistency_check
|
|
121
|
+
assert_equal(default_val, vpc.graceful_consistency_check,
|
|
124
122
|
"graceful_consistency_check must be #{default_val} by default")
|
|
125
|
-
|
|
126
|
-
refute(
|
|
123
|
+
vpc.graceful_consistency_check = false
|
|
124
|
+
refute(vpc.graceful_consistency_check,
|
|
127
125
|
'graceful_consistency_check not getting disabled')
|
|
128
|
-
|
|
129
|
-
assert(
|
|
126
|
+
vpc.graceful_consistency_check = true
|
|
127
|
+
assert(vpc.graceful_consistency_check,
|
|
130
128
|
'graceful_consistency_check not getting set')
|
|
131
129
|
end
|
|
132
130
|
|
|
133
131
|
def test_layer3_peer_routing
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
vpc = Vpc.new(100)
|
|
133
|
+
if validate_property_excluded?('vpc', 'layer3_peer_routing')
|
|
134
|
+
assert_raises(Cisco::UnsupportedError) { vpc.layer3_peer_routing = true }
|
|
135
|
+
return
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
default_val = vpc.default_layer3_peer_routing
|
|
139
|
+
assert_equal(default_val, vpc.layer3_peer_routing,
|
|
139
140
|
"layer3_peer_routing should be #{default_val} by default")
|
|
140
|
-
|
|
141
|
-
assert(
|
|
142
|
-
|
|
143
|
-
refute(
|
|
141
|
+
vpc.layer3_peer_routing = true
|
|
142
|
+
assert(vpc.layer3_peer_routing, 'layer3_peer_routing not getting set')
|
|
143
|
+
vpc.layer3_peer_routing = false
|
|
144
|
+
refute(vpc.layer3_peer_routing, 'layer3_peer_routing not getting disabled')
|
|
144
145
|
end
|
|
145
146
|
|
|
146
147
|
def test_peer_keepalive
|
|
147
|
-
|
|
148
|
+
vpc = Vpc.new(100)
|
|
148
149
|
|
|
149
150
|
# Check default values
|
|
150
|
-
dest =
|
|
151
|
+
dest = vpc.default_peer_keepalive_dest
|
|
151
152
|
assert_equal('', dest, 'destination should be 1.1.1.2')
|
|
152
|
-
source =
|
|
153
|
+
source = vpc.default_peer_keepalive_src
|
|
153
154
|
assert_equal('', source, 'source should be 1.1.1.1')
|
|
154
|
-
udp_port =
|
|
155
|
+
udp_port = vpc.default_peer_keepalive_udp_port
|
|
155
156
|
assert_equal(3200, udp_port, 'udp port should be 3200')
|
|
156
|
-
vrf =
|
|
157
|
+
vrf = vpc.default_peer_keepalive_vrf
|
|
157
158
|
assert_equal('management', vrf, 'vrf should be management')
|
|
158
|
-
interval =
|
|
159
|
+
interval = vpc.default_peer_keepalive_interval
|
|
159
160
|
assert_equal(1000, interval, 'interval should be 1000')
|
|
160
|
-
timeout =
|
|
161
|
+
timeout = vpc.default_peer_keepalive_interval_timeout
|
|
161
162
|
assert_equal(5, timeout, 'interval timeout should be 5')
|
|
162
|
-
precedence =
|
|
163
|
+
precedence = vpc.default_peer_keepalive_precedence
|
|
163
164
|
assert_equal(6, precedence, 'precedence should be 6')
|
|
164
|
-
hold_timeout =
|
|
165
|
+
hold_timeout = vpc.default_peer_keepalive_hold_timeout
|
|
165
166
|
assert_equal(3, hold_timeout, 'hold timeout should be 3')
|
|
166
167
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
dest =
|
|
168
|
+
vpc.peer_keepalive_set('1.1.1.2', '1.1.1.1', 3800, 'management', 400, 3,
|
|
169
|
+
6, 3)
|
|
170
|
+
dest = vpc.peer_keepalive_dest
|
|
170
171
|
assert_equal('1.1.1.2', dest, 'destination should be 1.1.1.2')
|
|
171
|
-
source =
|
|
172
|
+
source = vpc.peer_keepalive_src
|
|
172
173
|
assert_equal('1.1.1.1', source, 'source should be 1.1.1.1')
|
|
173
|
-
udp_port =
|
|
174
|
+
udp_port = vpc.peer_keepalive_udp_port
|
|
174
175
|
assert_equal(3800, udp_port, 'udp port should be 3800')
|
|
175
|
-
vrf =
|
|
176
|
+
vrf = vpc.peer_keepalive_vrf
|
|
176
177
|
assert_equal('management', vrf, 'vrf should be management')
|
|
177
|
-
interval =
|
|
178
|
+
interval = vpc.peer_keepalive_interval
|
|
178
179
|
assert_equal(400, interval, 'interval should be 400')
|
|
179
|
-
timeout =
|
|
180
|
+
timeout = vpc.peer_keepalive_interval_timeout
|
|
180
181
|
assert_equal(3, timeout, 'interval timeout should be 3')
|
|
181
|
-
precedence =
|
|
182
|
+
precedence = vpc.peer_keepalive_precedence
|
|
182
183
|
assert_equal(6, precedence, 'precedence should be 6')
|
|
183
|
-
hold_timeout =
|
|
184
|
+
hold_timeout = vpc.peer_keepalive_hold_timeout
|
|
184
185
|
assert_equal(3, hold_timeout, 'hold timeout should be 3')
|
|
185
186
|
end
|
|
186
187
|
|
|
187
188
|
def test_peer_gateway
|
|
188
|
-
|
|
189
|
-
default_val =
|
|
190
|
-
assert_equal(default_val,
|
|
189
|
+
vpc = Vpc.new(100)
|
|
190
|
+
default_val = vpc.default_peer_gateway
|
|
191
|
+
assert_equal(default_val, vpc.peer_gateway,
|
|
191
192
|
"peer_gateway should be #{default_val} by default")
|
|
192
|
-
|
|
193
|
-
assert(
|
|
194
|
-
|
|
195
|
-
refute(
|
|
193
|
+
vpc.peer_gateway = true
|
|
194
|
+
assert(vpc.peer_gateway, 'peer_gateway not getting set')
|
|
195
|
+
vpc.peer_gateway = false
|
|
196
|
+
refute(vpc.peer_gateway, 'peer_gateway not getting disabled')
|
|
196
197
|
end
|
|
197
198
|
|
|
198
199
|
def test_peer_gateway_exclude_bridge_domain
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
vpc = Vpc.new(100)
|
|
201
|
+
if validate_property_excluded?('vpc', 'peer_gateway_exclude_bridge_domain')
|
|
202
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
203
|
+
vpc.peer_gateway_exclude_bridge_domain = '10'
|
|
204
|
+
end
|
|
205
|
+
return
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
default_val = vpc.default_peer_gateway_exclude_bridge_domain
|
|
209
|
+
assert_equal(default_val, vpc.peer_gateway_exclude_bridge_domain,
|
|
205
210
|
"peer_gateway exclude BD should be #{default_val} default")
|
|
206
|
-
|
|
207
|
-
assert_equal('10-20,400',
|
|
211
|
+
vpc.peer_gateway_exclude_bridge_domain = '10-20,400'
|
|
212
|
+
assert_equal('10-20,400', vpc.peer_gateway_exclude_bridge_domain,
|
|
208
213
|
'peer_gateway exclude list not getting set')
|
|
209
214
|
end
|
|
210
215
|
|
|
211
216
|
def test_peer_gateway_exclude_vlan
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
vpc = Vpc.new(100)
|
|
218
|
+
if validate_property_excluded?('vpc', 'peer_gateway_exclude_vlan')
|
|
219
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
220
|
+
vpc.peer_gateway_exclude_vlan = '10'
|
|
221
|
+
end
|
|
222
|
+
return
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
default_val = vpc.default_peer_gateway_exclude_vlan
|
|
226
|
+
assert_equal(default_val, vpc.peer_gateway_exclude_vlan,
|
|
217
227
|
"peer_gateway exclude vlan should be #{default_val} default")
|
|
218
|
-
|
|
219
|
-
assert_equal('10-20,400',
|
|
228
|
+
vpc.peer_gateway_exclude_vlan = '10-20,400'
|
|
229
|
+
assert_equal('10-20,400', vpc.peer_gateway_exclude_vlan,
|
|
220
230
|
'peer_gateway exclude list not getting set')
|
|
221
231
|
end
|
|
222
232
|
|
|
223
233
|
def test_role_priority
|
|
224
|
-
|
|
225
|
-
default_value =
|
|
226
|
-
assert_equal(default_value,
|
|
234
|
+
vpc = Vpc.new(100)
|
|
235
|
+
default_value = vpc.default_role_priority
|
|
236
|
+
assert_equal(default_value, vpc.role_priority,
|
|
227
237
|
"Role priority should be #{default_value}")
|
|
228
|
-
|
|
229
|
-
assert_equal(200,
|
|
238
|
+
vpc.role_priority = 200
|
|
239
|
+
assert_equal(200, vpc.role_priority,
|
|
230
240
|
'Role priority should be 200')
|
|
231
241
|
end
|
|
232
242
|
|
|
233
243
|
def test_self_isolation
|
|
234
|
-
|
|
244
|
+
vpc = Vpc.new(100)
|
|
245
|
+
if validate_property_excluded?('vpc', 'self_isolation')
|
|
246
|
+
assert_raises(Cisco::UnsupportedError) { vpc.self_isolation = true }
|
|
247
|
+
return
|
|
248
|
+
end
|
|
235
249
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
assert_equal(true, @vpc.self_isolation,
|
|
250
|
+
vpc.self_isolation = true
|
|
251
|
+
assert_equal(true, vpc.self_isolation,
|
|
239
252
|
'Self isolation should have been configured')
|
|
240
253
|
end
|
|
241
254
|
|
|
242
255
|
def test_shutdown
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
256
|
+
vpc = Vpc.new(100)
|
|
257
|
+
if validate_property_excluded?('vpc', 'shutdown')
|
|
258
|
+
assert_raises(Cisco::UnsupportedError) { vpc.shutdown = true }
|
|
259
|
+
return
|
|
260
|
+
end
|
|
246
261
|
|
|
247
|
-
|
|
248
|
-
refute(
|
|
262
|
+
vpc.shutdown = vpc.default_shutdown
|
|
263
|
+
refute(vpc.shutdown, 'Vpc domain should not be shutdown')
|
|
249
264
|
|
|
250
|
-
|
|
251
|
-
assert(
|
|
265
|
+
vpc.shutdown = true
|
|
266
|
+
assert(vpc.shutdown, 'Vpc domain should be shutdown')
|
|
252
267
|
|
|
253
|
-
|
|
254
|
-
refute(
|
|
268
|
+
vpc.shutdown = false
|
|
269
|
+
refute(vpc.shutdown, 'Vpc domain should not be shutdown')
|
|
255
270
|
end
|
|
256
271
|
|
|
257
272
|
def test_system_mac
|
|
258
|
-
|
|
259
|
-
default_value =
|
|
260
|
-
assert_equal(default_value,
|
|
273
|
+
vpc = Vpc.new(100)
|
|
274
|
+
default_value = vpc.default_system_mac
|
|
275
|
+
assert_equal(default_value, vpc.system_mac,
|
|
261
276
|
"Default system_mac should be #{default_value}")
|
|
262
277
|
|
|
263
|
-
|
|
264
|
-
assert_equal('00:01:00:01:00:01',
|
|
278
|
+
vpc.system_mac = '1.1.1'
|
|
279
|
+
assert_equal('00:01:00:01:00:01', vpc.system_mac,
|
|
265
280
|
'Error: system_mac mismatch')
|
|
266
281
|
end
|
|
267
282
|
|
|
268
283
|
def test_system_priority
|
|
269
|
-
|
|
270
|
-
default_value =
|
|
271
|
-
assert_equal(default_value,
|
|
284
|
+
vpc = Vpc.new(100)
|
|
285
|
+
default_value = vpc.default_system_priority
|
|
286
|
+
assert_equal(default_value, vpc.system_priority,
|
|
272
287
|
"System priority should be #{default_value}")
|
|
273
|
-
|
|
274
|
-
assert_equal(200,
|
|
288
|
+
vpc.system_priority = 200
|
|
289
|
+
assert_equal(200, vpc.system_priority,
|
|
275
290
|
'System priority should be 200')
|
|
276
291
|
end
|
|
277
292
|
|
|
278
293
|
def test_track
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
294
|
+
vpc = Vpc.new(100)
|
|
295
|
+
if validate_property_excluded?('vpc', 'track')
|
|
296
|
+
assert_raises(Cisco::UnsupportedError) { vpc.track = 44 }
|
|
297
|
+
return
|
|
298
|
+
end
|
|
282
299
|
|
|
283
|
-
default_value =
|
|
284
|
-
assert_equal(default_value,
|
|
300
|
+
default_value = vpc.default_track
|
|
301
|
+
assert_equal(default_value, vpc.track,
|
|
285
302
|
'default track should be 0')
|
|
286
303
|
|
|
287
|
-
|
|
288
|
-
assert_equal(44,
|
|
304
|
+
vpc.track = 44
|
|
305
|
+
assert_equal(44, vpc.track, 'track should be 44')
|
|
289
306
|
end
|
|
290
307
|
|
|
308
|
+
##############################################################################
|
|
309
|
+
# Test interface properties for vPC
|
|
310
|
+
#
|
|
291
311
|
def test_interface_vpc_id
|
|
292
|
-
|
|
293
|
-
# test phy port vpc
|
|
294
|
-
interface = Interface.new(interfaces[0])
|
|
295
|
-
assert_equal(interface.vpc_id, interface.default_vpc_id,
|
|
296
|
-
'default vpc_id should be null')
|
|
312
|
+
vpc = Vpc.new(100)
|
|
297
313
|
# Make sure PKA is set
|
|
298
|
-
|
|
299
|
-
|
|
314
|
+
vpc.peer_keepalive_set('1.1.1.2', '1.1.1.1', 3800, 'management', 400, 3,
|
|
315
|
+
6, 3)
|
|
316
|
+
# init channel group as none first, to test phy-port vPC link
|
|
317
|
+
interface = InterfaceChannelGroup.new(interfaces[0])
|
|
318
|
+
interface.channel_group = false if interface.channel_group
|
|
300
319
|
# Phy port vPC is supported only on N7K
|
|
301
320
|
if /N7/ =~ node.product_id
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
321
|
+
phy_port_iflist =
|
|
322
|
+
Feature.compatible_interfaces('vpc', 'phy_port_vpc_module_pids')
|
|
323
|
+
unless phy_port_iflist.empty?
|
|
324
|
+
phy_interface = Interface.new(phy_port_iflist[0])
|
|
325
|
+
assert_equal(phy_interface.vpc_id, phy_interface.default_vpc_id,
|
|
326
|
+
'default vpc_id should be null')
|
|
327
|
+
phy_interface.switchport_mode = :trunk
|
|
328
|
+
phy_interface.vpc_id = 10
|
|
329
|
+
assert_equal(10, phy_interface.vpc_id, 'vpc_id should be 10')
|
|
330
|
+
|
|
331
|
+
# negative - cannot config peer link on this
|
|
332
|
+
e = assert_raises(CliError) do
|
|
333
|
+
phy_interface.vpc_peer_link = true
|
|
334
|
+
end
|
|
335
|
+
assert_match(/Invalid number/i, e.message)
|
|
336
|
+
|
|
337
|
+
# turn off vpc id
|
|
338
|
+
phy_interface.vpc_id = false
|
|
339
|
+
refute(phy_interface.vpc_id, 'vpc_id should be unset')
|
|
309
340
|
end
|
|
310
|
-
assert_match(/Invalid number/i, e.message)
|
|
311
|
-
|
|
312
|
-
# turn off vpc id
|
|
313
|
-
interface.vpc_id = false
|
|
314
|
-
refute(interface.vpc_id, 'vpc_id should be unset')
|
|
315
341
|
end
|
|
316
342
|
# test port-channel vpc
|
|
317
|
-
interface = InterfaceChannelGroup.new(interfaces[0])
|
|
318
343
|
interface.channel_group = 10
|
|
319
344
|
interface_pc = Interface.new('port-channel10')
|
|
320
345
|
interface_pc.switchport_mode = :trunk
|
|
@@ -333,10 +358,10 @@ class TestVpc < CiscoTestCase
|
|
|
333
358
|
end
|
|
334
359
|
|
|
335
360
|
def test_interface_vpc_peer_link
|
|
336
|
-
|
|
361
|
+
vpc = Vpc.new(100)
|
|
337
362
|
# Make sure PKA is set
|
|
338
|
-
|
|
339
|
-
|
|
363
|
+
vpc.peer_keepalive_set('1.1.1.2', '1.1.1.1', 3800, 'management', 400, 3,
|
|
364
|
+
6, 3)
|
|
340
365
|
interface = InterfaceChannelGroup.new(interfaces[1])
|
|
341
366
|
interface.channel_group = 100
|
|
342
367
|
interface_pc = Interface.new('port-channel100')
|
|
@@ -358,4 +383,132 @@ class TestVpc < CiscoTestCase
|
|
|
358
383
|
end
|
|
359
384
|
assert_match(/Invalid/i, e.message)
|
|
360
385
|
end
|
|
386
|
+
|
|
387
|
+
##############################################################################
|
|
388
|
+
# Test vPC+ properties
|
|
389
|
+
#
|
|
390
|
+
|
|
391
|
+
# Some properties require 'feature-set fabricpath', which will process before
|
|
392
|
+
# the property itself; therefore check for unsupported against the feature
|
|
393
|
+
# before attempting the property itself. Returns true if excluded.
|
|
394
|
+
def feature_set_fabricpath_excluded?
|
|
395
|
+
if validate_property_excluded?('fabricpath', 'feature_install')
|
|
396
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
397
|
+
FabricpathGlobal.fabricpath_feature_set(:enabled)
|
|
398
|
+
end
|
|
399
|
+
return true
|
|
400
|
+
end
|
|
401
|
+
false
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
def test_fabricpath_emulated_switch_id
|
|
405
|
+
return if feature_set_fabricpath_excluded?
|
|
406
|
+
vpc = Vpc.new(100)
|
|
407
|
+
if validate_property_excluded?('vpc', 'fabricpath_emulated_switch_id')
|
|
408
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
409
|
+
vpc.fabricpath_emulated_switch_id = false
|
|
410
|
+
end
|
|
411
|
+
return
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
refute(vpc.fabricpath_emulated_switch_id,
|
|
415
|
+
'vPC+ (fabricpath switch-id) should not be enabled by default')
|
|
416
|
+
vpc.fabricpath_emulated_switch_id = 1000
|
|
417
|
+
assert_equal(1000, vpc.fabricpath_emulated_switch_id,
|
|
418
|
+
'fabricpath emulated switch-id/ESWID should be 1000')
|
|
419
|
+
vpc.fabricpath_emulated_switch_id = false
|
|
420
|
+
refute(vpc.fabricpath_emulated_switch_id,
|
|
421
|
+
'vPC+ (fabricpath switch-id) not getting disabled')
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
def test_fabricpath_multicast_load_balance
|
|
425
|
+
vpc = Vpc.new(100)
|
|
426
|
+
return if feature_set_fabricpath_excluded?
|
|
427
|
+
if validate_property_excluded?('vpc', 'fabricpath_multicast_load_balance')
|
|
428
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
429
|
+
vpc.fabricpath_multicast_load_balance = false
|
|
430
|
+
end
|
|
431
|
+
return
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
refute(vpc.fabricpath_multicast_load_balance,
|
|
435
|
+
'fabricpath multicast loadbalance should not be enabled by default')
|
|
436
|
+
|
|
437
|
+
vpc.fabricpath_multicast_load_balance = true
|
|
438
|
+
assert(vpc.fabricpath_multicast_load_balance,
|
|
439
|
+
'fabricpath multicast load-balance is not enabled')
|
|
440
|
+
|
|
441
|
+
vpc.fabricpath_multicast_load_balance = false
|
|
442
|
+
refute(vpc.fabricpath_multicast_load_balance,
|
|
443
|
+
'fabricpath multicast load-balance is not disabled')
|
|
444
|
+
|
|
445
|
+
default = vpc.default_fabricpath_multicast_load_balance
|
|
446
|
+
vpc.fabricpath_multicast_load_balance = default
|
|
447
|
+
assert_equal(default, vpc.fabricpath_multicast_load_balance,
|
|
448
|
+
'fabricpath multicast load-balance is not default')
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
def test_port_channel_limit
|
|
452
|
+
vpc = Vpc.new(100)
|
|
453
|
+
if validate_property_excluded?('vpc', 'port_channel_limit')
|
|
454
|
+
assert_raises(Cisco::UnsupportedError) { vpc.port_channel_limit = true }
|
|
455
|
+
return
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
assert(vpc.port_channel_limit,
|
|
459
|
+
'port_channel_limit should be enabled by default')
|
|
460
|
+
e = assert_raises(RuntimeError) do
|
|
461
|
+
vpc.port_channel_limit = false
|
|
462
|
+
end
|
|
463
|
+
assert_match(/fabricpath_switch_id configuration is required/, e.message)
|
|
464
|
+
vpc.fabricpath_emulated_switch_id = 1000
|
|
465
|
+
vpc.fabricpath_multicast_load_balance = true
|
|
466
|
+
vpc.port_channel_limit = false
|
|
467
|
+
refute(vpc.port_channel_limit,
|
|
468
|
+
'port_channel_limit not getting disabled')
|
|
469
|
+
e = assert_raises(CliError) do
|
|
470
|
+
vpc.fabricpath_multicast_load_balance = false
|
|
471
|
+
end
|
|
472
|
+
assert_match(/ERROR: Configure port-channel limit first/, e.message)
|
|
473
|
+
vpc.port_channel_limit = true
|
|
474
|
+
assert(vpc.port_channel_limit,
|
|
475
|
+
'port_channel_limit not getting re-enabled')
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
def test_interface_vpc_plus_peer_link
|
|
479
|
+
vpc = Vpc.new(100)
|
|
480
|
+
fabricpath_testenv_setup
|
|
481
|
+
if validate_property_excluded?('vpc', 'fabricpath_emulated_switch_id')
|
|
482
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
483
|
+
vpc.fabricpath_emulated_switch_id = true
|
|
484
|
+
end
|
|
485
|
+
return
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
# make it vpc plus by setting a fabricpath switch-id
|
|
489
|
+
vpc.fabricpath_emulated_switch_id = 1000
|
|
490
|
+
# Make sure PKA is set
|
|
491
|
+
vpc.peer_keepalive_set('1.1.1.2', '1.1.1.1', 3800, 'management', 400, 3,
|
|
492
|
+
6, 3)
|
|
493
|
+
interface = InterfaceChannelGroup.new(interfaces[1])
|
|
494
|
+
interface.channel_group = 100
|
|
495
|
+
interface_pc = Interface.new('port-channel100')
|
|
496
|
+
interface_pc.switchport_mode = :fabricpath
|
|
497
|
+
refute(interface_pc.vpc_peer_link,
|
|
498
|
+
'vpc_peer_link should not be set by default')
|
|
499
|
+
interface_pc.vpc_peer_link = true
|
|
500
|
+
assert(interface_pc.vpc_peer_link, 'vpc_peer_link should be set')
|
|
501
|
+
interface_pc.vpc_peer_link = false
|
|
502
|
+
refute(interface_pc.vpc_peer_link, 'vpc_peer_link should not be set')
|
|
503
|
+
# clean up
|
|
504
|
+
interface.channel_group = false
|
|
505
|
+
refute(interface.channel_group, 'channel group should be unset')
|
|
506
|
+
# try with a phy port
|
|
507
|
+
interface = Interface.new(interfaces[1])
|
|
508
|
+
# negative - cannot config peer link on this
|
|
509
|
+
e = assert_raises(CliError) do
|
|
510
|
+
interface.vpc_peer_link = true
|
|
511
|
+
end
|
|
512
|
+
assert_match(/Invalid/i, e.message)
|
|
513
|
+
end
|
|
361
514
|
end
|