[DX010 platform] fix dx010 platform testcase issues (#13595) (#13778)

Why I did it
1. fix chassis test_set_fans_led case
2. fix chassis get_name case mismatch issue
3. fix fan_drawer test_set_fans_speed
4. fix component test_components test case

How I did it
Add corresponding configuration into chassis json file

How to verify it
Run platform tests cases to verify these failure cases

Co-authored-by: Ikki Zhu <79439153+qnos@users.noreply.github.com>
This commit is contained in:
mssonicbld 2023-02-11 10:18:00 +08:00 committed by GitHub
parent 49aa8776d4
commit e44b255555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 92 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{
"chassis": {
"name": "Celestica-DX010-C32",
"name": "DX010",
"status_led": {
"controllable": true,
"colors": ["green", "off"]
@ -18,6 +18,9 @@
{
"name": "CPLD4"
},
{
"name": "CPLD5"
},
{
"name": "BIOS"
}
@ -123,10 +126,22 @@
},
"fans": [
{
"name": "FAN-1F"
"name": "FAN-1F",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
},
{
"name": "FAN-1R"
"name": "FAN-1R",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
}
]
},
@ -138,10 +153,22 @@
},
"fans": [
{
"name": "FAN-2F"
"name": "FAN-2F",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
},
{
"name": "FAN-2R"
"name": "FAN-2R",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
}
]
},
@ -153,10 +180,22 @@
},
"fans": [
{
"name": "FAN-3F"
"name": "FAN-3F",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
},
{
"name": "FAN-3R"
"name": "FAN-3R",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
}
]
},
@ -168,10 +207,22 @@
},
"fans": [
{
"name": "FAN-4F"
"name": "FAN-4F",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
},
{
"name": "FAN-4R"
"name": "FAN-4R",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
}
]
},
@ -183,10 +234,22 @@
},
"fans": [
{
"name": "FAN-5F"
"name": "FAN-5F",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
},
{
"name": "FAN-5R"
"name": "FAN-5R",
"status_led": {
"controllable": false
},
"speed": {
"controllable": false
}
}
]
}

View File

@ -1,6 +1,6 @@
{
"chassis": {
"Seastone-DX010": {
"DX010": {
"component": {
"CPLD1": {},
"CPLD2": {},

View File

@ -270,7 +270,7 @@ class Chassis(ChassisBase):
Returns:
string: The name of the device
"""
return self._api_helper.hwsku
return self._eeprom.get_product_name()
def get_presence(self):
"""

View File

@ -131,6 +131,9 @@ class Tlv(eeprom_tlvinfo.TlvInfoDecoder):
def get_eeprom(self):
return self._valid_tlv(self._eeprom)
def get_product_name(self):
return self._eeprom.get('0x21', NULL)
def get_pn(self):
return self._eeprom.get('0x22', NULL)

View File

@ -2202,3 +2202,16 @@ class Sfp(SfpBase):
A boolean value, True if replaceable
"""
return True
def get_error_description(self):
"""
Retrives the error descriptions of the SFP module
Returns:
String that represents the current error descriptions of vendor specific errors
In case there are multiple errors, they should be joined by '|',
like: "Bad EEPROM|Unsupported cable"
"""
if not self.get_presence():
return self.SFP_STATUS_UNPLUGGED
return self.SFP_STATUS_OK