Skip to content

sanity check fixes for chassis; and cache cleanup at the end of pytest session#2958

Merged
yxieca merged 5 commits intosonic-net:masterfrom
sanmalho-git:fixtures
Feb 18, 2021
Merged

sanity check fixes for chassis; and cache cleanup at the end of pytest session#2958
yxieca merged 5 commits intosonic-net:masterfrom
sanmalho-git:fixtures

Conversation

@sanmalho-git
Copy link
Contributor

@sanmalho-git sanmalho-git commented Feb 8, 2021

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

  • sanity check:

    • The BGP and interface sanity checks for multi-dut were changed to iterate through all the nodes in a multi-dut setup. However, for a T2 chassis, the multi-dut testbed contains a supervisor card as well, which doesn't have any BGP/PORT configuration. Thus, these checks fail for supervisor card.
  • cache cleanup:

    • If we change the inventory file and re-run pytest, the old cached data for the inventory is used instead of picking up the changes.

How did you do it?

  • sanity_check:
    • Iterate through frontend_nodes of duthosts instead of all the nodes.
  • cache cleanup:
    • Added fixture cleanup_cache_for_session that is called at the beginning of a session to remove the cached facts for all the DUTs in the testbed. This is not an automatic fixture, and is needed in the following scenarios:
      • Running tests where some 'facts' about the DUT that get cached are changed.
      • Running tests/regression without running test_pretest which has a test to clean up cache (PR#2978)
      • Test case development phase to work out testbed information changes.

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

…t session

- sanity_check:
    - The BGP and Interface sanity check should be done only on frontend_nodes. In a chassis
      the supervisor node has no BGP/PORT configuration.
- cache cleanup:
    - If we change the inventory file and re-run pytest, the old cached data for the inventory
      is used. Added fixture cleanup_cache_for_session that is called at the end of a session to
      remove the facts for all the DUTs in the testbed.
@yxieca
Copy link
Collaborator

yxieca commented Feb 15, 2021

@sanmalho-git I think your cache removal code has legit use cases. I suggest: make it not auto use, so test case developer can temporarily reference it until the test case is stable. Change the clean up to before test so that the testcase don't have to fail once before cleanup.

@yxieca
Copy link
Collaborator

yxieca commented Feb 16, 2021

/Azurepipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit f4b4c2d into sonic-net:master Feb 18, 2021
@sanmalho-git sanmalho-git deleted the fixtures branch February 18, 2021 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants