sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
741 stars 1.43k forks source link

Sonic mgmt test cases failed due to unable to get expected values from platform.json file for s5232f platform. #20446

Open arun1355492 opened 1 month ago

arun1355492 commented 1 month ago

Description

Below Sonic mgmt tests failed, when run on physical DUT: test_chassis.py::TestChassisApi::test_get_name test_chassis.py::TestChassisApi::test_status_led test_chassis_fans.py::TestChassisFans::test_get_fans_target_speed test_component.py::TestComponentApi::test_get_name test_fan_drawer_fans.py::TestFanDrawerFans::test_get_name test_fan_drawer.py::TestFanDrawerApi::test_get_name test_fan_drawer.py::TestFanDrawerApi::test_get_num_fans test_fan_drawer.py::TestFanDrawerApi::test_set_fan_drawers_led test_psu.py::TestPsuApi::test_get_name test_psu_fans.py::TestPsuFans::test_get_speed All testcases test_sfp.py::TestSfpApi
test_thermal.py::TestThermalApi::test_get_name test_thermal.py::TestThermalApi::test_get_minimum_recorded test_thermal.py::TestThermalApi::test_get_maximum_recorded test_thermal.py::TestThermalApi::test_set_low_threshold test_thermal.py::TestThermalApi::test_set_high_threshold

Steps to reproduce the issue:

  1. Run the sonic mgmt test case in a physical DUT.
  2. Also in PDDF mode: Enable the PDDF mode on the switch using the command and run sudo pddf_util.py -d switch-pddf. after enabling the pddf wait for system ready status. Run the test case in a physical DUT.

Describe the results you received:

platform_tests/api/test_chassis.py:129:
---------------------------------------------------------------------------------------------------------------------------------------------------
self = <tests.platform_tests.api.test_chassis.TestChassisApi object at 0x7fa5493060d0>, duthost = <MultiAsicSonicHost dt-s5232f-07>, key = 'name', value = 'S5232F-ON'

    def compare_value_with_platform_facts(self, duthost, key, value):
        expected_value = None

        if duthost.facts.get("chassis"):
            expected_value = duthost.facts.get("chassis").get(key)

>       pytest_assert(expected_value is not None,
                      "Unable to get expected value for '{}' from platform.json file".format(key))
E       Failed: Unable to get expected value for 'name' from platform.json file

duthost    = <MultiAsicSonicHost dt-s5232f-07>
expected_value = None
key        = 'name'
self       = <tests.platform_tests.api.test_chassis.TestChassisApi object at 0x7fa5493060d0>
value      = 'S5232F-ON'

platform_tests/api/test_chassis.py:95: Failed

Describe the results you expected:

The test cases should pass. platform_tests/api/test_chassis.py::TestChassisApi::test_get_name[dt-s5232f-07] PASSED

judyjoseph commented 1 month ago

@jeff-yin please check if the platform.json file is missing any attribute, thanks

jeff-yin commented 1 month ago

@judyjoseph can you describe a little more?

We were initially thinking that this is a limitation of PDDF not providing certain API capabilities. I know that S5232 and S5248 are currently lacking platform.json files, as mentioned in https://github.com/sonic-net/sonic-buildimage/pull/18849

But are you saying this issue will be resolved by platform.json?