sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Adding -F flag for a test list file for testsuites

Open arista-nwolfe opened this issue 8 months ago • 2 comments

Adding a new option -F to run_tests.sh to pass a file containing tests. This option extracts the tests from the file and puts them into the TEST_CASES variable (used by -c argument). This opens the door to store files with subsets of tests (testsuites) to get coverage of certain areas without having to rerun all the tests.

Example use case:

> cat testsuites/platform_sanity
acl/test_acl.py::TestBasicAcl
decap/test_decap.py
fib/test_fib.py::test_fib::test_basic_fib
pfcwd/test_pfc_config.py::TestPfcConfig
pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_actions
qos/test_qos_sai.py::TestQosSai::testQosSaiDot1pQueueMapping
qos/test_qos_sai.py::TestQosSai::testQosSaiDscpQueueMapping
qos/test_qos_sai.py::TestQosSai::testQosSaiDwrr
qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueue
qos/test_qos_sai.py::TestQosSai::testQosSaiPfcXoffLimit
qos/test_qos_sai.py::TestQosSai::testQosSaiPfcXonLimit
qos/test_qos_sai.py::TestQosSai::testQosSaiQSharedWatermark
voq/test_fabric_reach.py
voq/test_voq_fabric_status_all.py
voq/test_voq_init.py
voq/test_voq_ipfwd.py::TestFPLinkFlap::test_front_panel_linkflap_port
voq/test_voq_ipfwd.py::TestTableValidation
voq/test_voq_ipfwd.py::TestVoqIPFwd
voq/test_voq_nbr.py::TestNeighborLinkFlap
voq/test_voq_nbr.py::test_voq_nbr::test_neighbor_clear_one
voq/test_voq_nbr.py::test_voq_nbr::test_neighbor_hw_mac_change
sudo ./run_tests.sh -n ardut -u -m debug -F testsuites/platform_sanity -x
TEST_CASES:            acl/test_acl.py::TestBasicAcl
decap/test_decap.py
fib/test_fib.py::test_fib::test_basic_fib
pfcwd/test_pfc_config.py::TestPfcConfig
pfcwd/test_pfcwd_function.py::TestPfcwdFunc::test_pfcwd_actions
qos/test_qos_sai.py::TestQosSai::testQosSaiDot1pQueueMapping
qos/test_qos_sai.py::TestQosSai::testQosSaiDscpQueueMapping
qos/test_qos_sai.py::TestQosSai::testQosSaiDwrr
qos/test_qos_sai.py::TestQosSai::testQosSaiLossyQueue
qos/test_qos_sai.py::TestQosSai::testQosSaiPfcXoffLimit
qos/test_qos_sai.py::TestQosSai::testQosSaiPfcXonLimit
qos/test_qos_sai.py::TestQosSai::testQosSaiQSharedWatermark
voq/test_fabric_reach.py
voq/test_voq_fabric_status_all.py
voq/test_voq_init.py
voq/test_voq_ipfwd.py::TestFPLinkFlap::test_front_panel_linkflap_port
voq/test_voq_ipfwd.py::TestTableValidation
voq/test_voq_ipfwd.py::TestVoqIPFwd
voq/test_voq_nbr.py::TestNeighborLinkFlap
voq/test_voq_nbr.py::test_voq_nbr::test_neighbor_clear_one
voq/test_voq_nbr.py::test_voq_nbr::test_neighbor_hw_mac_change
+ echo 'TEST_CASES_FILE:       testsuites/platform_sanity'
TEST_CASES_FILE:       testsuites/platform_sanity

arista-nwolfe avatar Jun 14 '24 20:06 arista-nwolfe