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

[acl] Add regression test for config acl CLI command #1694

Merged
merged 1 commit into from
Apr 19, 2021
Merged
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
33 changes: 33 additions & 0 deletions tests/test_acl_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class TestAclCli:
def test_AddTableMultipleTimes(self, dvs, dvs_acl):
dvs.runcmd("config acl add table TEST L3 -p Ethernet0")

cdb = dvs.get_config_db()
cdb.wait_for_field_match(
"ACL_TABLE",
"TEST",
{"ports": "Ethernet0"}
)

# Verify that subsequent updates don't delete "ports" from config DB
dvs.runcmd("config acl add table TEST L3 -p Ethernet4")
cdb.wait_for_field_match(
"ACL_TABLE",
"TEST",
{"ports": "Ethernet4"}
)

# Verify that subsequent updates propagate to ASIC DB
L3_BIND_PORTS = ["Ethernet0", "Ethernet4", "Ethernet8", "Ethernet12"]
dvs.runcmd(f"config acl add table TEST L3 -p {','.join(L3_BIND_PORTS)}")
acl_table_id = dvs_acl.get_acl_table_ids(1)[0]
acl_table_group_ids = dvs_acl.get_acl_table_group_ids(len(L3_BIND_PORTS))

dvs_acl.verify_acl_table_group_members(acl_table_id, acl_table_group_ids, 1)
dvs_acl.verify_acl_table_port_binding(acl_table_id, L3_BIND_PORTS, 1)


# Add Dummy always-pass test at end as workaroud
# for issue when Flaky fail on final test it invokes module tear-down before retrying
def test_nonflaky_dummy():
pass