@pytest.fixture(scope='class', autouse=True)
def acl_rules(self, duthosts, localhost, setup, acl_table, populate_vlan_arp_entries, tbinfo, ip_version):
    'Setup/teardown ACL rules for the current set of tests.\n\n        Args:\n            duthosts: All DUTs belong to the testbed.\n            rand_one_dut_hostname: hostname of a random chosen dut to run test.\n            localhost: The host from which tests are run.\n            setup: Parameters for the ACL tests.\n            acl_table: Configuration info for the ACL table.\n            populate_vlan_arp_entries: A function to populate ARP/FDB tables for VLAN interfaces.\n\n        '
    dut_to_analyzer_map = {}
    for duthost in duthosts:
        loganalyzer = LogAnalyzer(ansible_host=duthost, marker_prefix='acl_rules')
        loganalyzer.load_common_config()
        dut_to_analyzer_map[duthost] = loganalyzer
        try:
            loganalyzer.expect_regex = [LOG_EXPECT_ACL_RULE_CREATE_RE]
            with loganalyzer:
                self.setup_rules(duthost, acl_table, ip_version)
            self.post_setup_hook(duthost, localhost, populate_vlan_arp_entries, tbinfo)
            assert self.check_rule_counters(duthost), 'Rule counters should be ready!'
        except LogAnalyzerError as err:
            logger.error('ACL rule application failed, attempting to clean-up...')
            self.teardown_rules(duthost)
            raise err
    try:
        (yield)
    finally:
        for (duthost, loganalyzer) in dut_to_analyzer_map.items():
            loganalyzer.expect_regex = [LOG_EXPECT_ACL_RULE_REMOVE_RE]
            with loganalyzer:
                logger.info('Removing ACL rules')
                self.teardown_rules(duthost)
Setup/teardown ACL rules for the current set of tests.

Args:
    duthosts: All DUTs belong to the testbed.
    rand_one_dut_hostname: hostname of a random chosen dut to run test.
    localhost: The host from which tests are run.
    setup: Parameters for the ACL tests.
    acl_table: Configuration info for the ACL table.
    populate_vlan_arp_entries: A function to populate ARP/FDB tables for VLAN interfaces.
@pytest.fixture(scope='class', autouse=True)
def acl_rules(self, duthosts, localhost, setup, acl_table, populate_vlan_arp_entries, tbinfo, ip_version):
    'Setup/teardown ACL rules for the current set of tests.\n\n        Args:\n            duthosts: All DUTs belong to the testbed.\n            rand_one_dut_hostname: hostname of a random chosen dut to run test.\n            localhost: The host from which tests are run.\n            setup: Parameters for the ACL tests.\n            acl_table: Configuration info for the ACL table.\n            populate_vlan_arp_entries: A function to populate ARP/FDB tables for VLAN interfaces.\n\n        '
    dut_to_analyzer_map = {}
    for duthost in duthosts:
        loganalyzer = LogAnalyzer(ansible_host=duthost, marker_prefix='acl_rules')
        loganalyzer.load_common_config()
        dut_to_analyzer_map[duthost] = loganalyzer
        try:
            loganalyzer.expect_regex = [LOG_EXPECT_ACL_RULE_CREATE_RE]
            with loganalyzer:
                self.setup_rules(duthost, acl_table, ip_version)
            self.post_setup_hook(duthost, localhost, populate_vlan_arp_entries, tbinfo)
            assert self.check_rule_counters(duthost), 'Rule counters should be ready!'
        except LogAnalyzerError as err:
            logger.error('ACL rule application failed, attempting to clean-up...')
            self.teardown_rules(duthost)
            raise err
    try:
        (yield)
    finally:
        for (duthost, loganalyzer) in dut_to_analyzer_map.items():
            loganalyzer.expect_regex = [LOG_EXPECT_ACL_RULE_REMOVE_RE]
            with loganalyzer:
                logger.info('Removing ACL rules')
                self.teardown_rules(duthost)