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

[portconfig] Validate duplicate speed value and interface type value #1745

Merged
merged 2 commits into from
Sep 14, 2021

Conversation

Junchao-Mellanox
Copy link
Collaborator

What I did

Validate input parameter for command config interface advertised-speeds and config interface advertised-types, make sure there is no duplicate speeds or types

How I did it

Split input speeds/types with "," and check if there is a duplication, if yes, print an error.

How to verify it

  1. new unit test case
  2. manual test

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)

admin@sonice:$ sudo config interface advertised-speeds Ethernet4 100000,25000,100000
Invalid speed specified: 100000,25000,100000
Please remove duplicate speed
admin@sonic:$ sudo config interface advertised-types Ethernet4 CR,CR4,CR4
Invalid interface type specified: CR,CR4,CR4
Please remove duplicate interface type

@Junchao-Mellanox
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 1745 in repo Azure/sonic-utilities

keboliu
keboliu previously approved these changes Aug 16, 2021
scripts/portconfig Outdated Show resolved Hide resolved
scripts/portconfig Outdated Show resolved Hide resolved
@liat-grozovik
Copy link
Collaborator

@keboliu can you please signoff?

@qiluo-msft qiluo-msft merged commit 47a9a0f into sonic-net:master Sep 14, 2021
@Junchao-Mellanox Junchao-Mellanox deleted the validate-auto-neg branch September 14, 2021 10:22
judyjoseph pushed a commit that referenced this pull request Sep 14, 2021
…1745)

#### What I did

Validate input parameter for command `config interface advertised-speeds` and `config interface advertised-types`, make sure there is no duplicate speeds or types

#### How I did it

Split input speeds/types with "," and check if there is a duplication, if yes, print an error.

#### How to verify it

1. new unit test case
2. manual test
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.

5 participants