Skip to content

Commit

Permalink
Add device type mark in some modules. (sonic-net#12496)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
In this PR, I add mark pytest.mark.device_type('physical') in some modules, which means the module can only be ran on physical testbeds.

The reasons are below:
* generic_config_updater/test_pfcwd_status.py
* PFCWD needs some counters, and these counters don't support kvm testbeds.
* generic_config_updater/test_pg_headroom_update.py
  In this test, it needs to execute command sonic-db-cli CONFIG_DB keys *BUFFER_PROFILE\\|pg_lossless* on DUT and gets the return value, but there the table BUFFER_PROFILE doesn't exist on kvm, thus this command returns None.
* platform_tests/api
  All the cases under platform_tests/api don't support kvm testbeds
* platform_tests/daemon
  The features to be tested under this folder are not enabled in x86_64-kvm_x86_64-r0.

How did you do it?
Add the mark pytest.mark.device_type('physical') in the module which only support physical testbed.
  • Loading branch information
yutongzhang-microsoft authored Apr 22, 2024
1 parent 0ad33ea commit fdcc9e3
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 16 deletions.
6 changes: 0 additions & 6 deletions .azure-pipelines/pr_test_scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ t0:
- generic_config_updater/test_mmu_dynamic_threshold_config_update.py
- generic_config_updater/test_monitor_config.py
- generic_config_updater/test_ntp.py
- generic_config_updater/test_pfcwd_interval.py
- generic_config_updater/test_portchannel_interface.py
- generic_config_updater/test_syslog.py
- generic_config_updater/test_vlan_interface.py
Expand All @@ -76,13 +75,8 @@ t0:
- pc/test_lag_2.py
- pc/test_po_cleanup.py
- pc/test_po_update.py
- platform_tests/api/test_module.py
- platform_tests/broadcom/test_ser.py
- platform_tests/counterpoll/test_counterpoll_watermark.py
- platform_tests/daemon/test_fancontrol.py
- platform_tests/daemon/test_ledd.py
- platform_tests/daemon/test_psud.py
- platform_tests/daemon/test_syseepromd.py
- platform_tests/fwutil/test_fwutil.py
- platform_tests/link_flap/test_cont_link_flap.py
- platform_tests/mellanox/test_check_sfp_eeprom.py
Expand Down
1 change: 1 addition & 0 deletions tests/generic_config_updater/test_pfcwd_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

logger = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions tests/generic_config_updater/test_pg_headroom_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

REGEX_MAC_ADDRESS = r'^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$'
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_chassis_fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

FAN_DIRECTION_INTAKE = "intake"
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

image_list = [
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_fan_drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

STATUS_LED_COLOR_GREEN = "green"
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_fan_drawer_fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

FAN_DIRECTION_INTAKE = "intake"
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

REGEX_MAC_ADDRESS = r'^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$'
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/api/test_psu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical'),
pytest.mark.disable_loganalyzer # disable automatic loganalyzer
]

Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_psu_fans.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

FAN_DIRECTION_INTAKE = "intake"
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]


Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]


Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

pytestmark = [
pytest.mark.disable_loganalyzer, # disable automatic loganalyzer
pytest.mark.topology('any')
pytest.mark.topology('any'),
pytest.mark.device_type('physical')
]

logger = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/daemon/test_chassisd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

pytestmark = [
pytest.mark.topology('t2'),
pytest.mark.device_type('physical')
]

expected_running_status = "RUNNING"
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/daemon/test_fancontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical'),
pytest.mark.sanity_check(skip_sanity=True),
pytest.mark.disable_loganalyzer
]
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/daemon/test_ledd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical'),
pytest.mark.sanity_check(skip_sanity=True),
pytest.mark.disable_loganalyzer
]
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/daemon/test_pcied.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical'),
pytest.mark.sanity_check(skip_sanity=True),
pytest.mark.disable_loganalyzer
]
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/daemon/test_psud.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical'),
pytest.mark.sanity_check(skip_sanity=True),
pytest.mark.disable_loganalyzer
]
Expand Down
1 change: 1 addition & 0 deletions tests/platform_tests/daemon/test_syseepromd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('physical'),
pytest.mark.sanity_check(skip_sanity=True),
pytest.mark.disable_loganalyzer
]
Expand Down

0 comments on commit fdcc9e3

Please sign in to comment.