Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_lacp_suspend_individual to address behavior change #489

Merged
merged 2 commits into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/cisco_node_utils/cmd_ref/interface_portchannel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ lacp_min_links:

lacp_suspend_individual:
kind: boolean
auto_default: false
get_value: '/^lacp suspend.individual$/'
set_value: "%s lacp suspend-individual"
default_value: true
N3k:
default_value: false
else:
auto_default: false
default_value: true

port_hash_distribution:
_exclude: [N6k, N5k]
Expand Down
20 changes: 18 additions & 2 deletions tests/test_interface_portchannel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,24 @@ def test_lacp_max_bundle

def test_lacp_suspend_individual
interface = create_port_channel
interface.lacp_suspend_individual = false
assert_equal(false, interface.lacp_suspend_individual)

# Create interface object to manage the admin state
# of the port-channel interface.
# The port-channel interface needs to be in admin state down
# before this property can be set.
int_obj = Interface.new(interface.name)
int_obj.shutdown = true

# Test initial default case
assert_equal(interface.default_lacp_suspend_individual,
interface.lacp_suspend_individual)

# Test non-default value
val = !interface.default_lacp_suspend_individual
interface.lacp_suspend_individual = val
assert_equal(val, interface.lacp_suspend_individual)

# Set back to default
interface.lacp_suspend_individual =
interface.default_lacp_suspend_individual
assert_equal(interface.default_lacp_suspend_individual,
Expand Down