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

[config][show] cli support for retrieving ber, eye-info and configuring prbs, loopback on Y-cable #1386

Merged
merged 16 commits into from
Feb 4, 2021

Conversation

vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Jan 25, 2021

Summary:
This PR provides the support for adding CLI commands for configuring prbs, loopback and showing the BER and Eye info of the muxcable.
In particular these Cli commands are supported:
show muxcable eyeinfo <portnumber><target>
show muxcable berinfo <portnumber> <target>

config muxcable prbs <portnumber> <target> <mode> <lanemap>
config muxcable loopback <portnumber> <target> <lanemap>

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

added the changes in sonic-utilities/show and sonic-utilities/config by changing the muxcable.py

What is the motivation for this PR?

To add the support for Cli for muxcable to be utilized for configuring prbs, loopback modes and showing the ber, eye info of all the Port/Ports on a muxcable.

How did you do it?

Added the changes inside sonic-utilities and tested it on the testbed

How did you verify/test it?

Ran the cli commands on an Arista7260cx3 testbed with Gemini cable

Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com

eye info, configure prbs and loopback

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 marked this pull request as draft January 25, 2021 23:55
config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
show/muxcable.py Outdated Show resolved Hide resolved
show/muxcable.py Outdated Show resolved Hide resolved
show/muxcable.py Outdated Show resolved Hide resolved
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
config/muxcable.py Outdated Show resolved Hide resolved
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
show/muxcable.py Outdated

if os.geteuid() != 0:
click.echo("Root privileges are required for this operation")
sys.exit(CONFIG_FAIL)
Copy link
Contributor

Choose a reason for hiding this comment

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

CONFIG_SUCCESSFUL / CONFIG_FAIL names don't really apply to the show command, as nothing is being configured. Can we change them to EXIT_SUCCESS and EXIT_FAILURE, or similar? And what is the difference between the CONFIG_* values and the STATUS_* codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed. changed these to EXIT_FAILURE . Actually all these error codes require rework now that I read your comment. Originally i wrote STATUS_ and CONFIG_ to differentiate between
show muxcable status and
show muxcable config but they are confusing as we are not configuring everything in config. But hwproxy now already has the error codes handed over. Maybe just rename them and keep the codes(integer value) as is ?

jleveque added a commit to sonic-net/sonic-buildimage that referenced this pull request Jan 28, 2021
**- Why I did it**

sonic-utilities will become dependent upon sonic-platform-common as of sonic-net/sonic-utilities#1386.

**- How I did it**

- Add sonic-platform-common as a dependency in docker-sonic-vs.mk
- Additionally, no longer install Python 2 packages of swsssdk and sonic-py-common, as they should no longer be needed.
@vdahiya12
Copy link
Contributor Author

Restest this please

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12 vdahiya12 marked this pull request as ready for review January 30, 2021 05:54
config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
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.

Also please update Command Reference to reflect the new enable/disable subcommands.

config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
config/muxcable.py Outdated Show resolved Hide resolved
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Feb 3, 2021
**- Why I did it**

sonic-utilities will become dependent upon sonic-platform-common as of sonic-net/sonic-utilities#1386.

**- How I did it**

- Add sonic-platform-common as a dependency in docker-sonic-vs.mk
- Additionally, no longer install Python 2 packages of swsssdk and sonic-py-common, as they should no longer be needed.
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
doc/Command-Reference.md Outdated Show resolved Hide resolved
doc/Command-Reference.md Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
show/muxcable.py Outdated Show resolved Hide resolved
show/muxcable.py Outdated Show resolved Hide resolved
tests/muxcable_test.py Outdated Show resolved Hide resolved
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
show/muxcable.py Outdated Show resolved Hide resolved
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
jleveque
jleveque previously approved these changes Feb 4, 2021
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
@vdahiya12
Copy link
Contributor Author

Retest this please

deran1980 pushed a commit to deran1980/sonic-buildimage that referenced this pull request Feb 4, 2021
**- Why I did it**

sonic-utilities will become dependent upon sonic-platform-common as of sonic-net/sonic-utilities#1386.

**- How I did it**

- Add sonic-platform-common as a dependency in docker-sonic-vs.mk
- Additionally, no longer install Python 2 packages of swsssdk and sonic-py-common, as they should no longer be needed.
@vdahiya12 vdahiya12 merged commit 9e0a4fa into sonic-net:master Feb 4, 2021
@vdahiya12 vdahiya12 deleted the phy_prbs_loopback_changes branch February 4, 2021 20:08
daall pushed a commit that referenced this pull request Feb 6, 2021
…ng prbs, loopback on Y-cable (#1386)

This PR provides the support for adding CLI commands for configuring prbs, loopback and showing the BER and Eye info of the muxcable.
In particular these Cli commands are supported:
` show muxcable eyeinfo <portnumber><target>`
` show muxcable berinfo <portnumber> <target>`

`config muxcable prbs <portnumber> <target> <mode> <lanemap>`
`config muxcable loopback <portnumber> <target> <lanemap>`

#### What is the motivation for this PR?

To add the support for Cli for muxcable to be utilized for configuring prbs, loopback modes and showing the ber, eye info of all the Port/Ports on a muxcable.

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Feb 6, 2021
sonic-utilities will become dependent upon sonic-platform-common as of sonic-net/sonic-utilities#1386.
anand-kumar-subramanian pushed a commit to anand-kumar-subramanian/sonic-utilities that referenced this pull request Mar 2, 2021
…ng prbs, loopback on Y-cable (sonic-net#1386)

This PR provides the support for adding CLI commands for configuring prbs, loopback and showing the BER and Eye info of the muxcable.
In particular these Cli commands are supported:
` show muxcable eyeinfo <portnumber><target>`
` show muxcable berinfo <portnumber> <target>`

`config muxcable prbs <portnumber> <target> <mode> <lanemap>`
`config muxcable loopback <portnumber> <target> <lanemap>`

#### What is the motivation for this PR?

To add the support for Cli for muxcable to be utilized for configuring prbs, loopback modes and showing the ber, eye info of all the Port/Ports on a muxcable.

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 13, 2021
sonic-utilities will become dependent upon sonic-platform-common as of sonic-net/sonic-utilities#1386.
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.

3 participants