Skip to content
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

[multi-asic] show_transceiver changes #1081

Merged
merged 6 commits into from
Sep 4, 2020

Conversation

judyjoseph
Copy link
Contributor

@judyjoseph judyjoseph commented Aug 28, 2020

- What I did
Show transceiver changes
Rearranging of common functions in config/main.py to py-common, utilities_common
Dependent on another PR (sonic-net/sonic-buildimage#5269)

- How I did it

- How to verify it

admin@str--acs-1:~$ sudo show interfaces transceiver eeprom 
Ethernet0: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2018-10-27 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110402104
        Vendor Rev: 
        Vendor SN: 1830031430

Ethernet4: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2018-10-27 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110402104
        Vendor Rev: 
        Vendor SN: 1830031360
.....

admin@str--acs-1:~$ sudo show interfaces transceiver eeprom -d
Ethernet0: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2018-10-27 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110402104
        Vendor Rev: 
        Vendor SN: 1830031430
        ChannelMonitorValues: 
                RX1Power: -infdBm
                RX2Power: -infdBm
                RX3Power: -infdBm
                RX4Power: -infdBm
                TX1Bias: 0.0000mA
                TX2Bias: 0.0000mA
                TX3Bias: 0.0000mA
                TX4Bias: 0.0000mA
        ChannelThresholdValues: 
                RxPowerHighAlarm  : 8.1647dBm
                RxPowerHighWarning: 8.1647dBm
                RxPowerLowAlarm   : 8.1647dBm
                RxPowerLowWarning : 8.1647dBm
                TxBiasHighAlarm   : 131.0700mA
                TxBiasHighWarning : 131.0700mA
                TxBiasLowAlarm    : 131.0700mA
                TxBiasLowWarning  : 131.0700mA
        ModuleMonitorValues: 
                Temperature: 1.5039C
                Vcc: 0.0000Volts
        ModuleThresholdValues: 
                TempHighAlarm  : -0.0039C
                TempHighWarning: -0.0039C
                TempLowAlarm   : -0.0039C
                TempLowWarning : -0.0039C
                VccHighAlarm   : 6.5535Volts
                VccHighWarning : 6.5535Volts
                VccLowAlarm    : 6.5535Volts
                VccLowWarning  : 6.5535Volts
.....
admin@str--acs-1:~$ sudo show interfaces transceiver eeprom -n asic0
Ethernet0: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2018-10-27 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110402104
        Vendor Rev: 
        Vendor SN: 1830031430

Ethernet4: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2018-10-27 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110402104
        Vendor Rev: 
        Vendor SN: 1830031360

Ethernet8: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: Unspecified
        Extended Identifier: Power Class 1(1.5W max)
        Extended RateSelect Compliance: QSFP+ Rate Select Version 1
        Identifier: QSFP+ or later
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: 
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Fibre Channel Speed: 1200 Mbytes/Sec
                Fibre Channel link length/Transmitter Technology: Electrical inter-enclosure (EL)
                Fibre Channel transmission media: Twin Axial Pair (TW)
        Vendor Date Code(YYYY-MM-DD Lot): 2018-10-27 
        Vendor Name: Molex Inc.
        Vendor OUI: 00-09-3a
        Vendor PN: 1110402104
        Vendor Rev: 
        Vendor SN: 1830031371


admin@str--acs-1:~$ sudo show interfaces transceiver presence --help
Usage: show interfaces transceiver presence [OPTIONS] [INTERFACENAME]

  Show interface transceiver presence

Options:
  -n, --namespace [asic0|asic1|asic2|asic3|asic4|asic5]
                                  Namespace name or all
  --verbose                       Enable verbose output
  -?, -h, --help                  Show this message and exit.
admin@str--acs-1:~$ sudo show interfaces transceiver presence 
Port         Presence
-----------  -----------
Ethernet0    Present
Ethernet4    Present
Ethernet8    Present
Ethernet12   Present
Ethernet16   Present
Ethernet20   Present
Ethernet24   Present
Ethernet28   Present
Ethernet32   Present
Ethernet36   Present
Ethernet40   Present
Ethernet44   Present
Ethernet48   Present
Ethernet52   Present
Ethernet56   Present
Ethernet60   Present
Ethernet64   Present
Ethernet68   Present
Ethernet72   Present
Ethernet76   Present
Ethernet80   Present
Ethernet84   Present
Ethernet88   Present
Ethernet92   Present
Ethernet96   Present
Ethernet100  Present
Ethernet104  Present
Ethernet108  Present
Ethernet112  Present
Ethernet116  Not present
Ethernet120  Present
Ethernet124  Present
Ethernet128  Present
Ethernet132  Present
Ethernet136  Present
Ethernet140  Present
Ethernet144  Present
Ethernet148  Present
Ethernet152  Present
Ethernet156  Present
Ethernet160  Present
Ethernet164  Present
Ethernet168  Present
Ethernet172  Present
Ethernet176  Present
Ethernet180  Present
Ethernet184  Present
Ethernet188  Present
Ethernet192  Present
Ethernet196  Present
Ethernet200  Present
Ethernet204  Present
Ethernet208  Present
Ethernet212  Present
Ethernet216  Present
Ethernet220  Present
Ethernet224  Present
Ethernet228  Present
Ethernet232  Present
Ethernet236  Not present
Ethernet240  Present
Ethernet244  Present
Ethernet248  Present
Ethernet252  Present
admin@str--acs-1:~$ sudo show interfaces transceiver presence -n asic0
Port        Presence
----------  ----------
Ethernet0   Present
Ethernet4   Present
Ethernet8   Present
Ethernet12  Present
Ethernet16  Present
Ethernet20  Present
Ethernet24  Present
Ethernet28  Present
Ethernet32  Present
Ethernet36  Present
Ethernet40  Present
Ethernet44  Present
Ethernet48  Present
Ethernet52  Present
Ethernet56  Present
Ethernet60  Present

admin@str--acs-1:~$ sudo show interfaces transceiver lpmode --help
Usage: show interfaces transceiver lpmode [OPTIONS] [INTERFACENAME]

  Show interface transceiver low-power mode status

Options:
  --verbose       Enable verbose output
  -?, -h, --help  Show this message and exit.
admin@str--acs-1:~$ sudo show interfaces transceiver lpmode
Port         Low-power Mode
-----------  ----------------
Ethernet0    On
Ethernet4    Off
Ethernet8    Off
Ethernet12   Off
Ethernet16   Off
Ethernet20   Off
Ethernet24   Off
Ethernet28   Off
Ethernet32   Off
Ethernet36   Off
Ethernet40   Off
Ethernet44   Off
Ethernet48   Off
Ethernet52   Off
Ethernet56   Off
Ethernet60   Off
Ethernet64   Off
Ethernet68   Off
Ethernet72   Off
Ethernet76   Off
Ethernet80   Off
Ethernet84   Off
Ethernet88   Off
Ethernet92   Off
Ethernet96   Off
Ethernet100  Off
Ethernet104  Off
Ethernet108  Off
Ethernet112  Off
Ethernet116  Off
Ethernet120  Off
Ethernet124  Off
Ethernet128  Off
Ethernet132  Off
Ethernet136  Off
Ethernet140  Off
Ethernet144  Off
Ethernet148  Off
Ethernet152  Off
Ethernet156  Off
Ethernet160  Off
Ethernet164  Off
Ethernet168  Off
Ethernet172  Off
Ethernet176  Off
Ethernet180  Off
Ethernet184  Off
Ethernet188  Off
Ethernet192  Off
Ethernet196  Off
Ethernet200  Off
Ethernet204  Off
Ethernet208  Off
Ethernet212  Off
Ethernet216  Off
Ethernet220  Off
Ethernet224  Off
Ethernet228  Off
Ethernet232  Off
Ethernet236  Off
Ethernet240  Off
Ethernet244  Off
Ethernet248  Off
Ethernet252  Off

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

Rearranging of common functions in config/main.py yo py-common, utilities_common
@lgtm-com
Copy link

lgtm-com bot commented Aug 28, 2020

This pull request introduces 1 alert and fixes 1 when merging 41c16a0 into 62e44d9 - view on LGTM.com

new alerts:

  • 1 for Unused import

fixed alerts:

  • 1 for Unused import

@judyjoseph judyjoseph marked this pull request as ready for review August 31, 2020 00:58
@lgtm-com
Copy link

lgtm-com bot commented Aug 31, 2020

This pull request introduces 1 alert and fixes 1 when merging 4de1197 into 60fcab9 - view on LGTM.com

new alerts:

  • 1 for Unused import

fixed alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 31, 2020

This pull request fixes 1 alert when merging 98f145f into 60fcab9 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@judyjoseph
Copy link
Contributor Author

retest this please

@lgtm-com
Copy link

lgtm-com bot commented Aug 31, 2020

This pull request fixes 1 alert when merging 83d5832 into 60fcab9 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

As comments

scripts/sfpshow Outdated Show resolved Hide resolved
scripts/sfpshow Show resolved Hide resolved
tests/mock_tables/mock_multi_asic.py Outdated Show resolved Hide resolved
tests/sfp_test.py Outdated Show resolved Hide resolved
tests/sfp_test.py Show resolved Hide resolved
utilities_common/multi_asic.py Outdated Show resolved Hide resolved
@arlakshm
Copy link
Contributor

arlakshm commented Aug 31, 2020

Do we need to support the lpmode commands as well ?

Yes it is supported in multi-asic platforms. There is no change in implementation as it get the info from platform plugins. The sfp platform module was updated earlier (part of pmon changes) to get the list of all the interfaces

@lgtm-com
Copy link

lgtm-com bot commented Sep 2, 2020

This pull request fixes 1 alert when merging c93ebc3 into 12f0d07 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@judyjoseph
Copy link
Contributor Author

retest this please

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

lgtm

@judyjoseph judyjoseph merged commit 96cb359 into sonic-net:master Sep 4, 2020
@judyjoseph judyjoseph deleted the show_transceiver branch September 4, 2020 15:27
judyjoseph added a commit to judyjoseph/sonic-utilities that referenced this pull request Sep 6, 2020
judyjoseph added a commit to judyjoseph/sonic-utilities that referenced this pull request Sep 14, 2020
@abdosi
Copy link
Contributor

abdosi commented Sep 19, 2020

@judyjoseph Please create PR for 201911.

abdosi pushed a commit that referenced this pull request Sep 19, 2020
…ceiver (#1087)

* Merging the Multi asic platform changes for interface, portchannel commands ( #878) into 201911 branch

* Merging the Multi asic platform changes show transceiver command (PR #1081) into 201911 branch

* Updated needed in 201911

* Correcting the changes done to sfputil/main.py

* Remove unused import
@judyjoseph
Copy link
Contributor Author

@judyjoseph Please create PR for 201911.

It is already taken care of by this PR #1087 ( as there were some dependencies )


def test_sfp_presence_with_ns(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["interfaces"].commands["transceiver"].commands["presence"], ["Ethernet0 -n asic0"])
Copy link
Contributor

Choose a reason for hiding this comment

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

["Ethernet0 -n asic0"]

I think this is incorrect way to parse arguments. Ref: https://click.palletsprojects.com/en/8.1.x/testing/#id4

expected = "Ethernet200: SFP EEPROM Not detected"
assert result_lines == expected

def test_sfp_eeprom_with_ns(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

def test_sfp_eeprom_with_ns(self):

duplicate UT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants