Skip to content

[crm, cacl] Refactoring of recover_acl_rule fixture causing failures in cacl and crm tests #9468

@veronica-arista

Description

@veronica-arista

Description
Two new errors observed when running cacl/test_cacl_function.py or crm/test_crm.py with the change in #9312 on modular systems:

KeyError: 'DATAACL'
and
AttributeError: 'SubRequest' object has no attribute 'param'

Steps to reproduce the issue:
For the KeyError: 'DATAACL' error:

  1. Run cacl/test_cacl_function.py or crm/test_crm.py on a modular system.
  2. The refactored recover_acl_rule fixture will be invoked which specifies enum_rand_one_per_hwsku_hostname instead of enum_rand_one_per_hwsku_frontend_hostname as the original fixture did, causing it to be applied to the supervisor DUT.
  3. The sup doesn't have DATAACL in it's acl_table causing the key error when the fixture attempts
pre_acl_rules = duthost.acl_facts()["ansible_facts"]["ansible_acl_facts"]["DATAACL"]["rules"]

For the AttributeError: 'SubRequest' object has no attribute 'param' error:

  1. Run crm/test_crm.py on modular
  2. The error occurs in crm/test_crm.py::test_crm::test_acl_entry for each of the linecards in a modular system and looks like it's due to expecting enum_rand_one_per_hwsku_frontend_hostname instead of enum_rand_one_per_hwsku_hostname
  3. NOTE: this error signature was observed on fixed system too.

Describe the results you received:
The test failed with error as mentioned.

Describe the results you expected:
Tests should pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions