diff --git a/tests/everflow/everflow_test_utilities.py b/tests/everflow/everflow_test_utilities.py index 2d936614c62..91e12a1f424 100644 --- a/tests/everflow/everflow_test_utilities.py +++ b/tests/everflow/everflow_test_utilities.py @@ -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): @@ -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), diff --git a/tests/everflow/test_everflow_ipv6.py b/tests/everflow/test_everflow_ipv6.py index 4c30eae0796..9a9d727a9eb 100644 --- a/tests/everflow/test_everflow_ipv6.py +++ b/tests/everflow/test_everflow_ipv6.py @@ -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() @@ -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) @@ -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