Skip to content

Commit

Permalink
Update platform tests for dpu (sonic-net#11811)
Browse files Browse the repository at this point in the history
Updated platform test list:

1. platform_tests/test_sensors.py
2. platform_tests/api/test_sfp.py
5. platform_tests/mellanox/test_check_sfp_presence.py
6. platform_tests/mellanox/test_check_sfp_eeprom.py

Change-Id: Id3ba4caea5801c9b7f17c4faf7660f531db08630
  • Loading branch information
JibinBao authored Apr 12, 2024
1 parent c453050 commit 7fc20e0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 11 deletions.
29 changes: 29 additions & 0 deletions ansible/group_vars/sonic/sku-sensors-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7002,3 +7002,32 @@ sensors_checks:
temp: []
psu_skips: {}
sensor_skip_per_version: {}

arm64-nvda_bf-9009d3b600cvaa:
alarms:
fan: [ ]
power: [ ]
temp: [ ]

compares:
power: [ ]
temp:

- - mlx5-pci-0301/asic/temp1_input
- mlx5-pci-0301/asic/temp1_crit

- - nvme-pci-0600/Composite/temp1_input
- nvme-pci-0600/Composite/temp1_crit

- - nvme-pci-0600/Sensor 1/temp2_input
- nvme-pci-0600/Sensor 1/temp2_max

- - mlx5-pci-0300/asic/temp1_input
- mlx5-pci-0300/asic/temp1_crit

non_zero:
fan: [ ]
power: [ ]
temp: [ ]
psu_skips: { }
sensor_skip_per_version: { }
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ platform_tests/api/test_psu_fans.py::TestPsuFans::test_set_fans_speed:
##### api/test_sfp.py #####
#######################################
platform_tests/api/test_sfp.py::TestSfpApi::test_get_error_description:
skip:
reason: "Unsupported platform API"
conditions:
- "asic_type in ['nvidia-bluefield']"
xfail:
reason: "Platform API 'get_error_description' not implemented"
conditions:
Expand All @@ -433,7 +437,7 @@ platform_tests/api/test_sfp.py::TestSfpApi::test_get_name:
skip:
reason: "Unsupported platform API"
conditions:
- "asic_type in ['mellanox']"
- "asic_type in ['mellanox', 'nvidia-bluefield']"

platform_tests/api/test_sfp.py::TestSfpApi::test_get_position_in_parent:
skip:
Expand All @@ -445,7 +449,7 @@ platform_tests/api/test_sfp.py::TestSfpApi::test_get_reset_status:
skip:
reason: "Unsupported platform API"
conditions:
- "asic_type in ['mellanox']"
- "asic_type in ['mellanox', 'nvidia-bluefield']"

platform_tests/api/test_sfp.py::TestSfpApi::test_get_rx_los:
skip:
Expand Down Expand Up @@ -507,17 +511,23 @@ platform_tests/api/test_sfp.py::TestSfpApi::test_get_voltage:
conditions:
- "asic_type in ['mellanox']"

platform_tests/api/test_sfp.py::TestSfpApi::test_lpmode:
skip:
reason: "Unsupported platform API"
conditions:
- "asic_type in ['nvidia-bluefield']"

platform_tests/api/test_sfp.py::TestSfpApi::test_power_override:
skip:
reason: "Unsupported platform API"
conditions:
- "asic_type in ['mellanox'] or platform in ['armhf-nokia_ixs7215_52x-r0']"
- "asic_type in ['mellanox', 'nvidia-bluefield'] or platform in ['armhf-nokia_ixs7215_52x-r0']"

platform_tests/api/test_sfp.py::TestSfpApi::test_reset:
skip:
reason: "Unsupported platform API"
conditions:
- "'sw_to3200k' in hwsku"
- "'sw_to3200k' in hwsku or asic_type in ['nvidia-bluefield']"

platform_tests/api/test_sfp.py::TestSfpApi::test_thermals:
skip:
Expand Down Expand Up @@ -737,7 +747,7 @@ platform_tests/mellanox:
skip:
reason: "Mellanox platform tests only supported on Mellanox devices"
conditions:
- "asic_type not in ['mellanox']"
- "asic_type not in ['mellanox', 'nvidia-bluefield']"

platform_tests/mellanox/test_reboot_cause.py:
skip:
Expand Down
18 changes: 13 additions & 5 deletions tests/platform_tests/mellanox/test_check_sfp_eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import allure

from tests.common.fixtures.conn_graph_facts import conn_graph_facts # noqa F401
from .util import parse_sfp_eeprom_infos, check_sfp_eeprom_info, is_support_dom, get_pci_cr0_path
from .util import parse_sfp_eeprom_infos, check_sfp_eeprom_info, is_support_dom, get_pci_cr0_path, get_pciconf0_path

pytestmark = [
pytest.mark.asic('mellanox'),
pytest.mark.asic('mellanox', 'nvidia-bluefield'),
pytest.mark.topology('any')
]

Expand All @@ -29,17 +29,25 @@ def sfp_test_intfs_to_dom_map(duthosts, rand_one_dut_hostname, conn_graph_facts,
conn_graph_facts["device_conn"][duthost.hostname].keys())

intf_with_dom_dict = {}

sfp_test_intfs_to_dom_map_dict = {}
pic_cr0_path = get_pci_cr0_path(duthost)
platform = duthost.facts['platform']
dpu_platform_list = ["arm64-nvda_bf-9009d3b600cvaa", "arm64-nvda_bf-9009d3b600svaa"]
pci_path = get_pciconf0_path(duthost) if platform in dpu_platform_list else get_pci_cr0_path(duthost)

for intf in sfp_test_intf_list:
if intf not in xcvr_skip_list[duthost.hostname]:
port_index = port_name_to_index_map[intf]
original_port_index = port_index
if port_index in intf_with_dom_dict:
inft_support_dom = intf_with_dom_dict[port_index]
else:
if platform in dpu_platform_list and port_index == '2':
pci_path = "{}.1".format(pci_path)
port_index = '1'
inft_support_dom = is_support_dom(
duthost, port_index, pic_cr0_path)
intf_with_dom_dict[port_index] = inft_support_dom
duthost, port_index, pci_path)
intf_with_dom_dict[original_port_index] = inft_support_dom
sfp_test_intfs_to_dom_map_dict[intf] = inft_support_dom

return sfp_test_intfs_to_dom_map_dict
Expand Down
2 changes: 1 addition & 1 deletion tests/platform_tests/mellanox/test_check_sfp_presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from tests.common.fixtures.conn_graph_facts import conn_graph_facts # noqa F401

pytestmark = [
pytest.mark.asic('mellanox'),
pytest.mark.asic('mellanox', 'nvidia-bluefield'),
pytest.mark.topology('any')
]

Expand Down
7 changes: 7 additions & 0 deletions tests/platform_tests/mellanox/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,10 @@ def get_pci_cr0_path(duthost):
This method is to get path for /dev/mst/*_pci_cr0
"""
return duthost.shell('ls /dev/mst/*_pci_cr0')['stdout'].strip()


def get_pciconf0_path(duthost):
"""
This method is to get path for /dev/mst/*_pciconf0
"""
return duthost.shell('ls /dev/mst/*_pciconf0')['stdout'].strip()

0 comments on commit 7fc20e0

Please sign in to comment.