Skip to content
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
18 changes: 15 additions & 3 deletions tests/everflow/everflow_test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,8 +992,15 @@ def check_rule_active(self, duthost, table_name):
for line in res[2:]:
if len(line) < status_index:
continue
if line[status_index:] != 'Active':
return False
if duthost.is_multi_asic:
st = eval(line[status_index:])
namespace_list = duthost.get_asic_namespace_list()
for namespace in namespace_list:
if st[namespace] != 'Active':
return False
else:
if line[status_index:] != 'Active':
return False
return True

def apply_non_openconfig_acl_rule(self, duthost, extra_vars, rule_file, table_name):
Expand All @@ -1010,7 +1017,12 @@ def apply_non_openconfig_acl_rule(self, duthost, extra_vars, rule_file, table_na
duthost.host.options['variable_manager'].extra_vars.update(extra_vars)
duthost.file(path=dest_path, state='absent')
duthost.template(src=os.path.join(FILE_DIR, rule_file), dest=dest_path)
duthost.shell("config load -y {}".format(dest_path))
dest_paths = dest_path
if duthost.is_multi_asic:
num_asics = duthost.facts['num_asic']
for num_asic in range(num_asics):
dest_paths = dest_paths + "," + dest_path
duthost.shell("config load -y {}".format(dest_paths))

if duthost.facts['asic_type'] != 'vs':
pytest_assert(wait_until(60, 2, 0, self.check_rule_active, duthost, table_name),
Expand Down
18 changes: 11 additions & 7 deletions tests/everflow/test_everflow_ipv6.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def setup_acl_table(self, setup_info, setup_mirror_session, config_method, setup
everflow_dut = setup_info[DOWN_STREAM]['everflow_dut']
remote_dut = setup_info[DOWN_STREAM]['remote_dut']

table_name = self._get_table_name(everflow_dut)
table_name = self._get_table_name(everflow_dut, self.acl_stage())
temporary_table = False

duthost_set = set()
Expand All @@ -214,7 +214,10 @@ def setup_acl_table(self, setup_info, setup_mirror_session, config_method, setup

for duthost in duthost_set:
if temporary_table:
self.apply_acl_table_config(duthost, table_name, "MIRRORV6", config_method)
inst_list = duthost.get_sonic_host_and_frontend_asic_instance()
for inst in inst_list:
self.apply_acl_table_config(duthost, table_name, "MIRRORV6", config_method,
bind_namespace=getattr(inst, 'namespace', None))

self.apply_acl_rule_config(duthost, table_name, setup_mirror_session["session_name"],
config_method, rules=EVERFLOW_V6_RULES)
Expand All @@ -229,16 +232,17 @@ def setup_acl_table(self, setup_info, setup_mirror_session, config_method, setup
self.remove_acl_table_config(duthost, table_name, config_method)

# TODO: This can probably be refactored into a common utility method later.
def _get_table_name(self, duthost):
def _get_table_name(self, duthost, acl_stage="ingress"):
show_output = duthost.command("show acl table")

table_name = None
for line in show_output["stdout_lines"]:
if "MIRRORV6" in line:
# NOTE: Once we branch out the sonic-mgmt repo we can skip the version check.
if "201811" in duthost.os_version or self.acl_stage() in line:
table_name = line.split()[0]
break
if acl_stage in line:
# NOTE: Once we branch out the sonic-mgmt repo we can skip the version check.
if "201811" in duthost.os_version or self.acl_stage() in line:
table_name = line.split()[0]
break

return table_name

Expand Down
Loading