Skip to content

Commit

Permalink
[DX010 platform] fix dx010 platform testcase issues (#13595)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
qnos authored and qiluo-msft committed Feb 16, 2023
1 parent 9731aa3 commit 2135c6e
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 13 deletions.
85 changes: 74 additions & 11 deletions device/celestica/x86_64-cel_seastone-r0/platform.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chassis": {
"name": "Celestica-DX010-C32",
"name": "DX010",
"status_led": {
"controllable": true,
"colors": ["green", "off"]
Expand All @@ -18,6 +18,9 @@
{
"name": "CPLD4"
},
{
"name": "CPLD5"
},
{
"name": "BIOS"
}
Expand Down Expand Up @@ -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
}
}
]
},
Expand All @@ -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
}
}
]
},
Expand All @@ -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
}
}
]
},
Expand All @@ -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
}
}
]
},
Expand All @@ -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
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chassis": {
"Seastone-DX010": {
"DX010": {
"component": {
"CPLD1": {},
"CPLD2": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def get_name(self):
Returns:
string: The name of the device
"""
return self._api_helper.hwsku
return self._eeprom.get_product_name()

def get_presence(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def _valid_tlv(self, eeprom_data):
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)

Expand Down
13 changes: 13 additions & 0 deletions device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2202,3 +2202,16 @@ def is_replaceable(self):
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

0 comments on commit 2135c6e

Please sign in to comment.