Skip to content

[pytest] Improve infra and update the platform scripts to use the new infra#1072

Merged
yxieca merged 5 commits intosonic-net:masterfrom
wangxin:pytest-infra-platform
Aug 22, 2019
Merged

[pytest] Improve infra and update the platform scripts to use the new infra#1072
yxieca merged 5 commits intosonic-net:masterfrom
wangxin:pytest-infra-platform

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Aug 17, 2019

Description of PR

Summary:
Fixes # (issue)

Improvements:

  • Add testbed_devices fixture
  • Add common folder for reusable libraries
  • Use OO design to abstract and encapsulate behavior for various devices in testbed
  • Improve code reuse by the OO design and common libraries
  • Add support to run ansible module asynchronously
  • In devices.AnsibleHostBase, use the improvement of module_ignore_errors by dawnbeauty
  • Update the platform scripts to use the improved pytest infrastructure
  • Add a few Mellanox specific testing scripts for completeness and demonstration

Type of change

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

Approach

How did you do it?

Added a common subfolder under sonic-mgmt/tests to hold common library modules. In the sonic-mgmt/tests/common/devices.py, added couple of classes to different devices may be used in testbed. The base class AnsibleHostBase encapsulate the behavior previously defined in ansible_host.py. Some other classes like SonicHost inherit from AnsibleHostBase. The SonicHost class can be extended with more methods for frequently used functions.

How did you verify/test it?

Tested on Mellanox platform.

Any platform specific information?

The scripts under sonic-mgmt/tests/platform/mellanox are specific for Mellanox platforms.

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

The platform scripts support all the current topologies.

Documentation

… infra

Improvements:
* Add testbed_devices fixture
* Add common folder for reusable libraries
* Use OO design to abstract and encapsulate behavior for various devices in testbed
* Improve code reuse by the OO design and common libraries
* Add support to run ansible module asynchronously
* In devices.AnsibleHostBase, use the improvement of module_ignore_errors by dawnbeauty
* Update the platform scripts to use the improved pytest infrastructure
* Add a few Mellanox specific testing scripts for completeness and demonstration
@wangxin
Copy link
Collaborator Author

wangxin commented Aug 19, 2019

@lguohan Would you please kindly review this PR?

@yxieca yxieca merged commit 55f35f9 into sonic-net:master Aug 22, 2019
@wangxin wangxin deleted the pytest-infra-platform branch March 28, 2020 03:10
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…submodule head (sonic-net#11761)

linkmgrd:
* 476f85e 2022-08-17 | Update linkmgr health after getting default route update (sonic-net#117) (HEAD -> 202205, github/202205) [Longxiang Lyu]
* fc589e9 2022-08-17 | Use `table` to toggle peer forwarding state (sonic-net#108) (sonic-net#120) [Longxiang Lyu]
* bcb5a56 2022-08-17 | Fix azure pipeline (sonic-net#118) (sonic-net#121) [Longxiang Lyu]

swss:
* ef3a601 2022-08-17 | [muxorch] Returning true if nbr in skip_neighbor_ in isNeighborActive() (sonic-net#2415) (HEAD -> 202205) [Nikola Dancejic]

sairedis:
* aed01cd 2022-08-12 | Fix: missing sonic-db-cli in docker-sonic-vs image (sonic-net#1072) (sonic-net#1104) (github/202205) [Hua Liu]

platform-daemon:
* 5a68073 2022-08-01 | Xcvrd changes to support 400G ZR configuration (sonic-net#270) (HEAD -> 202205) [Prince George]

swsssdk:
* ca785a2 2022-06-01 | Remove sonic-db-cli (sonic-net#122) (HEAD -> 202205, origin/202205) [Hua Liu]

Signed-off-by: Ying Xie <[email protected]>

Signed-off-by: Ying Xie <[email protected]>
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.

3 participants