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
|
@@ -21,6 +21,8 @@ require File.expand_path('../../lib/cisco_node_utils/radius_server_group', \
|
|
|
21
21
|
|
|
22
22
|
# TestRadiusServerGroup - Minitest for RadiusServerGroup node utility.
|
|
23
23
|
class TestRadiusServerGroup < CiscoTestCase
|
|
24
|
+
@skip_unless_supported = 'radius_server_group'
|
|
25
|
+
|
|
24
26
|
def setup
|
|
25
27
|
# setup runs at the beginning of each test
|
|
26
28
|
super
|
data/tests/test_router_bgp.rb
CHANGED
|
@@ -20,6 +20,46 @@
|
|
|
20
20
|
require_relative 'ciscotest'
|
|
21
21
|
require_relative '../lib/cisco_node_utils/bgp'
|
|
22
22
|
|
|
23
|
+
# Temporary debug helper. Not for production and not to replace Cisco debugging.
|
|
24
|
+
def debug_bgp
|
|
25
|
+
s = @device.cmd('show running-config router bgp')
|
|
26
|
+
caller_locations(1, 1).first.tap do |loc|
|
|
27
|
+
puts "\nDEBUG BGP: #{__FILE__}:#{loc.path}:#{loc.lineno}:\n#{s}"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def create_bgp_vrf(asnum, vrf)
|
|
32
|
+
if platform == :nexus
|
|
33
|
+
bgp = RouterBgp.new(asnum, vrf)
|
|
34
|
+
else
|
|
35
|
+
# IOS XR requires 'rd <id>' for any created VRF.
|
|
36
|
+
# But 'rd' requires a global router id. From a puppet p.o.v
|
|
37
|
+
# this is fine; the user is required to add a router-id to
|
|
38
|
+
# their manifest. For the minitest fudge this by calling
|
|
39
|
+
# RouterBgp.new twice. Once to create the BGP process,
|
|
40
|
+
# add a router-id, then call it again to create the VRF,
|
|
41
|
+
# and add a VRF level router-id (which is needed to make SYSDB
|
|
42
|
+
# behave).
|
|
43
|
+
bgp = RouterBgp.new(asnum)
|
|
44
|
+
bgp.router_id = '1.2.3.4'
|
|
45
|
+
bgp = RouterBgp.new(asnum, vrf)
|
|
46
|
+
bgp.router_id = '4.5.6.7'
|
|
47
|
+
end
|
|
48
|
+
bgp
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def setup_default
|
|
52
|
+
@asnum = 55
|
|
53
|
+
@vrf = 'default'
|
|
54
|
+
RouterBgp.new(@asnum)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def setup_vrf
|
|
58
|
+
@asnum = 99
|
|
59
|
+
@vrf = 'yamllll'
|
|
60
|
+
create_bgp_vrf(@asnum, @vrf)
|
|
61
|
+
end
|
|
62
|
+
|
|
23
63
|
# TestRouterBgp - Minitest for RouterBgp class
|
|
24
64
|
class TestRouterBgp < CiscoTestCase
|
|
25
65
|
@@pre_clean_needed = true # rubocop:disable Style/ClassVars
|
|
@@ -31,12 +71,16 @@ class TestRouterBgp < CiscoTestCase
|
|
|
31
71
|
end
|
|
32
72
|
|
|
33
73
|
def teardown
|
|
34
|
-
super
|
|
35
74
|
remove_all_bgps
|
|
75
|
+
super
|
|
36
76
|
end
|
|
37
77
|
|
|
38
78
|
def get_routerbgp_match_line(as_number, vrf='default')
|
|
39
|
-
|
|
79
|
+
if platform == :ios_xr
|
|
80
|
+
s = @device.cmd('show running-config router bgp')
|
|
81
|
+
else
|
|
82
|
+
s = @device.cmd("show run | section '^router bgp .*'")
|
|
83
|
+
end
|
|
40
84
|
if vrf == 'default'
|
|
41
85
|
line = /router bgp\s#{as_number}/.match(s)
|
|
42
86
|
else
|
|
@@ -46,18 +90,36 @@ class TestRouterBgp < CiscoTestCase
|
|
|
46
90
|
end
|
|
47
91
|
|
|
48
92
|
def test_collection_empty
|
|
49
|
-
|
|
93
|
+
if platform == :ios_xr
|
|
94
|
+
config('no router bgp')
|
|
95
|
+
else
|
|
96
|
+
config('no feature bgp')
|
|
97
|
+
end
|
|
50
98
|
node.cache_flush
|
|
51
99
|
routers = RouterBgp.routers
|
|
52
100
|
assert_empty(routers, 'RouterBgp collection is not empty')
|
|
53
101
|
end
|
|
54
102
|
|
|
55
103
|
def test_collection_not_empty
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
104
|
+
if platform == :nexus
|
|
105
|
+
config('feature bgp',
|
|
106
|
+
'router bgp 55',
|
|
107
|
+
'vrf blue',
|
|
108
|
+
'vrf red',
|
|
109
|
+
'vrf white')
|
|
110
|
+
else
|
|
111
|
+
config('router bgp 55',
|
|
112
|
+
'bgp router-id 1.2.3.4',
|
|
113
|
+
'vrf blue',
|
|
114
|
+
'bgp router-id 4.5.6.7',
|
|
115
|
+
'rd auto',
|
|
116
|
+
'vrf red',
|
|
117
|
+
'bgp router-id 4.5.6.7',
|
|
118
|
+
'rd auto',
|
|
119
|
+
'vrf white',
|
|
120
|
+
'bgp router-id 4.5.6.7',
|
|
121
|
+
'rd auto')
|
|
122
|
+
end
|
|
61
123
|
routers = RouterBgp.routers
|
|
62
124
|
refute_empty(routers, 'RouterBgp collection is empty')
|
|
63
125
|
# validate the collection
|
|
@@ -97,44 +159,75 @@ class TestRouterBgp < CiscoTestCase
|
|
|
97
159
|
end
|
|
98
160
|
|
|
99
161
|
def test_create_valid
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
line
|
|
103
|
-
refute_nil(line, "Error: 'router bgp #{asnum}' not configured")
|
|
162
|
+
bgp = setup_default
|
|
163
|
+
line = get_routerbgp_match_line(@asnum)
|
|
164
|
+
refute_nil(line, "Error: 'router bgp #{@asnum}' not configured")
|
|
104
165
|
bgp.destroy
|
|
105
166
|
|
|
106
167
|
vrf = 'wolfpack'
|
|
107
|
-
bgp =
|
|
108
|
-
line = get_routerbgp_match_line(asnum, vrf)
|
|
109
|
-
refute_nil(line,
|
|
168
|
+
bgp = create_bgp_vrf(55, vrf)
|
|
169
|
+
line = get_routerbgp_match_line(@asnum, vrf)
|
|
170
|
+
refute_nil(line,
|
|
171
|
+
"Error: 'router bgp #{@asnum}' vrf '#{vrf}' not configured")
|
|
110
172
|
bgp.destroy
|
|
111
173
|
end
|
|
112
174
|
|
|
113
|
-
def
|
|
114
|
-
|
|
115
|
-
'65535.0', '65535.65535'].each do |test|
|
|
116
|
-
rtr_bgp = RouterBgp.new(test)
|
|
117
|
-
assert_equal(test.to_s, RouterBgp.routers.keys[0].to_s)
|
|
118
|
-
rtr_bgp.destroy
|
|
175
|
+
def test_process_initialized
|
|
176
|
+
return if validate_property_excluded?('bgp', 'process_initialized')
|
|
119
177
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
178
|
+
# Cleanup may be slow on some platforms; make sure it's really dead
|
|
179
|
+
bgp = RouterBgp.new('55', 'default', false)
|
|
180
|
+
if bgp.process_initialized?
|
|
181
|
+
sleep 4
|
|
182
|
+
node.cache_flush
|
|
183
|
+
end
|
|
184
|
+
refute(bgp.process_initialized?, 'bgp should not be initialized')
|
|
185
|
+
|
|
186
|
+
bgp = RouterBgp.new('55', 'default')
|
|
187
|
+
bgp.wait_for_process_initialized unless bgp.process_initialized?
|
|
188
|
+
assert(bgp.process_initialized?, 'bgp should be initialized')
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def wait_for_process_kill(bgp)
|
|
192
|
+
return unless node.product_id[/N(5|6)/]
|
|
193
|
+
# Hack for slow-start platforms which can also be slow-to-die.
|
|
194
|
+
# Tests that involve many quick process-start / process-stop cycles
|
|
195
|
+
# are prone to failure without this delay.
|
|
196
|
+
4.times do
|
|
197
|
+
return unless bgp.process_initialized?
|
|
198
|
+
sleep 1
|
|
199
|
+
node.cache_flush
|
|
125
200
|
end
|
|
201
|
+
fail "#{bgp} :: process is still running"
|
|
126
202
|
end
|
|
127
203
|
|
|
128
|
-
def
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
204
|
+
def test_valid_asn
|
|
205
|
+
[1, 4_294_967_295, '55', '1.0', '1.65535', '65535.0', '65535.65535'
|
|
206
|
+
].each do |asn|
|
|
207
|
+
b = RouterBgp.new(asn)
|
|
208
|
+
assert_equal(asn.to_s, RouterBgp.routers.keys[0].to_s)
|
|
209
|
+
b.destroy
|
|
210
|
+
wait_for_process_kill(b)
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
def test_destroy
|
|
215
|
+
bgp = setup_default
|
|
216
|
+
line = get_routerbgp_match_line(@asnum)
|
|
217
|
+
refute_nil(line, "Error: 'router bgp #{@asnum}' not configured")
|
|
133
218
|
bgp.destroy
|
|
134
219
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
220
|
+
if platform == :ios_xr
|
|
221
|
+
command = 'show run router bgp'
|
|
222
|
+
pattern = /"router bgp"/
|
|
223
|
+
else
|
|
224
|
+
command = 'show run all | no-more'
|
|
225
|
+
pattern = /"feature bgp"/
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
refute_show_match(
|
|
229
|
+
command: command, pattern: pattern,
|
|
230
|
+
msg: "Error: 'router bgp' still configured")
|
|
138
231
|
end
|
|
139
232
|
|
|
140
233
|
def test_create_invalid_multiple
|
|
@@ -148,7 +241,6 @@ class TestRouterBgp < CiscoTestCase
|
|
|
148
241
|
bgp2 = RouterBgp.new(88)
|
|
149
242
|
bgp2.destroy unless bgp2.nil?
|
|
150
243
|
end
|
|
151
|
-
|
|
152
244
|
bgp1.destroy
|
|
153
245
|
end
|
|
154
246
|
|
|
@@ -163,104 +255,147 @@ class TestRouterBgp < CiscoTestCase
|
|
|
163
255
|
end
|
|
164
256
|
end
|
|
165
257
|
|
|
166
|
-
def
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
bgp.destroy
|
|
170
|
-
line = get_routerbgp_match_line(asnum)
|
|
171
|
-
assert_nil(line, "Error: 'router bgp #{asnum}' not destroyed")
|
|
258
|
+
def test_nsr
|
|
259
|
+
nsr(setup_default)
|
|
260
|
+
nsr(setup_vrf)
|
|
172
261
|
end
|
|
173
262
|
|
|
174
|
-
def
|
|
175
|
-
|
|
176
|
-
if
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
bgp
|
|
263
|
+
def nsr(bgp)
|
|
264
|
+
if (platform == :nexus) || (platform == :ios_xr && !@vrf[/default/])
|
|
265
|
+
if platform == :nexus
|
|
266
|
+
assert_nil(bgp.default_nsr,
|
|
267
|
+
'default bgp nsr should be nil on Nexus')
|
|
268
|
+
assert_nil(bgp.nsr,
|
|
269
|
+
'bgp nsr should be nil on Nexus')
|
|
180
270
|
else
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
bgp.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
271
|
+
assert_nil(bgp.default_nsr,
|
|
272
|
+
'default bgp nsr should return nil on XR with non-default' \
|
|
273
|
+
' vrf')
|
|
274
|
+
assert_nil(bgp.nsr,
|
|
275
|
+
'bgp nsr should return nil on XR with non-default vrf')
|
|
276
|
+
end
|
|
277
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
278
|
+
bgp.nsr = true
|
|
279
|
+
end
|
|
280
|
+
else
|
|
281
|
+
assert_equal(bgp.nsr, bgp.default_nsr)
|
|
282
|
+
bgp.nsr = true
|
|
283
|
+
assert(bgp.nsr,
|
|
284
|
+
'bgp nsr should be enabled')
|
|
285
|
+
bgp.nsr = false
|
|
286
|
+
refute(bgp.nsr,
|
|
287
|
+
'bgp nsr should be disabled')
|
|
288
|
+
end
|
|
289
|
+
bgp.destroy
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
def test_bestpath_default
|
|
293
|
+
bestpath(setup_default)
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
def test_bestpath_vrf
|
|
297
|
+
bestpath(setup_vrf)
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def bestpath(bgp)
|
|
301
|
+
bgp.bestpath_always_compare_med = true
|
|
302
|
+
assert(bgp.bestpath_always_compare_med,
|
|
303
|
+
'bgp bestpath_always_compare_med should be enabled')
|
|
304
|
+
bgp.bestpath_aspath_multipath_relax = true
|
|
305
|
+
assert(bgp.bestpath_aspath_multipath_relax,
|
|
306
|
+
'bgp bestpath_aspath_multipath_relax should be enabled')
|
|
307
|
+
bgp.bestpath_compare_routerid = true
|
|
308
|
+
assert(bgp.bestpath_compare_routerid,
|
|
309
|
+
'bgp bestpath_compare_routerid should be enabled')
|
|
310
|
+
bgp.bestpath_cost_community_ignore = true
|
|
311
|
+
assert(bgp.bestpath_cost_community_ignore,
|
|
312
|
+
'bgp bestpath_cost_community_ignore should be enabled')
|
|
313
|
+
if platform == :ios_xr && !@vrf[/default/]
|
|
314
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
315
|
+
bgp.bestpath_med_confed = true
|
|
316
|
+
end
|
|
317
|
+
else
|
|
197
318
|
bgp.bestpath_med_confed = true
|
|
198
|
-
assert(bgp.bestpath_med_confed,
|
|
319
|
+
assert(bgp.bestpath_med_confed,
|
|
199
320
|
'bgp bestpath_med_confed should be enabled')
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
321
|
+
end
|
|
322
|
+
bgp.bestpath_med_missing_as_worst = true
|
|
323
|
+
assert(bgp.bestpath_med_missing_as_worst,
|
|
324
|
+
'bgp bestpath_med_missing_as_worst should be enabled')
|
|
325
|
+
if platform == :nexus
|
|
203
326
|
bgp.bestpath_med_non_deterministic = true
|
|
204
|
-
assert(bgp.bestpath_med_non_deterministic,
|
|
327
|
+
assert(bgp.bestpath_med_non_deterministic,
|
|
205
328
|
'bgp bestpath_med_non_deterministic should be enabled')
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
329
|
+
else
|
|
330
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
331
|
+
bgp.bestpath_med_non_deterministic = true
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
bgp.bestpath_always_compare_med = false
|
|
335
|
+
refute(bgp.bestpath_always_compare_med,
|
|
336
|
+
'bgp bestpath_always_compare_med should be disabled')
|
|
337
|
+
bgp.bestpath_aspath_multipath_relax = false
|
|
338
|
+
refute(bgp.bestpath_aspath_multipath_relax,
|
|
339
|
+
'bgp bestpath_aspath_multipath_relax should be disabled')
|
|
340
|
+
bgp.bestpath_compare_routerid = false
|
|
341
|
+
refute(bgp.bestpath_compare_routerid,
|
|
342
|
+
'bgp bestpath_compare_routerid should be disabled')
|
|
343
|
+
bgp.bestpath_cost_community_ignore = false
|
|
344
|
+
refute(bgp.bestpath_cost_community_ignore,
|
|
345
|
+
'bgp bestpath_cost_community_ignore should be disabled')
|
|
346
|
+
unless platform == :ios_xr && !@vrf[/default/]
|
|
219
347
|
bgp.bestpath_med_confed = false
|
|
220
|
-
refute(bgp.bestpath_med_confed,
|
|
348
|
+
refute(bgp.bestpath_med_confed,
|
|
221
349
|
'bgp bestpath_med_confed should be disabled')
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
350
|
+
end
|
|
351
|
+
bgp.bestpath_med_missing_as_worst = false
|
|
352
|
+
refute(bgp.bestpath_med_missing_as_worst,
|
|
353
|
+
'bgp bestpath_med_missing_as_worst should be disabled')
|
|
354
|
+
if platform == :nexus
|
|
225
355
|
bgp.bestpath_med_non_deterministic = false
|
|
226
|
-
refute(bgp.bestpath_med_non_deterministic,
|
|
356
|
+
refute(bgp.bestpath_med_non_deterministic,
|
|
227
357
|
'bgp bestpath_med_non_deterministic should be disabled')
|
|
228
|
-
|
|
358
|
+
else
|
|
359
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
360
|
+
bgp.bestpath_med_non_deterministic = false
|
|
361
|
+
end
|
|
229
362
|
end
|
|
363
|
+
bgp.destroy
|
|
230
364
|
end
|
|
231
365
|
|
|
232
|
-
def
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
refute(bgp.bestpath_med_non_deterministic, "vrf #{vrf}: "\
|
|
366
|
+
def test_bestpath_not_configured_default
|
|
367
|
+
bestpath_not_configured(setup_default)
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
def test_bestpath_not_configured_vrf
|
|
371
|
+
bestpath_not_configured(setup_vrf)
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def bestpath_not_configured(bgp)
|
|
375
|
+
refute(bgp.bestpath_always_compare_med,
|
|
376
|
+
'bgp bestpath_always_compare_med should *NOT* be enabled')
|
|
377
|
+
refute(bgp.bestpath_aspath_multipath_relax,
|
|
378
|
+
'bgp bestpath_aspath_multipath_relax should *NOT* be enabled')
|
|
379
|
+
refute(bgp.bestpath_compare_routerid,
|
|
380
|
+
'bgp bestpath_compare_routerid should be *NOT* enabled')
|
|
381
|
+
refute(bgp.bestpath_cost_community_ignore,
|
|
382
|
+
'bgp bestpath_cost_community_ignore should *NOT* be enabled')
|
|
383
|
+
refute(bgp.bestpath_med_confed,
|
|
384
|
+
'bgp bestpath_med_confed should *NOT* be enabled')
|
|
385
|
+
refute(bgp.bestpath_med_missing_as_worst,
|
|
386
|
+
'bgp bestpath_med_missing_as_worst should *NOT* be enabled')
|
|
387
|
+
if platform == :nexus
|
|
388
|
+
refute(bgp.bestpath_med_non_deterministic,
|
|
256
389
|
'bgp bestpath_med_non_deterministic should *NOT* be enabled')
|
|
257
|
-
|
|
390
|
+
else
|
|
391
|
+
assert_nil(bgp.bestpath_med_non_deterministic,
|
|
392
|
+
'bgp bestpath_med_non_deterministic should *NOT* be supported')
|
|
258
393
|
end
|
|
394
|
+
bgp.destroy
|
|
259
395
|
end
|
|
260
396
|
|
|
261
397
|
def test_default_bestpath
|
|
262
|
-
|
|
263
|
-
bgp = RouterBgp.new(asnum)
|
|
398
|
+
bgp = setup_default
|
|
264
399
|
refute(bgp.default_bestpath_always_compare_med,
|
|
265
400
|
'default value for bestpath_always_compare_med should be false')
|
|
266
401
|
refute(bgp.default_bestpath_aspath_multipath_relax,
|
|
@@ -273,136 +408,191 @@ class TestRouterBgp < CiscoTestCase
|
|
|
273
408
|
'default value for bestpath_med_confed should be false')
|
|
274
409
|
refute(bgp.default_bestpath_med_missing_as_worst,
|
|
275
410
|
'default value for bestpath_med_missing_as_worst should be false')
|
|
276
|
-
|
|
277
|
-
|
|
411
|
+
if platform == :nexus
|
|
412
|
+
refute(bgp.default_bestpath_med_non_deterministic,
|
|
413
|
+
'default value for bestpath_med_non_deterministic should be false')
|
|
414
|
+
else
|
|
415
|
+
assert_nil(bgp.default_bestpath_med_non_deterministic,
|
|
416
|
+
'bgp default_bestpath_med_non_deterministic should ' \
|
|
417
|
+
'*NOT* be supported')
|
|
418
|
+
end
|
|
278
419
|
bgp.destroy
|
|
279
420
|
end
|
|
280
421
|
|
|
281
|
-
def
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
bgp.cluster_id
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
"vrf #{vrf}: bgp cluster_id should be set to '1.2.3.4'")
|
|
298
|
-
bgp.cluster_id = ''
|
|
299
|
-
assert_empty(bgp.cluster_id,
|
|
300
|
-
"vrf #{vrf}: bgp cluster_id should *NOT* be configured")
|
|
422
|
+
def test_cluster_id_default
|
|
423
|
+
cluster_id(setup_default)
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
def test_cluster_id_vrf
|
|
427
|
+
cluster_id(setup_vrf)
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
def cluster_id(bgp)
|
|
431
|
+
if platform == :ios_xr && @vrf != 'default'
|
|
432
|
+
# XR does not support this under a VRF, so test the getter and setter
|
|
433
|
+
assert_nil(bgp.cluster_id,
|
|
434
|
+
'cluster_id should return nil on XR with non-default vrf')
|
|
435
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
436
|
+
bgp.cluster_id = 34
|
|
437
|
+
end
|
|
301
438
|
bgp.destroy
|
|
439
|
+
return
|
|
302
440
|
end
|
|
441
|
+
bgp.cluster_id = 34
|
|
442
|
+
assert_equal('34', bgp.cluster_id,
|
|
443
|
+
"bgp cluster_id should be set to '34'")
|
|
444
|
+
bgp.cluster_id = '1.2.3.4'
|
|
445
|
+
assert_equal('1.2.3.4', bgp.cluster_id,
|
|
446
|
+
"bgp cluster_id should be set to '1.2.3.4'")
|
|
447
|
+
bgp.cluster_id = ''
|
|
448
|
+
assert_empty(bgp.cluster_id,
|
|
449
|
+
'bgp cluster_id should *NOT* be configured')
|
|
450
|
+
bgp.destroy
|
|
303
451
|
end
|
|
304
452
|
|
|
305
453
|
def test_cluster_id_not_configured
|
|
306
|
-
|
|
307
|
-
bgp = RouterBgp.new(asnum)
|
|
454
|
+
bgp = setup_default
|
|
308
455
|
assert_empty(bgp.cluster_id,
|
|
309
456
|
'bgp cluster_id should *NOT* be configured')
|
|
310
457
|
bgp.destroy
|
|
311
458
|
end
|
|
312
459
|
|
|
313
460
|
def test_default_cluster_id
|
|
314
|
-
|
|
315
|
-
bgp = RouterBgp.new(asnum)
|
|
461
|
+
bgp = setup_default
|
|
316
462
|
assert_empty(bgp.default_cluster_id,
|
|
317
463
|
'bgp cluster_id default value should be empty')
|
|
318
464
|
bgp.destroy
|
|
319
465
|
end
|
|
320
466
|
|
|
321
467
|
def test_disable_policy_batching
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
468
|
+
bgp = setup_default
|
|
469
|
+
if platform == :ios_xr
|
|
470
|
+
assert_nil(bgp.disable_policy_batching)
|
|
471
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
472
|
+
bgp.disable_policy_batching = true
|
|
473
|
+
end
|
|
474
|
+
else
|
|
475
|
+
bgp.disable_policy_batching = true
|
|
476
|
+
assert(bgp.disable_policy_batching,
|
|
477
|
+
'bgp disable-policy-batching should be enabled')
|
|
478
|
+
bgp.disable_policy_batching = false
|
|
479
|
+
refute(bgp.disable_policy_batching,
|
|
480
|
+
'bgp disable-policy-batching should be disabled')
|
|
481
|
+
end
|
|
330
482
|
bgp.destroy
|
|
331
483
|
end
|
|
332
484
|
|
|
333
485
|
def test_default_disable_policy_batching
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
486
|
+
bgp = setup_default
|
|
487
|
+
if platform == :ios_xr
|
|
488
|
+
assert_nil(bgp.disable_policy_batching)
|
|
489
|
+
assert_nil(bgp.default_disable_policy_batching)
|
|
490
|
+
else
|
|
491
|
+
refute(bgp.disable_policy_batching,
|
|
492
|
+
'bgp disable-policy-batching value should be false')
|
|
493
|
+
end
|
|
338
494
|
bgp.destroy
|
|
339
495
|
end
|
|
340
496
|
|
|
341
497
|
def test_disable_policy_batching_ipv4
|
|
342
|
-
|
|
498
|
+
if platform == :ios_xr || node.product_id[/N(5|6|7)/]
|
|
499
|
+
b = RouterBgp.new(1)
|
|
500
|
+
assert_nil(b.disable_policy_batching_ipv4)
|
|
501
|
+
assert_nil(b.default_disable_policy_batching_ipv4)
|
|
502
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
503
|
+
b.disable_policy_batching_ipv4 = 'xx'
|
|
504
|
+
end
|
|
505
|
+
return
|
|
506
|
+
end
|
|
507
|
+
bgp = setup_default
|
|
508
|
+
default = bgp.default_disable_policy_batching_ipv4
|
|
509
|
+
assert_equal(default, bgp.disable_policy_batching_ipv4,
|
|
510
|
+
'bgp disable_policy_batching_ipv4 not set to default')
|
|
511
|
+
|
|
343
512
|
bgp.disable_policy_batching_ipv4 = 'xx'
|
|
344
513
|
assert_equal('xx', bgp.disable_policy_batching_ipv4,
|
|
345
514
|
"bgp disable_policy_batching_ipv4 should be set to 'xx'")
|
|
346
|
-
bgp.disable_policy_batching_ipv4 =
|
|
515
|
+
bgp.disable_policy_batching_ipv4 = \
|
|
516
|
+
bgp.default_disable_policy_batching_ipv4
|
|
347
517
|
assert_empty(bgp.disable_policy_batching_ipv4,
|
|
348
518
|
'bgp disable_policy_batching_ipv4 should be empty')
|
|
349
|
-
bgp.destroy
|
|
350
|
-
end
|
|
351
519
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
assert_equal(bgp.default_disable_policy_batching_ipv4,
|
|
356
|
-
bgp.disable_policy_batching_ipv4,
|
|
357
|
-
'disable_policy_batching_ipv4 default value should be empty')
|
|
520
|
+
bgp.disable_policy_batching_ipv4 = default
|
|
521
|
+
assert_equal(default, bgp.disable_policy_batching_ipv4,
|
|
522
|
+
'bgp disable_policy_batching_ipv4 not set to default')
|
|
358
523
|
bgp.destroy
|
|
359
524
|
end
|
|
360
525
|
|
|
361
526
|
def test_disable_policy_batching_ipv6
|
|
362
|
-
|
|
527
|
+
if platform == :ios_xr || node.product_id[/N(5|6|7)/]
|
|
528
|
+
b = RouterBgp.new(1)
|
|
529
|
+
assert_nil(b.disable_policy_batching_ipv6)
|
|
530
|
+
assert_nil(b.default_disable_policy_batching_ipv6)
|
|
531
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
532
|
+
b.disable_policy_batching_ipv6 = 'xx'
|
|
533
|
+
end
|
|
534
|
+
return
|
|
535
|
+
end
|
|
536
|
+
bgp = setup_default
|
|
537
|
+
default = bgp.default_disable_policy_batching_ipv6
|
|
538
|
+
assert_equal(default, bgp.disable_policy_batching_ipv6,
|
|
539
|
+
'bgp disable_policy_batching_ipv6 not set to default')
|
|
540
|
+
|
|
363
541
|
bgp.disable_policy_batching_ipv6 = 'xx'
|
|
364
542
|
assert_equal('xx', bgp.disable_policy_batching_ipv6,
|
|
365
543
|
"bgp disable_policy_batching_ipv6 should be set to 'xx'")
|
|
366
|
-
bgp.disable_policy_batching_ipv6 =
|
|
544
|
+
bgp.disable_policy_batching_ipv6 = \
|
|
545
|
+
bgp.default_disable_policy_batching_ipv6
|
|
367
546
|
assert_empty(bgp.disable_policy_batching_ipv6,
|
|
368
547
|
'bgp disable_policy_batching_ipv6 should be empty')
|
|
369
|
-
bgp.destroy
|
|
370
|
-
end
|
|
371
548
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
assert_equal(bgp.default_disable_policy_batching_ipv6,
|
|
376
|
-
bgp.disable_policy_batching_ipv6,
|
|
377
|
-
'disable_policy_batching_ipv6 default value should be empty')
|
|
549
|
+
bgp.disable_policy_batching_ipv6 = default
|
|
550
|
+
assert_equal(default, bgp.disable_policy_batching_ipv6,
|
|
551
|
+
'bgp disable_policy_batching_ipv6 not set to default')
|
|
378
552
|
bgp.destroy
|
|
379
553
|
end
|
|
380
554
|
|
|
381
555
|
def test_enforce_first_as
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
556
|
+
bgp = setup_default
|
|
557
|
+
if platform == :ios_xr
|
|
558
|
+
@default_show_command = 'show running-config router bgp 55'
|
|
559
|
+
@default_output_pattern = /bgp enforce-first-as disable/
|
|
560
|
+
else
|
|
561
|
+
@default_show_command = 'show run bgp all'
|
|
562
|
+
@default_output_pattern = /no enforce-first-as/
|
|
563
|
+
end
|
|
387
564
|
bgp.enforce_first_as = false
|
|
388
|
-
refute(bgp.enforce_first_as
|
|
389
|
-
|
|
565
|
+
refute(bgp.enforce_first_as)
|
|
566
|
+
assert_show_match(msg: 'enforce-first-as should be disabled')
|
|
567
|
+
|
|
568
|
+
bgp.enforce_first_as = true
|
|
569
|
+
assert(bgp.enforce_first_as)
|
|
570
|
+
refute_show_match(msg: 'enforce-first-as should be enabled')
|
|
571
|
+
|
|
390
572
|
bgp.destroy
|
|
391
573
|
end
|
|
392
574
|
|
|
393
575
|
def test_default_enforce_first_as
|
|
394
|
-
|
|
395
|
-
bgp
|
|
396
|
-
|
|
397
|
-
|
|
576
|
+
bgp = setup_default
|
|
577
|
+
assert_equal(bgp.default_enforce_first_as,
|
|
578
|
+
bgp.enforce_first_as,
|
|
579
|
+
'bgp enforce-first-as default value is incorrect')
|
|
398
580
|
bgp.destroy
|
|
399
581
|
end
|
|
400
582
|
|
|
401
583
|
def test_event_history
|
|
402
|
-
bgp =
|
|
584
|
+
bgp = setup_default
|
|
403
585
|
|
|
404
586
|
opts = [:cli, :detail, :events, :periodic]
|
|
405
587
|
opts.each do |opt|
|
|
588
|
+
if platform == :ios_xr # unsupported on XR
|
|
589
|
+
assert_equal(nil, bgp.send("event_history_#{opt}"))
|
|
590
|
+
assert_equal(nil, bgp.send("default_event_history_#{opt}"))
|
|
591
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
592
|
+
bgp.send("event_history_#{opt}=", 'true')
|
|
593
|
+
end
|
|
594
|
+
next
|
|
595
|
+
end
|
|
406
596
|
# Test basic true
|
|
407
597
|
bgp.send("event_history_#{opt}=", 'true')
|
|
408
598
|
set = bgp.send("default_event_history_#{opt}")
|
|
@@ -440,8 +630,7 @@ class TestRouterBgp < CiscoTestCase
|
|
|
440
630
|
end
|
|
441
631
|
|
|
442
632
|
def test_fast_external_fallover
|
|
443
|
-
|
|
444
|
-
bgp = RouterBgp.new(asnum)
|
|
633
|
+
bgp = setup_default
|
|
445
634
|
bgp.fast_external_fallover = true
|
|
446
635
|
assert(bgp.fast_external_fallover,
|
|
447
636
|
'bgp fast-external-fallover should be enabled')
|
|
@@ -452,334 +641,444 @@ class TestRouterBgp < CiscoTestCase
|
|
|
452
641
|
end
|
|
453
642
|
|
|
454
643
|
def test_default_fast_external_fallover
|
|
455
|
-
|
|
456
|
-
bgp = RouterBgp.new(asnum)
|
|
644
|
+
bgp = setup_default
|
|
457
645
|
assert(bgp.fast_external_fallover,
|
|
458
646
|
'bgp fast-external-fallover default value should be true')
|
|
459
647
|
bgp.destroy
|
|
460
648
|
end
|
|
461
649
|
|
|
462
650
|
def test_flush_routes
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
651
|
+
bgp = setup_default
|
|
652
|
+
if platform == :ios_xr
|
|
653
|
+
assert_nil(bgp.flush_routes)
|
|
654
|
+
assert_raises(UnsupportedError) { bgp.flush_routes = true }
|
|
655
|
+
else
|
|
656
|
+
bgp.flush_routes = true
|
|
657
|
+
assert(bgp.flush_routes,
|
|
658
|
+
'bgp flush-routes should be enabled')
|
|
659
|
+
bgp.flush_routes = false
|
|
660
|
+
refute(bgp.flush_routes,
|
|
661
|
+
'bgp flush-routes should be disabled')
|
|
662
|
+
end
|
|
471
663
|
bgp.destroy
|
|
472
664
|
end
|
|
473
665
|
|
|
474
666
|
def test_default_flush_routes
|
|
475
|
-
|
|
476
|
-
bgp = RouterBgp.new(asnum)
|
|
667
|
+
bgp = setup_default
|
|
477
668
|
refute(bgp.flush_routes,
|
|
478
669
|
'bgp flush-routes value default value should be false')
|
|
479
670
|
bgp.destroy
|
|
480
671
|
end
|
|
481
672
|
|
|
482
|
-
def
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
bgp.graceful_restart
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
bgp.
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
673
|
+
def test_graceful_restart_default
|
|
674
|
+
graceful_restart(setup_default)
|
|
675
|
+
end
|
|
676
|
+
|
|
677
|
+
def test_graceful_restart_vrf
|
|
678
|
+
graceful_restart(setup_vrf)
|
|
679
|
+
end
|
|
680
|
+
|
|
681
|
+
def graceful_restart(bgp)
|
|
682
|
+
if platform == :ios_xr && @vrf != 'default'
|
|
683
|
+
# XR does not support this under a VRF, so test the getter and setter
|
|
684
|
+
assert_nil(bgp.graceful_restart,
|
|
685
|
+
'graceful_restart should return nil on XR with ' \
|
|
686
|
+
'non-default vrf')
|
|
687
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
688
|
+
bgp.graceful_restart = true
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
assert_nil(bgp.graceful_restart_timers_restart,
|
|
692
|
+
'graceful_restart_timers_restart should return nil on XR ' \
|
|
693
|
+
'with non-default vrf')
|
|
694
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
695
|
+
bgp.graceful_restart_timers_restart = 55
|
|
696
|
+
end
|
|
697
|
+
|
|
698
|
+
assert_nil(bgp.graceful_restart_timers_stalepath_time,
|
|
699
|
+
'graceful_restart_timers_stalepath_time should return nil ' \
|
|
700
|
+
'on XR with non-default vrf')
|
|
701
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
702
|
+
bgp.graceful_restart_timers_stalepath_time = 77
|
|
703
|
+
end
|
|
704
|
+
bgp.destroy
|
|
705
|
+
return
|
|
706
|
+
end
|
|
707
|
+
bgp.graceful_restart = true
|
|
708
|
+
assert(bgp.graceful_restart,
|
|
709
|
+
'bgp graceful restart should be enabled')
|
|
710
|
+
bgp.graceful_restart_timers_restart = 55
|
|
711
|
+
assert_equal(55, bgp.graceful_restart_timers_restart,
|
|
712
|
+
'bgp graceful restart timers restart' \
|
|
713
|
+
"should be set to '55'")
|
|
714
|
+
bgp.graceful_restart_timers_stalepath_time = 77
|
|
715
|
+
assert_equal(77, bgp.graceful_restart_timers_stalepath_time,
|
|
716
|
+
'bgp graceful restart timers stalepath time' \
|
|
717
|
+
"should be set to '77'")
|
|
718
|
+
if platform == :nexus
|
|
504
719
|
bgp.graceful_restart_helper = true
|
|
505
720
|
assert(bgp.graceful_restart_helper,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
721
|
+
'bgp graceful restart helper should be enabled')
|
|
722
|
+
else
|
|
723
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
724
|
+
bgp.graceful_restart_helper = true
|
|
725
|
+
end
|
|
726
|
+
end
|
|
727
|
+
bgp.graceful_restart = false
|
|
728
|
+
refute(bgp.graceful_restart,
|
|
729
|
+
'bgp graceful_restart should be disabled')
|
|
730
|
+
bgp.graceful_restart_timers_restart = 120
|
|
731
|
+
assert_equal(120, bgp.graceful_restart_timers_restart,
|
|
732
|
+
'bgp graceful restart timers restart' \
|
|
733
|
+
"should be set to default value of '120'")
|
|
734
|
+
bgp.graceful_restart_timers_stalepath_time = 300
|
|
735
|
+
assert_equal(300, bgp.graceful_restart_timers_stalepath_time,
|
|
736
|
+
'bgp graceful restart timers stalepath time' \
|
|
737
|
+
"should be set to default value of '300'")
|
|
738
|
+
if platform == :nexus
|
|
519
739
|
bgp.graceful_restart_helper = false
|
|
520
740
|
refute(bgp.graceful_restart_helper,
|
|
521
|
-
|
|
522
|
-
|
|
741
|
+
'bgp graceful restart helper should be disabled')
|
|
742
|
+
else
|
|
743
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
744
|
+
bgp.graceful_restart_helper = false
|
|
745
|
+
end
|
|
523
746
|
end
|
|
747
|
+
bgp.destroy
|
|
524
748
|
end
|
|
525
749
|
|
|
526
750
|
def test_default_graceful_restart
|
|
527
|
-
|
|
528
|
-
bgp = RouterBgp.new(asnum)
|
|
751
|
+
bgp = setup_default
|
|
529
752
|
assert(bgp.default_graceful_restart,
|
|
530
753
|
'bgp graceful restart default value should be enabled = true')
|
|
531
754
|
assert_equal(120, bgp.default_graceful_restart_timers_restart,
|
|
532
755
|
"bgp graceful restart default timer value should be '120'")
|
|
533
756
|
assert_equal(300, bgp.default_graceful_restart_timers_stalepath_time,
|
|
534
757
|
"bgp graceful restart default timer value should be '300'")
|
|
535
|
-
|
|
536
|
-
|
|
758
|
+
if platform == :nexus
|
|
759
|
+
refute(bgp.default_graceful_restart_helper,
|
|
760
|
+
'graceful restart helper default value ' \
|
|
761
|
+
'should be enabled = false')
|
|
762
|
+
else
|
|
763
|
+
assert_nil(bgp.default_graceful_restart_helper,
|
|
764
|
+
'bgp default_graceful_restart_helper should ' \
|
|
765
|
+
'*NOT* be supported')
|
|
766
|
+
end
|
|
767
|
+
bgp.destroy
|
|
537
768
|
end
|
|
538
769
|
|
|
539
|
-
def
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
bgp.confederation_id
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
770
|
+
def test_confederation_id_default
|
|
771
|
+
confederation_id(setup_default)
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
def test_confederation_id_vrf
|
|
775
|
+
confederation_id(setup_vrf)
|
|
776
|
+
end
|
|
777
|
+
|
|
778
|
+
def confederation_id(bgp)
|
|
779
|
+
if platform == :ios_xr && @vrf != 'default'
|
|
780
|
+
# XR does not support this under a VRF, so test the getter and setter
|
|
781
|
+
assert_nil(bgp.confederation_id,
|
|
782
|
+
'confederation_id should return nil on XR with ' \
|
|
783
|
+
'non-default vrf')
|
|
784
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
785
|
+
bgp.confederation_id = 77
|
|
786
|
+
end
|
|
556
787
|
bgp.destroy
|
|
788
|
+
return
|
|
557
789
|
end
|
|
790
|
+
bgp.confederation_id = 77
|
|
791
|
+
assert_equal('77', bgp.confederation_id,
|
|
792
|
+
"bgp confederation_id should be set to '77'")
|
|
793
|
+
bgp.confederation_id = ''
|
|
794
|
+
assert_empty(bgp.confederation_id, '' \
|
|
795
|
+
'bgp confederation_id should *NOT* be configured')
|
|
796
|
+
bgp.destroy
|
|
558
797
|
end
|
|
559
798
|
|
|
560
799
|
def test_confed_id_uu76828
|
|
561
|
-
|
|
562
|
-
bgp = RouterBgp.new(asnum)
|
|
800
|
+
bgp = setup_default
|
|
563
801
|
bgp.confederation_id = 55.77
|
|
564
802
|
assert_equal('55.77', bgp.confederation_id,
|
|
565
803
|
"bgp confederation_id should be set to '55.77'")
|
|
804
|
+
bgp.destroy
|
|
566
805
|
end
|
|
567
806
|
|
|
568
807
|
def test_confederation_id_not_configured
|
|
569
|
-
|
|
570
|
-
bgp = RouterBgp.new(asnum)
|
|
808
|
+
bgp = setup_default
|
|
571
809
|
assert_empty(bgp.confederation_id,
|
|
572
810
|
'bgp confederation_id should *NOT* be configured')
|
|
573
811
|
bgp.destroy
|
|
574
812
|
end
|
|
575
813
|
|
|
576
814
|
def test_default_confederation_id
|
|
577
|
-
|
|
578
|
-
bgp = RouterBgp.new(asnum)
|
|
815
|
+
bgp = setup_default
|
|
579
816
|
assert_empty(bgp.default_confederation_id,
|
|
580
817
|
'bgp confederation_id default value should be empty')
|
|
581
818
|
bgp.destroy
|
|
582
819
|
end
|
|
583
820
|
|
|
584
|
-
def
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
#
|
|
598
|
-
bgp.
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
bgp.confederation_peers_set(16)
|
|
605
|
-
assert_equal('16', bgp.confederation_peers,
|
|
606
|
-
"vrf #{vrf}: bgp confederation_peers list should be '16'")
|
|
607
|
-
bgp.confederation_peers_set(55.77)
|
|
608
|
-
assert_equal('55.77', bgp.confederation_peers,
|
|
609
|
-
"vrf #{vrf}: bgp confederation_peers list should be" \
|
|
610
|
-
"'55.77'")
|
|
611
|
-
bgp.confederation_peers_set('15 16 55.77 18 555 299')
|
|
612
|
-
assert_equal('15 16 55.77 18 555 299',
|
|
613
|
-
bgp.confederation_peers,
|
|
614
|
-
"vrf #{vrf}: bgp confederation_peers list should be" \
|
|
615
|
-
"'15 16 55.77 18 555 299'")
|
|
616
|
-
bgp.confederation_peers_set('')
|
|
617
|
-
assert_empty(bgp.confederation_peers,
|
|
618
|
-
"vrf #{vrf}: bgp confederation_peers list should be empty")
|
|
821
|
+
def test_confederation_peers_default
|
|
822
|
+
confed_peers_test(setup_default)
|
|
823
|
+
end
|
|
824
|
+
|
|
825
|
+
def test_confederation_peers_vrf
|
|
826
|
+
confed_peers_test(setup_vrf)
|
|
827
|
+
end
|
|
828
|
+
|
|
829
|
+
def confed_peers_test(bgp)
|
|
830
|
+
# Confederation peer configuration requires that a
|
|
831
|
+
# confederation id be configured first so the expectation
|
|
832
|
+
# in the next test is an empty peer list
|
|
833
|
+
if platform == :ios_xr && @vrf != 'default'
|
|
834
|
+
# XR does not support this under a VRF, so test the getter and setter
|
|
835
|
+
assert_nil(bgp.confederation_peers,
|
|
836
|
+
'confederation_peers should return nil on XR ' \
|
|
837
|
+
'with non-default vrf')
|
|
838
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
839
|
+
bgp.confederation_peers = ['15', '55.77', '16', '18', '555', '299']
|
|
840
|
+
end
|
|
619
841
|
bgp.destroy
|
|
842
|
+
return
|
|
620
843
|
end
|
|
844
|
+
bgp.confederation_id = 55
|
|
845
|
+
|
|
846
|
+
assert_empty(bgp.confederation_peers,
|
|
847
|
+
'bgp confederation_peers list should be empty')
|
|
848
|
+
bgp.confederation_peers = [15]
|
|
849
|
+
assert_equal(['15'], bgp.confederation_peers,
|
|
850
|
+
"bgp confederation_peers list should be ['15']")
|
|
851
|
+
bgp.confederation_peers = [16]
|
|
852
|
+
assert_equal(['16'], bgp.confederation_peers,
|
|
853
|
+
"bgp confederation_peers list should be ['16']")
|
|
854
|
+
bgp.confederation_peers = [55.77]
|
|
855
|
+
assert_equal(['55.77'], bgp.confederation_peers,
|
|
856
|
+
'bgp confederation_peers list should be ' \
|
|
857
|
+
"['55.77']")
|
|
858
|
+
bgp.confederation_peers = ['15', '55.77', '16', '18', '555', '299']
|
|
859
|
+
assert_equal(['15', '16', '18', '299', '55.77', '555'],
|
|
860
|
+
bgp.confederation_peers,
|
|
861
|
+
'bgp confederation_peers list should be ' \
|
|
862
|
+
"'['15', '16', '18', '299', '55.77', '555']'")
|
|
863
|
+
bgp.confederation_peers = []
|
|
864
|
+
assert_empty(bgp.confederation_peers,
|
|
865
|
+
'bgp confederation_peers list should be empty')
|
|
866
|
+
bgp.destroy
|
|
621
867
|
end
|
|
622
868
|
|
|
623
869
|
def test_confederation_peers_not_configured
|
|
624
|
-
|
|
625
|
-
bgp = RouterBgp.new(asnum)
|
|
870
|
+
bgp = setup_default
|
|
626
871
|
assert_empty(bgp.confederation_peers,
|
|
627
872
|
'bgp confederation_peers list should *NOT* be configured')
|
|
628
873
|
bgp.destroy
|
|
629
874
|
end
|
|
630
875
|
|
|
631
876
|
def test_default_confederation_peers
|
|
632
|
-
|
|
633
|
-
bgp = RouterBgp.new(asnum)
|
|
877
|
+
bgp = setup_default
|
|
634
878
|
assert_empty(bgp.default_confederation_peers,
|
|
635
879
|
'bgp confederation_peers default value should be empty')
|
|
636
880
|
bgp.destroy
|
|
637
881
|
end
|
|
638
882
|
|
|
639
883
|
def test_isolate
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
884
|
+
bgp = setup_default
|
|
885
|
+
if platform == :ios_xr
|
|
886
|
+
assert_nil(bgp.isolate)
|
|
887
|
+
assert_nil(bgp.default_isolate)
|
|
888
|
+
assert_raises(UnsupportedError) { bgp.isolate = true }
|
|
889
|
+
else
|
|
890
|
+
bgp.isolate = true
|
|
891
|
+
assert(bgp.isolate,
|
|
892
|
+
'bgp isolate should be enabled')
|
|
893
|
+
bgp.isolate = false
|
|
894
|
+
refute(bgp.isolate,
|
|
895
|
+
'bgp isolate should be disabled')
|
|
896
|
+
end
|
|
648
897
|
bgp.destroy
|
|
649
898
|
end
|
|
650
899
|
|
|
651
900
|
def test_default_isolate
|
|
652
|
-
|
|
653
|
-
bgp = RouterBgp.new(asnum)
|
|
901
|
+
bgp = setup_default
|
|
654
902
|
refute(bgp.isolate,
|
|
655
903
|
'bgp isolate default value should be false')
|
|
656
904
|
bgp.destroy
|
|
657
905
|
end
|
|
658
906
|
|
|
659
|
-
def
|
|
660
|
-
|
|
661
|
-
if t == 'test_default'
|
|
662
|
-
asnum = 55
|
|
663
|
-
vrf = 'default'
|
|
664
|
-
bgp = RouterBgp.new(asnum)
|
|
665
|
-
else
|
|
666
|
-
asnum = 99
|
|
667
|
-
vrf = 'yamllll'
|
|
668
|
-
bgp = RouterBgp.new(asnum, vrf)
|
|
669
|
-
end
|
|
670
|
-
bgp.log_neighbor_changes = true
|
|
671
|
-
assert(bgp.log_neighbor_changes,
|
|
672
|
-
"vrf #{vrf}: bgp log_neighbor_changes should be enabled")
|
|
673
|
-
bgp.log_neighbor_changes = false
|
|
674
|
-
refute(bgp.log_neighbor_changes,
|
|
675
|
-
"vrf #{vrf}: bgp log_neighbor_changes should be disabled")
|
|
676
|
-
bgp.destroy
|
|
677
|
-
end
|
|
907
|
+
def test_log_neighbor_changes_default
|
|
908
|
+
log_neighbor_changes(setup_default)
|
|
678
909
|
end
|
|
679
910
|
|
|
680
|
-
def
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
911
|
+
def test_log_neighbor_changes_vrf
|
|
912
|
+
log_neighbor_changes(setup_vrf)
|
|
913
|
+
end
|
|
914
|
+
|
|
915
|
+
def log_neighbor_changes(bgp)
|
|
916
|
+
if platform == :ios_xr
|
|
917
|
+
vrf_str = @vrf == 'default' ? '' : "vrf #{@vrf}"
|
|
918
|
+
@default_show_command =
|
|
919
|
+
"show running-config router bgp #{@asnum} #{vrf_str}"
|
|
920
|
+
@default_output_pattern = /bgp log neighbor changes disable/
|
|
921
|
+
else
|
|
922
|
+
@default_show_command = 'show run bgp all'
|
|
923
|
+
@default_output_pattern = /log-neighbor-changes/
|
|
924
|
+
end
|
|
925
|
+
bgp.log_neighbor_changes = false
|
|
926
|
+
refute(bgp.log_neighbor_changes)
|
|
927
|
+
|
|
928
|
+
msg_disable = 'log neighbor changes should be disabled'
|
|
929
|
+
msg_enable = 'log neighbor changes should be enabled'
|
|
930
|
+
|
|
931
|
+
if platform == :ios_xr
|
|
932
|
+
# XR the disable keyword added
|
|
933
|
+
assert_show_match(msg: msg_disable)
|
|
934
|
+
else
|
|
935
|
+
# Nexus the command is removed
|
|
936
|
+
refute_show_match(msg: msg_disable)
|
|
937
|
+
end
|
|
938
|
+
bgp.log_neighbor_changes = true
|
|
939
|
+
assert(bgp.log_neighbor_changes)
|
|
940
|
+
if platform == :ios_xr
|
|
941
|
+
# XR removes the whole command including disable keyword
|
|
942
|
+
refute_show_match(msg: msg_enable)
|
|
943
|
+
else
|
|
944
|
+
# Nexus adds the log-neighbor-changes command
|
|
945
|
+
assert_show_match(msg: msg_enable)
|
|
946
|
+
end
|
|
685
947
|
bgp.destroy
|
|
686
948
|
end
|
|
687
949
|
|
|
688
950
|
def test_default_log_neighbor_changes
|
|
689
|
-
|
|
690
|
-
bgp
|
|
691
|
-
|
|
692
|
-
|
|
951
|
+
bgp = setup_default
|
|
952
|
+
if bgp.default_log_neighbor_changes
|
|
953
|
+
# XR logging is on by default
|
|
954
|
+
assert(bgp.log_neighbor_changes,
|
|
955
|
+
'bgp log_neighbor_changes should be enabled')
|
|
956
|
+
else
|
|
957
|
+
refute(bgp.log_neighbor_changes,
|
|
958
|
+
'bgp log_neighbor_changes should be disabled')
|
|
959
|
+
end
|
|
693
960
|
bgp.destroy
|
|
694
961
|
end
|
|
695
962
|
|
|
696
|
-
def
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
bgp.maxas_limit = limit
|
|
700
|
-
assert_equal(limit, bgp.maxas_limit, "vrf #{vrf}: maxas-limit invalid")
|
|
963
|
+
def test_maxas_limit_default
|
|
964
|
+
maxas_limit(setup_default)
|
|
965
|
+
end
|
|
701
966
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
assert_equal(limit, bgp.maxas_limit, "vrf #{vrf}: maxas-limit not default")
|
|
967
|
+
def test_maxas_limit_vrf
|
|
968
|
+
maxas_limit(setup_vrf)
|
|
705
969
|
end
|
|
706
970
|
|
|
707
|
-
def
|
|
708
|
-
|
|
709
|
-
|
|
971
|
+
def maxas_limit(bgp)
|
|
972
|
+
if platform == :ios_xr
|
|
973
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
974
|
+
bgp.maxas_limit = 50
|
|
975
|
+
end
|
|
976
|
+
else
|
|
977
|
+
bgp.maxas_limit = 50
|
|
978
|
+
assert_equal(50, bgp.maxas_limit,
|
|
979
|
+
"bgp maxas-limit should be set to '50'")
|
|
980
|
+
bgp.maxas_limit = bgp.default_maxas_limit
|
|
981
|
+
assert_equal(bgp.default_maxas_limit, bgp.maxas_limit,
|
|
982
|
+
'bgp maxas-limit should be set to default value')
|
|
710
983
|
end
|
|
984
|
+
bgp.destroy
|
|
985
|
+
end
|
|
986
|
+
|
|
987
|
+
def test_default_maxas_limit
|
|
988
|
+
bgp = setup_default
|
|
989
|
+
assert_equal(bgp.default_maxas_limit, bgp.maxas_limit,
|
|
990
|
+
'bgp maxas-limit should be default value')
|
|
991
|
+
bgp.destroy
|
|
711
992
|
end
|
|
712
993
|
|
|
713
994
|
def test_neighbor_down_fib_accelerate
|
|
995
|
+
if platform == :ios_xr || node.product_id[/N(5|6|7)/]
|
|
996
|
+
b = RouterBgp.new(1)
|
|
997
|
+
assert_nil(b.neighbor_down_fib_accelerate)
|
|
998
|
+
assert_nil(b.default_neighbor_down_fib_accelerate)
|
|
999
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1000
|
+
b.neighbor_down_fib_accelerate = true
|
|
1001
|
+
end
|
|
1002
|
+
return
|
|
1003
|
+
end
|
|
714
1004
|
%w(test_default test_vrf).each do |t|
|
|
715
1005
|
if t == 'test_default'
|
|
716
|
-
|
|
717
|
-
vrf = 'default'
|
|
718
|
-
bgp = RouterBgp.new(asnum)
|
|
1006
|
+
bgp = setup_default
|
|
719
1007
|
else
|
|
720
|
-
|
|
721
|
-
vrf = 'yamllll'
|
|
722
|
-
bgp = RouterBgp.new(asnum, vrf)
|
|
1008
|
+
bgp = setup_vrf
|
|
723
1009
|
end
|
|
1010
|
+
default = bgp.default_neighbor_down_fib_accelerate
|
|
1011
|
+
assert_equal(default, bgp.neighbor_down_fib_accelerate,
|
|
1012
|
+
'bgp neighbor_fib_down_accelerate not set to default value')
|
|
1013
|
+
|
|
724
1014
|
bgp.neighbor_down_fib_accelerate = true
|
|
725
1015
|
assert(bgp.neighbor_down_fib_accelerate,
|
|
726
|
-
"vrf #{vrf}: bgp neighbor_down_fib_accelerate
|
|
1016
|
+
"vrf #{@vrf}: bgp neighbor_down_fib_accelerate "\
|
|
1017
|
+
'should be enabled')
|
|
727
1018
|
bgp.neighbor_down_fib_accelerate = false
|
|
728
1019
|
refute(bgp.neighbor_down_fib_accelerate,
|
|
729
|
-
"vrf #{vrf}: bgp neighbor_down_fib_accelerate
|
|
1020
|
+
"vrf #{@vrf}: bgp neighbor_down_fib_accelerate "\
|
|
1021
|
+
'should be disabled')
|
|
1022
|
+
|
|
1023
|
+
bgp.neighbor_down_fib_accelerate = default
|
|
1024
|
+
assert_equal(default, bgp.neighbor_down_fib_accelerate,
|
|
1025
|
+
'bgp neighbor_fib_down_accelerate not set to default value')
|
|
730
1026
|
bgp.destroy
|
|
731
1027
|
end
|
|
732
1028
|
end
|
|
733
1029
|
|
|
734
|
-
def test_neighbor_down_fib_accelerate_not_configured
|
|
735
|
-
asnum = 55
|
|
736
|
-
bgp = RouterBgp.new(asnum)
|
|
737
|
-
refute(bgp.neighbor_down_fib_accelerate,
|
|
738
|
-
'bgp neighbor_down_fib_accelerate should be disabled')
|
|
739
|
-
bgp.destroy
|
|
740
|
-
end
|
|
741
|
-
|
|
742
|
-
def test_default_neighbor_down_fib_accelerate
|
|
743
|
-
asnum = 55
|
|
744
|
-
bgp = RouterBgp.new(asnum)
|
|
745
|
-
refute(bgp.default_neighbor_down_fib_accelerate,
|
|
746
|
-
'bgp neighbor_down_fib_accelerate default value should be false')
|
|
747
|
-
bgp.destroy
|
|
748
|
-
end
|
|
749
|
-
|
|
750
1030
|
def test_reconnect_interval
|
|
1031
|
+
if platform == :ios_xr || node.product_id[/N(5|6|7)/]
|
|
1032
|
+
b = RouterBgp.new(1)
|
|
1033
|
+
assert_nil(b.reconnect_interval)
|
|
1034
|
+
assert_nil(b.default_reconnect_interval)
|
|
1035
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1036
|
+
b.reconnect_interval = 34
|
|
1037
|
+
end
|
|
1038
|
+
return
|
|
1039
|
+
end
|
|
751
1040
|
%w(test_default test_vrf).each do |t|
|
|
752
1041
|
if t == 'test_default'
|
|
753
|
-
|
|
754
|
-
vrf = 'default'
|
|
755
|
-
bgp = RouterBgp.new(asnum)
|
|
1042
|
+
bgp = setup_default
|
|
756
1043
|
else
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
1044
|
+
bgp = setup_vrf
|
|
1045
|
+
end
|
|
1046
|
+
if platform == :ios_xr
|
|
1047
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1048
|
+
bgp.reconnect_interval = 34
|
|
1049
|
+
end
|
|
1050
|
+
else
|
|
1051
|
+
bgp.reconnect_interval = 34
|
|
1052
|
+
assert_equal(34, bgp.reconnect_interval,
|
|
1053
|
+
"vrf #{@vrf}: bgp reconnect_interval should be set to 34")
|
|
1054
|
+
bgp.reconnect_interval = 60
|
|
1055
|
+
assert_equal(60, bgp.reconnect_interval,
|
|
1056
|
+
"vrf #{@vrf}: bgp reconnect_interval should be set to 60")
|
|
1057
|
+
end
|
|
767
1058
|
bgp.destroy
|
|
768
1059
|
end
|
|
769
1060
|
end
|
|
770
1061
|
|
|
771
1062
|
def test_reconnect_interval_default
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
'reconnect_interval should
|
|
776
|
-
|
|
1063
|
+
bgp = setup_default
|
|
1064
|
+
if platform == :ios_xr
|
|
1065
|
+
assert_nil(bgp.reconnect_interval,
|
|
1066
|
+
'reconnect_interval should return nil on XR')
|
|
1067
|
+
else
|
|
1068
|
+
assert_equal(bgp.default_reconnect_interval, bgp.reconnect_interval,
|
|
1069
|
+
"reconnect_interval should be set to default value of '60'")
|
|
1070
|
+
bgp.destroy
|
|
1071
|
+
end
|
|
777
1072
|
end
|
|
778
1073
|
|
|
779
1074
|
def test_route_distinguisher
|
|
1075
|
+
skip_nexus_i2_image?
|
|
780
1076
|
remove_all_vrfs
|
|
781
1077
|
|
|
782
|
-
bgp =
|
|
1078
|
+
bgp = setup_vrf
|
|
1079
|
+
assert_empty(bgp.route_distinguisher,
|
|
1080
|
+
'bgp route_distinguisher should *NOT* be configured')
|
|
1081
|
+
|
|
783
1082
|
bgp.route_distinguisher = 'auto'
|
|
784
1083
|
assert_equal('auto', bgp.route_distinguisher)
|
|
785
1084
|
|
|
@@ -798,63 +1097,58 @@ class TestRouterBgp < CiscoTestCase
|
|
|
798
1097
|
def test_router_id
|
|
799
1098
|
%w(test_default test_vrf).each do |t|
|
|
800
1099
|
if t == 'test_default'
|
|
801
|
-
|
|
802
|
-
vrf = 'default'
|
|
803
|
-
bgp = RouterBgp.new(asnum)
|
|
1100
|
+
bgp = setup_default
|
|
804
1101
|
else
|
|
805
|
-
|
|
806
|
-
vrf = 'yamllll'
|
|
807
|
-
bgp = RouterBgp.new(asnum, vrf)
|
|
1102
|
+
bgp = setup_vrf
|
|
808
1103
|
end
|
|
809
|
-
bgp.router_id = '
|
|
810
|
-
assert_equal('
|
|
811
|
-
"vrf #{vrf}: bgp router_id
|
|
1104
|
+
bgp.router_id = '7.8.9.11'
|
|
1105
|
+
assert_equal('7.8.9.11', bgp.router_id,
|
|
1106
|
+
"vrf #{@vrf}: bgp router_id invalid")
|
|
812
1107
|
bgp.router_id = ''
|
|
813
1108
|
assert_empty(bgp.router_id,
|
|
814
|
-
"vrf #{vrf}: bgp router_id should *NOT* be configured")
|
|
1109
|
+
"vrf #{@vrf}: bgp router_id should *NOT* be configured")
|
|
815
1110
|
bgp.destroy
|
|
816
1111
|
end
|
|
817
1112
|
end
|
|
818
1113
|
|
|
819
1114
|
def test_router_id_not_configured
|
|
820
|
-
|
|
821
|
-
bgp = RouterBgp.new(asnum)
|
|
1115
|
+
bgp = setup_default
|
|
822
1116
|
assert_empty(bgp.router_id,
|
|
823
1117
|
'bgp router_id should *NOT* be configured')
|
|
824
1118
|
bgp.destroy
|
|
825
1119
|
end
|
|
826
1120
|
|
|
827
1121
|
def test_default_router_id
|
|
828
|
-
|
|
829
|
-
bgp = RouterBgp.new(asnum)
|
|
1122
|
+
bgp = setup_default
|
|
830
1123
|
assert_empty(bgp.default_router_id,
|
|
831
1124
|
'bgp router_id default value should be empty')
|
|
832
1125
|
bgp.destroy
|
|
833
1126
|
end
|
|
834
1127
|
|
|
835
1128
|
def test_shutdown
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
1129
|
+
bgp = setup_default
|
|
1130
|
+
if platform == :ios_xr
|
|
1131
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1132
|
+
bgp.shutdown = true
|
|
1133
|
+
end
|
|
1134
|
+
else
|
|
1135
|
+
bgp.shutdown = true
|
|
1136
|
+
assert(bgp.shutdown, 'bgp should be shutdown')
|
|
1137
|
+
bgp.shutdown = false
|
|
1138
|
+
refute(bgp.shutdown, "bgp should in 'no shutdown' state")
|
|
1139
|
+
end
|
|
844
1140
|
bgp.destroy
|
|
845
1141
|
end
|
|
846
1142
|
|
|
847
1143
|
def test_shutdown_not_configured
|
|
848
|
-
|
|
849
|
-
bgp = RouterBgp.new(asnum)
|
|
1144
|
+
bgp = setup_default
|
|
850
1145
|
refute(bgp.shutdown,
|
|
851
1146
|
"bgp should be in 'no shutdown' state")
|
|
852
1147
|
bgp.destroy
|
|
853
1148
|
end
|
|
854
1149
|
|
|
855
1150
|
def test_default_shutdown
|
|
856
|
-
|
|
857
|
-
bgp = RouterBgp.new(asnum)
|
|
1151
|
+
bgp = setup_default
|
|
858
1152
|
refute(bgp.default_shutdown,
|
|
859
1153
|
'bgp shutdown default value should be false')
|
|
860
1154
|
bgp.destroy
|
|
@@ -863,35 +1157,35 @@ class TestRouterBgp < CiscoTestCase
|
|
|
863
1157
|
def test_suppress_fib_pending
|
|
864
1158
|
%w(test_default test_vrf).each do |t|
|
|
865
1159
|
if t == 'test_default'
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
bgp =
|
|
1160
|
+
bgp = setup_default
|
|
1161
|
+
else
|
|
1162
|
+
bgp = setup_vrf
|
|
1163
|
+
end
|
|
1164
|
+
if platform == :ios_xr
|
|
1165
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1166
|
+
bgp.suppress_fib_pending = true
|
|
1167
|
+
end
|
|
869
1168
|
else
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
bgp.suppress_fib_pending = false
|
|
878
|
-
refute(bgp.suppress_fib_pending,
|
|
879
|
-
"vrf #{vrf}: bgp suppress_fib_pending should be disabled")
|
|
1169
|
+
bgp.suppress_fib_pending = true
|
|
1170
|
+
assert(bgp.suppress_fib_pending,
|
|
1171
|
+
"vrf #{@vrf}: bgp suppress_fib_pending should be enabled")
|
|
1172
|
+
bgp.suppress_fib_pending = false
|
|
1173
|
+
refute(bgp.suppress_fib_pending,
|
|
1174
|
+
"vrf #{@vrf}: bgp suppress_fib_pending should be disabled")
|
|
1175
|
+
end
|
|
880
1176
|
bgp.destroy
|
|
881
1177
|
end
|
|
882
1178
|
end
|
|
883
1179
|
|
|
884
1180
|
def test_suppress_fib_pending_not_configured
|
|
885
|
-
|
|
886
|
-
bgp = RouterBgp.new(asnum)
|
|
1181
|
+
bgp = setup_default
|
|
887
1182
|
refute(bgp.suppress_fib_pending,
|
|
888
1183
|
'bgp suppress_fib_pending should be disabled')
|
|
889
1184
|
bgp.destroy
|
|
890
1185
|
end
|
|
891
1186
|
|
|
892
1187
|
def test_default_suppress_fib_pending
|
|
893
|
-
|
|
894
|
-
bgp = RouterBgp.new(asnum)
|
|
1188
|
+
bgp = setup_default
|
|
895
1189
|
refute(bgp.default_suppress_fib_pending,
|
|
896
1190
|
'bgp suppress_fib_pending default value should be false')
|
|
897
1191
|
bgp.destroy
|
|
@@ -900,64 +1194,71 @@ class TestRouterBgp < CiscoTestCase
|
|
|
900
1194
|
def test_timer_bestpath_limit
|
|
901
1195
|
%w(test_default test_vrf).each do |t|
|
|
902
1196
|
if t == 'test_default'
|
|
903
|
-
|
|
904
|
-
vrf = 'default'
|
|
905
|
-
bgp = RouterBgp.new(asnum)
|
|
1197
|
+
bgp = setup_default
|
|
906
1198
|
else
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1199
|
+
bgp = setup_vrf
|
|
1200
|
+
end
|
|
1201
|
+
if platform == :ios_xr
|
|
1202
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1203
|
+
bgp.timer_bestpath_limit_set(34)
|
|
1204
|
+
end
|
|
1205
|
+
else
|
|
1206
|
+
bgp.timer_bestpath_limit_set(34)
|
|
1207
|
+
assert_equal(34, bgp.timer_bestpath_limit, "vrf #{@vrf}: " \
|
|
1208
|
+
"bgp timer_bestpath_limit should be set to '34'")
|
|
1209
|
+
bgp.timer_bestpath_limit_set(300)
|
|
1210
|
+
assert_equal(300, bgp.timer_bestpath_limit, "vrf #{@vrf}: " \
|
|
1211
|
+
"bgp timer_bestpath_limit should be set to '300'")
|
|
1212
|
+
end
|
|
917
1213
|
bgp.destroy
|
|
918
1214
|
end
|
|
919
1215
|
end
|
|
920
1216
|
|
|
921
1217
|
def test_timer_bestpath_limit_default
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1218
|
+
bgp = setup_default
|
|
1219
|
+
if platform == :ios_xr
|
|
1220
|
+
assert_nil(bgp.timer_bestpath_limit,
|
|
1221
|
+
'timer_bestpath_limit should be nil for XR')
|
|
1222
|
+
else
|
|
1223
|
+
assert_equal(300, bgp.timer_bestpath_limit,
|
|
1224
|
+
"timer_bestpath_limit should be default value of '300'")
|
|
1225
|
+
end
|
|
926
1226
|
bgp.destroy
|
|
927
1227
|
end
|
|
928
1228
|
|
|
929
|
-
def
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1229
|
+
def test_timer_bestpath_limit_always_default
|
|
1230
|
+
timer_bestpath_limit_always(setup_default)
|
|
1231
|
+
end
|
|
1232
|
+
|
|
1233
|
+
def test_timer_bestpath_limit_always_vrf
|
|
1234
|
+
timer_bestpath_limit_always(setup_vrf)
|
|
1235
|
+
end
|
|
1236
|
+
|
|
1237
|
+
def timer_bestpath_limit_always(bgp)
|
|
1238
|
+
if platform == :ios_xr
|
|
1239
|
+
assert_raises(Cisco::UnsupportedError) do
|
|
1240
|
+
bgp.timer_bestpath_limit_set(34, true)
|
|
939
1241
|
end
|
|
1242
|
+
else
|
|
940
1243
|
bgp.timer_bestpath_limit_set(34, true)
|
|
941
1244
|
assert(bgp.timer_bestpath_limit_always,
|
|
942
|
-
"vrf #{vrf}: bgp timer_bestpath_limit_always should be enabled")
|
|
1245
|
+
"vrf #{@vrf}: bgp timer_bestpath_limit_always should be enabled")
|
|
943
1246
|
bgp.timer_bestpath_limit_set(34, false)
|
|
944
1247
|
refute(bgp.timer_bestpath_limit_always,
|
|
945
|
-
"vrf #{vrf}: bgp timer_bestpath_limit_always should be disabled")
|
|
946
|
-
bgp.destroy
|
|
1248
|
+
"vrf #{@vrf}: bgp timer_bestpath_limit_always should be disabled")
|
|
947
1249
|
end
|
|
1250
|
+
bgp.destroy
|
|
948
1251
|
end
|
|
949
1252
|
|
|
950
1253
|
def test_timer_bestpath_limit_always_not_configured
|
|
951
|
-
|
|
952
|
-
bgp = RouterBgp.new(asnum)
|
|
1254
|
+
bgp = setup_default
|
|
953
1255
|
refute(bgp.timer_bestpath_limit_always,
|
|
954
1256
|
'bgp timer_bestpath_limit_always should be disabled')
|
|
955
1257
|
bgp.destroy
|
|
956
1258
|
end
|
|
957
1259
|
|
|
958
1260
|
def test_default_timer_bestpath_limit_always
|
|
959
|
-
|
|
960
|
-
bgp = RouterBgp.new(asnum)
|
|
1261
|
+
bgp = setup_default
|
|
961
1262
|
refute(bgp.default_timer_bestpath_limit_always,
|
|
962
1263
|
'bgp timer_bestpath_limit_always default value should be false')
|
|
963
1264
|
bgp.destroy
|
|
@@ -966,38 +1267,33 @@ class TestRouterBgp < CiscoTestCase
|
|
|
966
1267
|
def test_timer_bgp_keepalive_hold
|
|
967
1268
|
%w(test_default test_vrf).each do |t|
|
|
968
1269
|
if t == 'test_default'
|
|
969
|
-
|
|
970
|
-
vrf = 'default'
|
|
971
|
-
bgp = RouterBgp.new(asnum)
|
|
1270
|
+
bgp = setup_default
|
|
972
1271
|
else
|
|
973
|
-
|
|
974
|
-
vrf = 'yamllll'
|
|
975
|
-
bgp = RouterBgp.new(asnum, vrf)
|
|
1272
|
+
bgp = setup_vrf
|
|
976
1273
|
end
|
|
977
1274
|
bgp.timer_bgp_keepalive_hold_set(25, 45)
|
|
978
|
-
assert_equal(%w(25 45), bgp.timer_bgp_keepalive_hold, "vrf #{vrf}: " \
|
|
1275
|
+
assert_equal(%w(25 45), bgp.timer_bgp_keepalive_hold, "vrf #{@vrf}: " \
|
|
979
1276
|
"keepalive and hold values should be '25 and 45'")
|
|
980
1277
|
bgp.timer_bgp_keepalive_hold_set(60, 180)
|
|
981
|
-
assert_equal(%w(60 180), bgp.timer_bgp_keepalive_hold, "vrf #{vrf}: " \
|
|
1278
|
+
assert_equal(%w(60 180), bgp.timer_bgp_keepalive_hold, "vrf #{@vrf}: " \
|
|
982
1279
|
"keepalive and hold values should be '60 and 180'")
|
|
983
|
-
assert_equal(60, bgp.timer_bgp_keepalive, "vrf #{vrf}: " \
|
|
1280
|
+
assert_equal(60, bgp.timer_bgp_keepalive, "vrf #{@vrf}: " \
|
|
984
1281
|
"keepalive value should be '60'")
|
|
985
|
-
assert_equal(180, bgp.timer_bgp_holdtime, "vrf #{vrf}: " \
|
|
1282
|
+
assert_equal(180, bgp.timer_bgp_holdtime, "vrf #{@vrf}: " \
|
|
986
1283
|
"keepalive value should be '180'")
|
|
987
1284
|
bgp.timer_bgp_keepalive_hold_set(500, 3600)
|
|
988
|
-
assert_equal(%w(500 3600), bgp.timer_bgp_keepalive_hold, "vrf #{vrf}: " \
|
|
1285
|
+
assert_equal(%w(500 3600), bgp.timer_bgp_keepalive_hold, "vrf #{@vrf}: " \
|
|
989
1286
|
"keepalive and hold values should be '500 and 3600'")
|
|
990
|
-
assert_equal(500, bgp.timer_bgp_keepalive, "vrf #{vrf}: " \
|
|
1287
|
+
assert_equal(500, bgp.timer_bgp_keepalive, "vrf #{@vrf}: " \
|
|
991
1288
|
"keepalive value should be '500'")
|
|
992
|
-
assert_equal(3600, bgp.timer_bgp_holdtime, "vrf #{vrf}: " \
|
|
1289
|
+
assert_equal(3600, bgp.timer_bgp_holdtime, "vrf #{@vrf}: " \
|
|
993
1290
|
"keepalive value should be '3600'")
|
|
994
1291
|
bgp.destroy
|
|
995
1292
|
end
|
|
996
1293
|
end
|
|
997
1294
|
|
|
998
1295
|
def test_default_timer_keepalive_hold_default
|
|
999
|
-
|
|
1000
|
-
bgp = RouterBgp.new(asnum)
|
|
1296
|
+
bgp = setup_default
|
|
1001
1297
|
assert_equal(%w(60 180), bgp.default_timer_bgp_keepalive_hold,
|
|
1002
1298
|
'bgp timer_bestpath_timer_keepalive_hold_default values ' \
|
|
1003
1299
|
"should be '60' and '180'")
|