Skip to content

Commit

Permalink
n7k atherton hsrp (#504)
Browse files Browse the repository at this point in the history
* pim bfd

* fix pim ssm range tests

* review comment

* n7k atherton event-history

* fix hsrp for n7k atherton
  • Loading branch information
saichint authored and mikewiebe committed Dec 8, 2016
1 parent 8b3e54c commit 90812b3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
14 changes: 7 additions & 7 deletions lib/cisco_node_utils/cmd_ref/interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,34 @@ feature_vlan:
set_value: "<state> feature interface-vlan"

hsrp_bfd:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
kind: boolean
get_value: '/^hsrp bfd$/'
set_value: "<state> hsrp bfd"
default_value: false

hsrp_delay:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
get_value: '/^hsrp delay minimum (\d+) reload (\d+)/'
set_value: "hsrp delay <minimum> <min> <reload> <rel>"

hsrp_delay_minimum:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
default_value: 0

hsrp_delay_reload:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
default_value: 0

hsrp_mac_refresh:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
kind: int
get_value: '/^hsrp mac-refresh (\d+)$/'
set_value: '<state> hsrp mac-refresh <timeout>'
default_value: false

hsrp_use_bia:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
# the config can be 'hsrp use-bia' or
# 'hsrp use-bia scope interface' or
# no config at all so need to grab the
Expand All @@ -130,7 +130,7 @@ hsrp_use_bia:
default_value: false

hsrp_version:
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]
kind: int
get_value: '/^hsrp version (\d+)$/'
set_value: "hsrp version <ver>"
Expand Down
2 changes: 1 addition & 1 deletion lib/cisco_node_utils/cmd_ref/interface_hsrp_group.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# interface_hsrp_group
---
_exclude: [ios_xr, N5k, N6k, N7k]
_exclude: [ios_xr, N5k, N6k]

_template:
get_command: "show running hsrp | no-more"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_interface_hsrp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def create_intf
end

def test_hsrp_bfd
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ih = create_intf
if validate_property_excluded?('interface', 'hsrp_bfd')
assert_nil(ih.hsrp_bfd)
Expand All @@ -53,6 +54,7 @@ def test_hsrp_bfd
end

def test_hsrp_delay
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ih = create_intf
if validate_property_excluded?('interface', 'hsrp_delay')
assert_nil(ih.hsrp_delay_minimum)
Expand All @@ -76,6 +78,7 @@ def test_hsrp_delay
end

def test_hsrp_mac_refresh
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ih = create_intf
if validate_property_excluded?('interface', 'hsrp_mac_refresh')
assert_nil(ih.hsrp_mac_refresh)
Expand All @@ -92,6 +95,7 @@ def test_hsrp_mac_refresh
end

def test_hsrp_use_bia
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ih = create_intf
if validate_property_excluded?('interface', 'hsrp_use_bia')
assert_nil(ih.hsrp_use_bia)
Expand All @@ -112,6 +116,7 @@ def test_hsrp_use_bia
end

def test_hsrp_version
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ih = create_intf
if validate_property_excluded?('interface', 'hsrp_version')
assert_nil(ih.hsrp_version)
Expand Down
24 changes: 22 additions & 2 deletions tests/test_interface_hsrp_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def create_interface_hsrp_group_ipv6(name='port-channel100',
end

def test_collection_size
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg1 = create_interface_hsrp_group_ipv4
ihg2 = create_interface_hsrp_group_ipv4('port-channel100', 2, 'ipv4')
ihg3 = create_interface_hsrp_group_ipv4('port-channel100', 3, 'ipv4')
Expand All @@ -74,6 +75,7 @@ def test_collection_size
end

def test_group_name
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_group_name, ihg.group_name)
ihg.group_name = 'hsrp_group_name'
Expand All @@ -89,6 +91,7 @@ def test_group_name
end

def test_mac_addr
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_mac_addr, ihg.mac_addr)
ihg.mac_addr = '00:00:11:11:22:22'
Expand All @@ -104,6 +107,7 @@ def test_mac_addr
end

def test_auth_type_clear
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_authentication_string,
ihg.authentication_string)
Expand Down Expand Up @@ -131,6 +135,7 @@ def test_auth_type_clear
end

def test_auth_type_md5
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv4
attrs[:authentication_auth_type] = 'md5'
Expand All @@ -157,6 +162,7 @@ def test_auth_type_md5
end

def test_auth_key_string_enc_0
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv4
attrs[:authentication_auth_type] = 'md5'
Expand Down Expand Up @@ -188,6 +194,7 @@ def test_auth_key_string_enc_0
end

def test_auth_key_string_enc_7
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv4
attrs[:authentication_auth_type] = 'md5'
Expand Down Expand Up @@ -215,6 +222,7 @@ def test_auth_key_string_enc_7
end

def test_auth_key_string_enc_7_compat_timeout_ipv4
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv4
attrs[:authentication_auth_type] = 'md5'
Expand Down Expand Up @@ -247,6 +255,7 @@ def test_auth_key_string_enc_7_compat_timeout_ipv4
end

def test_auth_key_string_enc_7_compat_timeout_ipv6
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv6
attrs[:authentication_auth_type] = 'md5'
Expand Down Expand Up @@ -279,6 +288,7 @@ def test_auth_key_string_enc_7_compat_timeout_ipv6
end

def test_auth_key_string_enc_0_compat_timeout_ipv4
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv4
attrs[:authentication_auth_type] = 'md5'
Expand Down Expand Up @@ -310,6 +320,7 @@ def test_auth_key_string_enc_0_compat_timeout_ipv4
end

def test_auth_key_string_enc_0_compat_timeout_ipv6
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
attrs = {}
ihg = create_interface_hsrp_group_ipv6
attrs[:authentication_auth_type] = 'md5'
Expand Down Expand Up @@ -341,6 +352,7 @@ def test_auth_key_string_enc_0_compat_timeout_ipv6
end

def test_preempt_ipv4
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_preempt, ihg.preempt)
assert_equal(ihg.default_preempt_delay_minimum, ihg.preempt_delay_minimum)
Expand Down Expand Up @@ -372,6 +384,7 @@ def test_preempt_ipv4
end

def test_preempt_ipv6
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv6
assert_equal(ihg.default_preempt, ihg.preempt)
assert_equal(ihg.default_preempt_delay_minimum, ihg.preempt_delay_minimum)
Expand Down Expand Up @@ -403,6 +416,7 @@ def test_preempt_ipv6
end

def test_priority_ipv4
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_priority, ihg.priority)
assert_equal(ihg.default_priority_forward_thresh_lower,
Expand Down Expand Up @@ -432,6 +446,7 @@ def test_priority_ipv4
end

def test_priority_ipv6
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv6
assert_equal(ihg.default_priority, ihg.priority)
assert_equal(ihg.default_priority_forward_thresh_lower,
Expand Down Expand Up @@ -461,6 +476,7 @@ def test_priority_ipv6
end

def test_timers_ipv4
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_timers_hello, ihg.timers_hello)
assert_equal(ihg.default_timers_hello_msec, ihg.timers_hello_msec)
Expand Down Expand Up @@ -493,6 +509,7 @@ def test_timers_ipv4
end

def test_timers_ipv6
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv6
assert_equal(ihg.default_timers_hello, ihg.timers_hello)
assert_equal(ihg.default_timers_hello_msec, ihg.timers_hello_msec)
Expand Down Expand Up @@ -525,6 +542,7 @@ def test_timers_ipv6
end

def test_ipv4_vip
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
ihg = create_interface_hsrp_group_ipv4
assert_equal(ihg.default_ipv4_enable, ihg.ipv4_enable)
assert_equal(ihg.default_ipv4_vip, ihg.ipv4_vip)
Expand All @@ -547,10 +565,12 @@ def test_ipv4_vip
end

def test_ipv6_vip
skip_legacy_defect?('7.3.0.D1.1', 'CSCuh90262: hsrp indentation')
config_no_warn('interface Po100 ; ipv6 address 2000::01/64')
ihg = create_interface_hsrp_group_ipv6
assert_equal(ihg.default_ipv6_vip, ihg.ipv6_vip)
ihg.ipv6_vip = ['2000::11', '2001::55']
assert_equal(['2000::11', '2001::55'], ihg.ipv6_vip)
ihg.ipv6_vip = ['2000::11', '2000::55']
assert_equal(['2000::11', '2000::55'], ihg.ipv6_vip)
ihg.ipv6_vip = ihg.default_ipv6_vip
assert_equal(ihg.default_ipv6_vip, ihg.ipv6_vip)
assert_equal(ihg.default_ipv6_autoconfig, ihg.ipv6_autoconfig)
Expand Down

0 comments on commit 90812b3

Please sign in to comment.