Skip to content

Commit

Permalink
Changed all references to 'is_dualtor_aa' to just 'is_dualtor' (sonic…
Browse files Browse the repository at this point in the history
  • Loading branch information
jongorel committed May 22, 2024
1 parent 138a0ad commit bfffd77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
12 changes: 6 additions & 6 deletions tests/generic_config_updater/gu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def format_and_apply_template(duthost, template_name, extra_vars, setup):

duts_to_apply = [duthost]
outputs = []
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
duts_to_apply.append(setup["rand_unselected_dut"])

for dut in duts_to_apply:
Expand All @@ -404,7 +404,7 @@ def load_and_apply_json_patch(duthost, file_name, setup):

duts_to_apply = [duthost]
outputs = []
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
duts_to_apply.append(setup["rand_unselected_dut"])

for dut in duts_to_apply:
Expand All @@ -425,7 +425,7 @@ def apply_formed_json_patch(duthost, json_patch, setup):

duts_to_apply = [duthost]
outputs = []
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
duts_to_apply.append(setup["rand_unselected_dut"])

for dut in duts_to_apply:
Expand Down Expand Up @@ -460,7 +460,7 @@ def expect_acl_table_match_multiple_bindings(duthost,
cmds = "show acl table {}".format(table_name)

duts_to_check = [duthost]
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
duts_to_check.append(setup["rand_unselected_dut"])

for dut in duts_to_check:
Expand All @@ -482,7 +482,7 @@ def expect_acl_rule_match(duthost, rulename, expected_content_list, setup):
cmds = "show acl rule DYNAMIC_ACL_TABLE {}".format(rulename)

duts_to_check = [duthost]
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
duts_to_check.append(setup["rand_unselected_dut"])

for dut in duts_to_check:
Expand All @@ -509,7 +509,7 @@ def expect_acl_rule_removed(duthost, rulename, setup):
cmds = "show acl rule DYNAMIC_ACL_TABLE {}".format(rulename)

duts_to_check = [duthost]
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
duts_to_check.append(setup["rand_unselected_dut"])

for dut in duts_to_check:
Expand Down
10 changes: 3 additions & 7 deletions tests/generic_config_updater/test_dynamic_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,11 @@ def setup(rand_selected_dut, rand_unselected_dut, tbinfo, vlan_name, topo_scenar

mg_facts = rand_selected_dut.get_extended_minigraph_facts(tbinfo)
is_dualtor = False
is_dualtor_aa = False
if "dualtor" in tbinfo["topo"]["name"]:
vlan_name = list(mg_facts['minigraph_vlans'].keys())[0]
# Use VLAN MAC as router MAC on dual-tor testbed
router_mac = rand_selected_dut.get_dut_iface_mac(vlan_name)
is_dualtor = True
if "aa" in tbinfo["topo"]["name"]:
is_dualtor_aa = True
else:
router_mac = rand_selected_dut.facts['router_mac']

Expand Down Expand Up @@ -264,7 +261,6 @@ def new_update_payload(pkt):
"dut_mac": dut_mac,
"vlan_ips": vlan_ips,
"is_dualtor": is_dualtor,
"is_dualtor_aa": is_dualtor_aa,
"rand_unselected_dut": rand_unselected_dut,
"switch_loopback_ip": switch_loopback_ip,
"ipv4_vlan_mac": v4_vlan_mac,
Expand All @@ -285,19 +281,19 @@ def setup_env(rand_selected_dut, rand_unselected_dut, setup):
"""

create_checkpoint(rand_selected_dut)
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
create_checkpoint(rand_unselected_dut)

yield

try:
logger.info("Rolled back to original checkpoint")
rollback_or_reload(rand_selected_dut)
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
rollback_or_reload(rand_unselected_dut)
finally:
delete_checkpoint(rand_selected_dut)
if setup["is_dualtor_aa"]:
if setup["is_dualtor"]:
delete_checkpoint(rand_unselected_dut)


Expand Down

0 comments on commit bfffd77

Please sign in to comment.