Skip to content

[as5835-54x] Add to support API2.0#6480

Merged
jleveque merged 13 commits intosonic-net:masterfrom
jostar-yang:as5835-54x_20210118_api2.0
May 28, 2021
Merged

[as5835-54x] Add to support API2.0#6480
jleveque merged 13 commits intosonic-net:masterfrom
jostar-yang:as5835-54x_20210118_api2.0

Conversation

@jostar-yang
Copy link
Copy Markdown
Contributor

@jostar-yang jostar-yang commented Jan 18, 2021

- Why I did it
Support API2.0
- How I did it
Implement API2.0 needed code
- How to verify it
Test each API.
root@sonic:/home/admin# ./test_as5835-54x_api2.py
DEBUG:root:Test Chassis
DEBUG:root:get_name=Accton-AS5835-54X
DEBUG:root:get_base_mac=80:A2:35:D2:46:B5
DEBUG:root:get_serial_number=583554X1922008
DEBUG:root:get_system_eeprom_info={'0xFE': '0x54E5C8B0', '0x28': 'x86_64-accton_as5835_54x-r0', '0x29': '2019.08.00.01', '0x22': 'FP1ZZ56540B7A', '0x23': '583554X1922008', '0x21': '5835-54X-O-AC-F', '0x27': 'R0BA', '0x24': '80:A2:35:D2:46:B5', '0x25': '06/21/2019', '0x2B': 'Accton', '0x2C': 'TW', '0x2A': '256', '0x2D': 'Edgecore', '0x2E': 'b.b.1.0'}
DEBUG:root:get_reboot_cause=('REBOOT_CAUSE_NON_HARDWARE', "User issued 'reboot' command [User: admin, Time: Wed 13 Jan 2021 04:50:43 PM UTC]")
DEBUG:root:
Test Component
DEBUG:root:get_num_components=4
DEBUG:root:get_name=CPLD1
DEBUG:root:get_name=CPLD2
DEBUG:root:get_name=CPLD3
DEBUG:root:get_name=BIOS
DEBUG:root:get_firmware_version0 =2
DEBUG:root:get_firmware_version1 =2
DEBUG:root:get_firmware_version2 =2
DEBUG:root:get_firmware_version3 =AS5835 V37 20190117
DEBUG:root:get_description=CPLD 1
DEBUG:root:get_description=CPLD 2
DEBUG:root:get_description=CPLD 3
DEBUG:root:get_description=Basic Input/Output System
DEBUG:root:
Fan test
DEBUG:root:fan-1, presence=1
DEBUG:root:fan 1 direction=exhaust
DEBUG:root:fan 1 speed()=40
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-2, presence=1
DEBUG:root:fan 2 direction=exhaust
DEBUG:root:fan 2 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-3, presence=1
DEBUG:root:fan 3 direction=intake
DEBUG:root:fan 3 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-4, presence=1
DEBUG:root:fan 4 direction=intake
DEBUG:root:fan 4 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-5, presence=1
DEBUG:root:fan 5 direction=intake
DEBUG:root:fan 5 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-6, presence=1
DEBUG:root:fan 6 direction=intake
DEBUG:root:fan 6 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-7, presence=1
DEBUG:root:fan 7 direction=intake
DEBUG:root:fan 7 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=40
DEBUG:root:fan-8, presence=1
DEBUG:root:fan 8 direction=intake
DEBUG:root:fan 8 speed()=40
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-9, presence=1
DEBUG:root:fan 9 direction=intake
DEBUG:root:fan 9 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:fan-10, presence=1
DEBUG:root:fan 10 direction=intake
DEBUG:root:fan 10 speed()=50
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=50
DEBUG:root:
PSU test
DEBUG:root:PSU-1
DEBUG:root:presence=1
DEBUG:root:get_name=PSU-1
DEBUG:root:get_powergood=1
DEBUG:root:get_voltage=11.86
DEBUG:root:get_current=7.17
DEBUG:root:get_power=81.00
DEBUG:root:get_temperature=31.000
DEBUG:root:get_voltage_high_threshold=1472.00
DEBUG:root:get_voltage_low_threshold=-768.00
DEBUG:root:psu:get_num_fans=1
DEBUG:root:psu:get_fan().get_presence=1
DEBUG:root:dir_str=/sys/bus/i2c/devices/11-0058/psu_fan_dir, val=F2B
DEBUG:root:psu:get_fan().get_direction=exhaust
DEBUG:root:psu:get_fan().get_speed=12
DEBUG:root:psu:get_num_thermals()=0
DEBUG:root:psu:get_temperature=31.000
DEBUG:root:PSU-2
DEBUG:root:presence=0
DEBUG:root:get_name=PSU-2
DEBUG:root:get_powergood=0
DEBUG:root:get_voltage=0.00
DEBUG:root:get_current=0.00
DEBUG:root:get_power=0.00
DEBUG:root:get_temperature=0.000
DEBUG:root:get_voltage_high_threshold=0.00
DEBUG:root:get_voltage_low_threshold=0.00
DEBUG:root:psu:get_num_fans=1
DEBUG:root:psu:get_fan().get_presence=1
DEBUG:root:dir_str=/sys/bus/i2c/devices/12-005b/psu_fan_dir, val=
DEBUG:root:psu:get_fan().get_direction=intake
DEBUG:root:psu:get_fan().get_speed=0
DEBUG:root:psu:get_num_thermals()=0
DEBUG:root:psu:get_temperature=0.000
DEBUG:root:
Thermal test
DEBUG:root:Thermal-1
DEBUG:root:get_temperature=32.500
DEBUG:root:high_threshold=85.000
DEBUG:root:get name=Temp sensor 1
DEBUG:root:get_presence=True
DEBUG:root:get_status=True
DEBUG:root:Thermal-2
DEBUG:root:get_temperature=25.500
DEBUG:root:high_threshold=84.000
DEBUG:root:get name=Temp sensor 2
DEBUG:root:get_presence=True
DEBUG:root:get_status=True
DEBUG:root:Thermal-3
DEBUG:root:get_temperature=29.000
DEBUG:root:high_threshold=83.000
DEBUG:root:get name=Temp sensor 3
DEBUG:root:get_presence=True
DEBUG:root:get_status=True
DEBUG:root:Thermal-4
DEBUG:root:get_temperature=27.000
DEBUG:root:high_threshold=82.000
DEBUG:root:get name=Temp sensor 4
DEBUG:root:get_presence=True
DEBUG:root:get_status=True
DEBUG:root:
SFP test
DEBUG:root:Port-1
DEBUG:root:platform_chassis.get_serial=U31649000020
DEBUG:root:get_model()=M0OEC5402T04Z
DEBUG:root:get_name()=Ethernet0
DEBUG:root:get_rx_los=0
DEBUG:root:get_tx_fault()=0
DEBUG:root:get_tx_disable()=1
DEBUG:root:get_lp_mode=0
DEBUG:root:get_tx_disable_channel()=0x0
DEBUG:root:Port-12
DEBUG:root:platform_chassis.get_serial=U31649000020
DEBUG:root:get_model()=M0OEC5402T04Z
DEBUG:root:get_name()=Ethernet11
DEBUG:root:get_rx_los=0
DEBUG:root:get_tx_fault()=0
DEBUG:root:get_tx_disable()=1
DEBUG:root:get_lp_mode=0
DEBUG:root:get_tx_disable_channel()=0x0
- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jan 18, 2021

This pull request introduces 2 alerts when merging cbf1975 into 9b2bc88 - view on LGTM.com

new alerts:

  • 1 for Unused import
  • 1 for Syntax error

@jostar-yang jostar-yang requested a review from lguohan as a code owner February 6, 2021 20:29
Copy link
Copy Markdown
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix merge conflict

@jleveque jleveque merged commit 0c5c487 into sonic-net:master May 28, 2021
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
Add platform API 2.0 support for as5835-54x platform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants