Skip to content

[as7312-54x] Support platform API2.0 #6272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Feb 9, 2021

Conversation

jostar-yang
Copy link
Contributor

- Why I did it
Support platform API2.0.
- How I did it
Implement API2.0.
- How to verify it
Test each API item.
root@sonic:/home/admin# ./test_as7312_api2_py3.py
DEBUG:root:Test Chassis
DEBUG:root:get_name=Accton-AS7312-54X
DEBUG:root:get_base_mac=A8:2B:B5:52:D1:D6
DEBUG:root:get_serial_number=591254XK1727007
DEBUG:root:get_system_eeprom_info={'0x21': '5912-54XK-O-AC-F', '0x22': 'FP3ZZ5654010A', '0x23': '591254XK1727007', '0x24': 'A8:2B:B5:52:D1:D6', '0x25': '07/14/2017', '0x27': 'R01A', '0x2A': '73', '0x2B': 'Accton', '0x2C': 'TW', '0x2D': 'Edgecore', '0x2E': 'r0.1.0.11', '0x28': 'x86_64-accton_as7312_54x-r0', '0x29': '2016.08.00.04', '0xFE': '0x4FB600BC'}
DEBUG:root:get_reboot_cause=('REBOOT_CAUSE_NON_HARDWARE', 'Unknown')
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 =5
DEBUG:root:get_firmware_version1 =6
DEBUG:root:get_firmware_version2 =8
DEBUG:root:get_firmware_version3 =AS5912 V36 20180208T
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=0
DEBUG:root:fan 1 direction=exhaust
DEBUG:root:fan 1 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-2, presence=0
DEBUG:root:fan 2 direction=exhaust
DEBUG:root:fan 2 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-3, presence=0
DEBUG:root:fan 3 direction=exhaust
DEBUG:root:fan 3 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-4, presence=0
DEBUG:root:fan 4 direction=exhaust
DEBUG:root:fan 4 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-5, presence=0
DEBUG:root:fan 5 direction=exhaust
DEBUG:root:fan 5 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-6, presence=0
DEBUG:root:fan 6 direction=exhaust
DEBUG:root:fan 6 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-7, presence=0
DEBUG:root:fan 7 direction=exhaust
DEBUG:root:fan 7 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-8, presence=0
DEBUG:root:fan 8 direction=exhaust
DEBUG:root:fan 8 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-9, presence=0
DEBUG:root:fan 9 direction=exhaust
DEBUG:root:fan 9 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-10, presence=0
DEBUG:root:fan 10 direction=exhaust
DEBUG:root:fan 10 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-11, presence=0
DEBUG:root:fan 11 direction=exhaust
DEBUG:root:fan 11 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
DEBUG:root:fan-12, presence=0
DEBUG:root:fan 12 direction=exhaust
DEBUG:root:fan 12 speed()=0
DEBUG:root:set speed to fan-1
DEBUG:root:fan-1 speed()=0
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=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:psu dir path=/sys/bus/i2c/devices/11-005b/psu_hwmon_path
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:PSU-2
DEBUG:root:presence=1
DEBUG:root:get_name=PSU-2
DEBUG:root:get_powergood=0
DEBUG:root:get_voltage=12.05
DEBUG:root:get_current=8.20
DEBUG:root:get_power=98.00
DEBUG:root:get_temperature=35.000
DEBUG:root:get_voltage_high_threshold=12.36
DEBUG:root:get_voltage_low_threshold=11.62
DEBUG:root:psu:get_num_fans=1
DEBUG:root:psu:get_fan().get_presence=1
DEBUG:root:psu dir path=/sys/bus/i2c/devices/10-0058/psu_hwmon_path
DEBUG:root:psu:get_fan().get_direction=intake
DEBUG:root:psu:get_fan().get_speed=18
DEBUG:root:psu:get_num_thermals()=0
DEBUG:root:psu:get_temperature=35.000
DEBUG:root:
Thermal test
DEBUG:root:Thermal-1
DEBUG:root:get_temperature=53.000
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=32.000
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=47.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=40.500
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-48
DEBUG:root:platform_chassis.get_serial=APF14120026BU2
DEBUG:root:get_model()=599940002
DEBUG:root:get_name()=Ethernet48
DEBUG:root:get_rx_los=False
DEBUG:root:get_tx_fault()=False
DEBUG:root:get_tx_disable()=[True, True, True, True]
DEBUG:root:get_lp_mode=0
DEBUG:root:get_tx_disable_channel()=0xf
DEBUG:root:get_temperature=0.0
DEBUG:root:get_voltage=0.0
DEBUG:root:get_tx_bias=[0.0, 0.0, 0.0, 0.0]
DEBUG:root:get_rx_power=['N/A', 'N/A', 'N/A', 'N/A']
DEBUG:root:get_rx_power=['N/A', 'N/A', 'N/A', 'N/A']
DEBUG:root:get_reset_status()=1
- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

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

@lgtm-com
Copy link

lgtm-com bot commented Dec 22, 2020

This pull request introduces 11 alerts when merging 6572c6d into 1ebbf66 - view on LGTM.com

new alerts:

  • 6 for Except block handles 'BaseException'
  • 1 for Unnecessary pass
  • 1 for Unused local variable
  • 1 for Unused import
  • 1 for Redundant assignment
  • 1 for Wrong name for an argument in a class instantiation

@lgtm-com
Copy link

lgtm-com bot commented Dec 22, 2020

This pull request introduces 4 alerts when merging 8e150be into c146eea - view on LGTM.com

new alerts:

  • 1 for Except block handles 'BaseException'
  • 1 for Unused import
  • 1 for Redundant assignment
  • 1 for Wrong number of arguments in a class instantiation

Copy link
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 LGTM alerts (except "1 for Wrong number of arguments in a class instantiation" which appears to be a false alarm because the tool is referencing a different vendor's API implementation for the definition).

@lgtm-com
Copy link

lgtm-com bot commented Dec 23, 2020

This pull request introduces 4 alerts when merging 32b7faa into 2f1445e - view on LGTM.com

new alerts:

  • 4 for Unused import

@jleveque
Copy link
Contributor

Retest vs please

@jleveque
Copy link
Contributor

Retest vsimage please

jleveque
jleveque previously approved these changes Jan 11, 2021
@jleveque
Copy link
Contributor

Retest mellanox please

@jleveque
Copy link
Contributor

Retest vsimage please

jleveque
jleveque previously approved these changes Jan 12, 2021
@jostar-yang jostar-yang requested a review from lguohan as a code owner February 6, 2021 20:29
@jleveque jleveque changed the title [as7312-54x] Add to support platform API2.0 [as7312-54x] Support platform API2.0 Feb 9, 2021
@jleveque jleveque merged commit c54a03f into sonic-net:master Feb 9, 2021
daall pushed a commit that referenced this pull request Feb 16, 2021
Add platform 2.0 support for Accton as7312-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